[Public WebGL] Possibility of not writing gl_Position is not addressed by WebGL spec

Kenneth Russell [email protected]
Tue Jun 18 16:23:02 PDT 2013


For complex vertex shaders, it will be difficult or impossible to
assert that gl_Position is statically written to. It's similarly
difficult to statically determine whether array indexing expressions
are in-range, which is why
http://www.khronos.org/registry/webgl/specs/latest/#4.5 is phrased the
way it is; it's legal for a WebGL implementation to catch the error
either at shader compilation time or at run time, so long as
out-of-range data can't be accessed. The conformance suite enforces
this behavior.

While it's true that undefined behavior is undesirable, tightening
this particular area of the spec is extremely problematic. Since there
doesn't seem to be any associated security issue I think the WebGL
spec should remain as is.

GLSL ES 1.0.17 section 10.13 is pretty clear that not writing
gl_Position is not an error, meaning that shader compilation must
succeed. The same issue with this test has been raised by another
OpenGL ES vendor recently, and the decision was made by the working
group that the test should remain as is.

-Ken



On Tue, Jun 18, 2013 at 8:53 AM, Olli Etuaho <[email protected]> wrote:
>
> Hi all,
>
> GLSL ES spec 1.0.17 section 10.13 says that not writing gl_Position results in undefined behavior, which is undesirable in WebGL. Current WebGL implementations do seem to enforce statically writing to gl_Position, but it's not mentioned in the WebGL spec. Should this be explicitly specified in the "Differences Between WebGL and OpenGL ES 2.0" section?
>
> There's also a related problem in the conformance test glsl/literals/float_literal.vert.html, where vertex shader does not write gl_Position. I think the test should be fixed by adding writing to gl_Position.
>
> A new test could also be written that specifically checks that not writing to gl_Position in a vertex shader will result in a shader compilation error.
>
> Regards, Olli
> -----------------------------------------------------------
> You are currently subscribed to [email protected]
> To unsubscribe, send an email to [email protected] with
> the following command in the body of your email:
> unsubscribe public_webgl
> -----------------------------------------------------------
>

-----------------------------------------------------------
You are currently subscribed to [email protected]
To unsubscribe, send an email to [email protected] with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------





More information about the public_webgl mailing list