Khronos public bugtracker – Bug 766
shader-with-too-many-uniforms causing conformance failure in 1.0.2
Last modified: 2013-01-10 17:39:18 PST
shader-with-too-many-uniforms.html in the 1.0.2 test suite validates that there will be a link error generated if the number of uniforms is > MAX_FRAGMENT/SHADER_UNIFORM_VECTORS. However, in our OpenGLES 2.0 driver, the MAX_VERTEX/FRAGMENT_UNIFORM_VECTORS value returned by the driver isn't a hard limit we enforce. Its more of a recommended limit based on performance considerations. We still allow for the shaders to link in this test case, which causes this test to fail.
Is it necessary that this test be in the WebGL conformance test suite since this is not testing an explicit WebGL spec?
The test is correct AFAICT
A shader that uses every uniform it declares must fail if the number of uniforms is used is greater than MAX_FRAGMENT_UNIFORM_VECTORS or MAX_VERTEX_UNIFORM_VECTORS.
OpenGL ES 2.0 spec
Fragment shaders can access uniforms belonging to the current shader object. The
amount of storage available for fragment shader uniform variables is speciﬁed
by the implementation-dependent constant MAX_FRAGMENT_UNIFORM_VECTORS.
This value represents the number of four-element ﬂoating-point, integer, or boolean vectors that can be held in uniform variable storage for a fragment shader. A link error will be generated if an attempt is made to utilize more than the space available for fragment shader uniform variables.
The amount of storage available for uniform variables accessed by a vertex
shader is speciﬁed by the implementation-dependent constant MAX_VERTEX_-
UNIFORM_VECTORS. This value represents the number of four-element ﬂoatingpoint, integer, or boolean vectors that can be held in uniform variable storage for a
vertex shader. A link error will be generated if an attempt is made to utilize more than the space available for vertex shader uniform variables.
Just to be clear. An implementation is allowed to pack uniforms but the test is designed so that packing is impossible. Every uniform is accessed therefore it should fail.