Flutter運行時出現D/skia ( 1414): Shader compilation error的解決方法


問題:在模擬器運行時出現這種情況

D/skia    ( 1414): Shader compilation error
D/skia    ( 1414): ------------------------
D/skia    ( 1414):    1 #version 100
D/skia    ( 1414):    2
D/skia    ( 1414):    3 #extension GL_OES_EGL_image_external : require
D/skia    ( 1414):    4 precision mediump float;
D/skia    ( 1414):    5 precision mediump sampler2D;
D/skia    ( 1414):    6 precision mediump samplerExternalOES;
D/skia    ( 1414):    7 uniform samplerExternalOES uTextureSampler_0_Stage0;
D/skia    ( 1414):    8 varying highp vec2 vlocalCoord_Stage0;
D/skia    ( 1414):    9 void main() {
D/skia    ( 1414):   10     mediump vec4 outputColor_Stage0;
D/skia    ( 1414):   11     {
D/skia    ( 1414):   12         outputColor_Stage0 = vec4(1.0);
D/skia    ( 1414):   14         texCoord = vlocalCoord_Stage0;
D/skia    ( 1414):   15         outputColor_Stage0 = texture2D(uTextureSampler_0_Stage0, texCoord);        
D/skia    ( 1414):   16     }
D/skia    ( 1414):   17     {
D/skia    ( 1414):   18         gl_FragColor = outputColor_Stage0;
D/skia    ( 1414):   19     }
D/skia    ( 1414):   20 }
D/skia    ( 1414):   21
D/skia    ( 1414): Errors:
D/skia    ( 1414): ERROR: 0:6: 'GL_OES_EGL_image_external' : extension is disabled
D/skia    ( 1414): ERROR: 0:6: 'samplerExternalOES' : unsupported type
D/skia    ( 1414):

解決方法:

1:我的解決方法:清空模擬器運行內存,並且清理磁盤,把極速渲染模式(DirectX)更換為兼容模式(OpenGL)。

2:其他方法:

1)運行 flutter clean再運行flutter run

2)運行flutter run --enable-software-rendering

 

這種情況出現的話大概率是模擬器內存問題,清理內存就好了,flutter clean不行的話就手動清理。

歡迎討論!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM