This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Mali-T628 shader compiler or driver bug on Android? (OK on T604)

Hello Mali dev forums,

We recently had a bug pop up in our user reviews regarding mangled graphics on the Galaxy Note 10.1 2014 edition which runs the Mali-T628 GPU and decided to investigate.

After much debugging and poking around, we tracked it down to this one simple fragment shader:

uniform lowp sampler2D sampler;

varying lowp vec4 blendColor;

varying mediump vec2 texCoord;

void main()

{

    lowp vec4 texColor = texture2D(sampler, texCoord);

    gl_FragColor = 2.0 * blendColor * texColor;

}

Which when used, would cause the output in the BAD image attached. We found that reducing the precision of texCoord from mediump to lowp, the problem went away as in the GOOD image attached.

This particular application shipped around the time the Nexus 10 came to market and is known to have worked fine on the T604 GPU. I do suspect that the fragment shader is not alone in causing this issue since the linkage with the vertex shader could also have effects, however that side of things is relatively simple (I've attached a sample vertex shader).

One thing that makes me hesitate to point at the shader compiler as a culprit is the following odd behaviour. The BAD scene actually renders correctly for 1 frame before getting into a state where the UVs are mangled.

Though we do have a workaround to the issue, I still wanted to bring this up as using lowp UVs isn't typical but only happens to work well with our texture set. Also worry that this bug could spread in various driver branches. Any possibilities that this would be Samsung specific, or do they use ARM reference drivers.

Many thanks,

Stephane

4563.zip
Parents Reply Children