We're hitting an issue with some piece of shader code in our app on Android. It only happens on Adreno GPU's, we thought maybe anyone here might have an idea...
We're rendering our objects with a shader that does a standard texture fetch and multiplies the diffuse lighting color to it. It works fine on most devices but on Adreno, the resulting color feels as if the diffuse multiplication is ignored and only the texture color is used.
Our fragment shader code looks like this:
float4 color = SAMPLE_TEXTURE(Texture, in.TexCoord) * in.Diffuse;
Our input values seem normal, outputing in.Diffuse returns the normal shading based on the current light position, ambient, normals etc...
We tested some variations to try to isolate the issue so for instance, taking the alpha out of the equation makes things work as expected (except for the broken rendering of transparent objects), ex:
color.rgb = SAMPLE_TEXTURE().rgb * in.Diffuse.rgb;
But as soon as alpha is mixed in there, it's as if we did color = SAMPLE_TEXTURE();
What's interesting is that when we run the app in the Adreno Profiler, the shading looks perfectly fine, the diffuse multiplication is properly done...
Any hints or debugging ideas would be welcome :)