Here is a snippet demonstrating the issue
for( int i = 0; i < MAX_DIRECTIONAL_LIGHTS; i++ )
{
lv.lightVec = fragIn.directionLightsDir[i].xyz;
lv.lightColor = directionalLights[i].attrib1.rgb;
lv.attenuation = 1.0;
ApplyBRDF( lv, diffuseAccum, specularAccum );
diffuseContrib+=diffuseAccum;
specularContrib+=specularAccum;
}
MAX_DIRECTIONAL_LIGHTS is defined in the global scope as const int MAX_DIRECTIONAL_LIGHTS = 2;
The accumulated value returns garbage with the loop, however if I remove the loop ( just repeat the loop body twice ), the result is correct. Again tested on a Mali GPU and with desktop GL and the loop works fine. Any clue ?
Issue with constant indexing in fragment shader
Posted: Mon, 2014-12-15 16:27
This seems to be a problem that we've seen on several 8974-based devices, but not on more recent devices (8084 and 8994) . We'll need to investigate further...