2
\$\begingroup\$

On Mali-400 MP, there's a weird bug with texture binding.

Sometimes, shaders use textures from wrong samplers.

On other mobile and desktop GPUs, the same code works fine, but on Mali, almost every draw call is broken: enter image description here

As you see, lightmap texture (at sampler 6) is used instead of diffuse texture (0).

Anyone knows a workaround to this?

\$\endgroup\$
2
\$\begingroup\$

That was an issue with the driver not compiling uniform sampler2D u_LightmapTexture[MAX_LIGHTMAPS] correctly.

Unrolling the array of sampler2Ds fixed the issue.

\$\endgroup\$
1
  • \$\begingroup\$ Of course! Also, on Adreno (tested on driver 45.0), uniform struct arrays don't work, all struct fields point to the first one. \$\endgroup\$ – Triang3l Sep 19 '14 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.