[Public WebGL] Spec modification regarding out-of-range array indexing in shaders

Kenneth Russell [email protected]
Wed Nov 12 16:34:41 PST 2014


Security in the WebGL API is paramount. In order to support WebGL
unconditionally on the web, it's been necessary to precisely define
many behaviors left undefined in the OpenGL ES specifications.

One significant area where the WebGL specification defines previously
undefined behavior is out-of-range array indexing in shaders. Up to
this point, the WebGL spec has been overly cautious in the name of
security. However, unfortunately, on many GPUs this definition has
significantly impacted the performance of shaders.

Most GPUs nowadays implement the required security properties for
WebGL in hardware. In order to take advantage of this support, the
specification has been modified. The new behavior is defined here:

  https://www.khronos.org/registry/webgl/specs/latest/1.0/#4.5

and was incorporated in this pull request:

  https://github.com/KhronosGroup/WebGL/pull/769

This new behavior is in line with the KHR_robustness [1] and
KHR_robust_buffer_access_behavior [2] specifications, as well as the
Direct3D 10 specification which first introduced these security
properties. On most GPUs this will simplify the browsers'
transformations of shaders and speed up shader execution.

If you have any concerns about this change please post them to the list.

Thanks,

-Ken

[1] https://www.opengl.org/registry/specs/KHR/robustness.txt
[2] https://www.opengl.org/registry/specs/KHR/robust_buffer_access_behavior.txt

-----------------------------------------------------------
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