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