Khronos Public Bugzilla
Bug 766 - shader-with-too-many-uniforms causing conformance failure in 1.0.2
shader-with-too-many-uniforms causing conformance failure in 1.0.2
Status: NEW
Product: WebGL
Classification: Unclassified
Component: Conformance Tests
unspecified
PC Linux
: P3 normal
: ---
Assigned To: 3dweb Working Group email alias
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-10 16:39 PST by Chris Green
Modified: 2013-01-10 17:39 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Green 2013-01-10 16:39:17 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?
Comment 1 Gregg Tavares 2013-01-10 17:38:07 PST
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 

section 3.8.1

Fragment shaders can access uniforms belonging to the current shader object. The
amount of storage available for fragment shader uniform variables is specified
by the implementation-dependent constant MAX_FRAGMENT_UNIFORM_VECTORS.
This value represents the number of four-element floating-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.

Section 2.10.4

The amount of storage available for uniform variables accessed by a vertex
shader is specified by the implementation-dependent constant MAX_VERTEX_-
UNIFORM_VECTORS. This value represents the number of four-element floatingpoint, 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.
Comment 2 Gregg Tavares 2013-01-10 17:39:18 PST
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.