0
votes

Are some limits of shader's size or variable's number in fragment shader?

I've fragment shader, which returns empty image after some threshold size of code. I think, that problem is in limit of shader's size or number of variables.

I check my shader program after compilation - all is ok.

Apple said:

OpenGL ES limits the number of each variable type you can use in a vertex or fragment shader. The OpenGL ES specification doesn’t require implementations to provide a software fallback when these limits are exceeded; instead, the shader simply fails to compile or link.

Khronos said:

2 Length of Shader Executable This is defined by the conformance tests. 3 Usage of Temporary Variables The maximum number of variables is defined by the conformance tests.

But I can't find value of this limits.

UPDATE:

Sometimes application is interrupted on glFlush or glDrawArrays with EXC_BAD_ACCESS, if image is big.

SOLVED

Problem was in too long loop and from whence in long calculation time. Shader is no big, but very complexity.

UPDATE

Same problem: GPUImage Kuwahara filter on iPhone 4S

1
I don't think you can query the maximum length. The compilation should fail if you exceed it, though. - Reto Koradi
I think, that problem is in the long loop. But I can't do that otherwise. I think, that principally another approach must be implemented here. - George
Post your shader. That's going to be the only way to get help. - badweasel

1 Answers

-1
votes

If you are checking the results of your shader compilations and linking (like instructed in Listing 10-1 in Apple's best practices.) and there are no errors, something else causes your empty image.

If you are not checking the log, you should start checking :)