1
$\begingroup$

I've encountered a very strange issue while testing UBO on Android device: if I try to index UBO array with non-constant index, the program fails to link with log: Internal error.

For example, this works (in fragment shader):

layout (std140) uniform TestUBO
{
    vec4 Test[2];
};

...

const int i = 0;
out_color = Test[i];
...

But this won't even link:

layout (std140) uniform TestUBO
{
    vec4 Test[2];
};

...

int i = 0; // No "const" here
out_color = Test[i];
...

I should mention that both cases work on desktop and on another android device; the second case only doesn't work on HTC Desire 601. And I don't understand why: according to vendor string it supports OpenGL ES 3.0 and GLSL ES 3.0 (see here for more info). I thought OpenGL ES 3.0 allows non constant indexing explicitly.

Any reason why this doesn't work? Any possible workarounds?

$\endgroup$

Your Answer

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

Browse other questions tagged or ask your own question.