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
  • rockettree Thanks for reporting - I'll hand this over to our development team - having a second test case is always useful to make sure we have really fixed it


    > Specifying lowp did not fix the problem


    Mali treats lowp the same as mediump (both are fp16), so if mediump fails I would expect lowp to fail the same way.


    > I somewhat expected the issue to creep into the Nexus 10 distro.


    Yeah, unfortunately the latency in the driver deployment pipeline means bugs in one product sometimes crop up again later in another one if that vendor takes a little longer to push out a driver update. The original bug reported by stepjac  has been fixed for a while in our driver tree - so just waiting for this one to get pulled downstream ...


    Cheers,

    Pete



Reply
  • rockettree Thanks for reporting - I'll hand this over to our development team - having a second test case is always useful to make sure we have really fixed it


    > Specifying lowp did not fix the problem


    Mali treats lowp the same as mediump (both are fp16), so if mediump fails I would expect lowp to fail the same way.


    > I somewhat expected the issue to creep into the Nexus 10 distro.


    Yeah, unfortunately the latency in the driver deployment pipeline means bugs in one product sometimes crop up again later in another one if that vendor takes a little longer to push out a driver update. The original bug reported by stepjac  has been fixed for a while in our driver tree - so just waiting for this one to get pulled downstream ...


    Cheers,

    Pete



Children
No data