WebGL WEBGL_draw_elements_no_range_check Extension Rejected Specification




WebGL working group (public_webgl 'at' khronos.org)


Olli Etuaho, NVIDIA

Jeff Gilbert, Mozilla

Members of the WebGL working group


Last modified date: January 24, 2015
Revision: 3


WebGL extension #NN


Written against the WebGL API 1.0 specification.


drawElements robustness is currently ensured by checking indices in the element array buffer against the size of the array buffer they are indexing. These checks are undesirable from a performance perspective, since they introduce CPU overhead to the API and require index buffers to have a copy in CPU-accessible memory.

This extension changes the behavior of drawElements to use security features built into hardware, bypassing the CPU-side range check and improving performance. The drawback is that if out-of-range indices are referenced by drawElements, no error is generated and the rendering results of that call will be undefined. However, supplying out-of-range indices to drawElements will not result in reading vertex data from outside the enabled vertex buffer objects, nor abnormal program termination, as specified in the OpenGL extension ARB_robust_buffer_access_behavior.

It is suggested that this extension is left disabled when debugging. Any INVALID_OPERATION errors from drawElements seen while the extension is off mean that the application is supplying incorrect indices to the API, even if rendering results would seem correct when this extension is enabled.

This extension interacts with ANGLE_instanced_arrays.

When this extension is enabled:


[Exposed=(Window,Worker), LegacyNoInterfaceObject]
interface WEBGL_draw_elements_no_range_check {


Revision History

Revision 1, 2014/03/14

Revision 2, 2014/07/15

Revision 3, 2015/01/24