[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Public WebGL] Conformance test change around active uniforms

Ahh, yes, I see that now in on page 35 of the OpenGL spec: “The value -1 will be returned if name does not correspond to an active uniform variable name in program or if name starts with the reserved prefix "gl_".”  Thank you for the clarification, Jeff.

I know that we have conformance tests that ensure an error is returned if you call getAttribLocation with a name that begins with ‘gl_’.  If we don’t already have the same thing for getUniformLocation, we should add those.


From: Jeff Gilbert [mailto:jgilbert@mozilla.com]
Sent: Wednesday, March 18, 2015 7:00 PM
To: Rafael Cintron
Cc: Kenneth Russell; public_webgl@khronos.org
Subject: Re: [Public WebGL] Conformance test change around active uniforms


getUniformLocation returns null for any name starting with a reserved prefix. The uniforms are 'active', but you can't get or set them via normal means.


On Wed, Mar 18, 2015 at 6:53 PM, Rafael Cintron <Rafael.Cintron@microsoft.com> wrote:

In the shader, gl_DepthRange is meant to reflect what you set via the depthRange function.  Are these builtin uniforms able to be returned via getUniformLocation and set via uniformXXX?  If so, what ends up winning, depthRange or uniformXXX? 


From: owners-public_webgl@khronos.org [mailto:owners-public_webgl@khronos.org] On Behalf Of Jeff Gilbert
Sent: Wednesday, March 18, 2015 6:28 PM
To: Kenneth Russell
Cc: public_webgl@khronos.org
Subject: Re: [Public WebGL] Conformance test change around active uniforms


I advise that we not fake the inclusion of the third part of gl_DepthRange, since this impacts active uniform packing, even if the driver is apparently not packing them. (as indicated by not exposing the third part in the list of active uniforms)

Active uniforms is not so much 'what am I using', but rather 'what is the driver using'.


On Wed, Mar 18, 2015 at 6:01 PM, Kenneth Russell <kbr@google.com> wrote:

There's been a longstanding issue with the WebGL conformance tests
that were ported from the OpenGL ES 2.0 suite. To ensure consistency
between implementations, the WebGL harness is stricter than the OpenGL
ES one in requiring certain uniforms to be considered active or
inactive in the various test cases.

Jeff Gilbert from Mozilla rediscovered this discrepancy in
https://github.com/KhronosGroup/WebGL/pull/888 and found the root
cause: some implementations were exposing the built-in uniforms
gl_DepthRange.near, gl_DepthRange.far and gl_DepthRange.diff as active
uniforms, and some weren't.

Now that the difference in behavior is well understood, these tests
have been changed in the top of tree conformance suite to require that
these uniforms be reported as active when they are referenced in the
shaders. Please see https://github.com/KhronosGroup/WebGL/pull/902 .

The reason that only some, and not all, of these three built-in
uniforms were required to be present is pragmatic: some drivers seem
to optimize one of them away and compute it from the other two. If
necessary, implementations could be changed to report all of them.

If you have any comments on this change please post them to the list.
The archived WebGL conformance suites have been changed to allow both
the old and new behavior.



You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl