Adreno 220 GLSL错误

时间:2013-01-03 15:48:04

标签: android opengl-es opengl-es-2.0 glsl

我们在使用 Adreno 220 GPU的 Sony Xperia S 手机上遇到GLSL alpha测试问题。设备正在运行Android 4.0.4。

Adreno 200,Adreno 205,Adreno 225 以及 Tegra2 Mali400 PowerVR GPU上工作正常。

着色器代码:

// vertex
            uniform highp mat4 uMVPMatrix;
            attribute highp vec4 aPosition;
            attribute highp vec2 aTextureCoord;
            varying mediump vec2 vTextureCoord;
            void main() {
              gl_Position = uMVPMatrix * aPosition;
              vTextureCoord = aTextureCoord;
            } 

// fragment
            precision mediump float;
            varying mediump vec2 vTextureCoord;
            uniform sampler2D sTexture;
            uniform sampler2D sAlpha;
            uniform vec4 uBlendColor;
            void main() {
             vec4 base = texture2D(sTexture, vTextureCoord);
             if(texture2D(sAlpha, vTextureCoord).r < 0.5){ discard; }
             else { gl_FragColor = base * uBlendColor; }
            }

bug的屏幕截图: Buggy

在其他设备上更正结果: Without bug

请告知可能导致此类视觉故障的原因,查找原因的方法以及可能的解决方法。

编辑:HTC Rezound的旧库存ROM确认了相同的错误。有关详细信息,请参阅我的回答。

1 个答案:

答案 0 :(得分:0)

我已经要求在xda开发人员的不同固件上测试应用程序。在某些设备上它可以正常工作,而在另一台设备上则存在这种视觉故障。

所以我得出结论,它与OpenGL驱动程序中的一些错误有关,这些错误已在某些非库存ROM中修复。

编辑:确认这是旧高通公司Adreno 220驱动程序中的一个错误。在具有库存4.0.3 ROM的 HTC Rezound 手机(也是Adreno 220)上有同样的错误,它不仅存在于我的应用程序中,而且也存在于某些游戏中 - 缺少某些行或像素某些物体。生根并安装CM 4.1后,bug消失了。

相关问题