[Public WebGL] WebGL2 and no mapBuffer/mapBufferRange

Florian Bösch [email protected]
Thu Mar 12 00:43:22 PDT 2015


glMapBuffer with the unsynchronized bit cannot set the the read flag:

GL_INVALID_OPERATION is generated for any of the following conditions:
> -  GL_MAP_READ_BIT is set and any of GL_MAP_INVALIDATE_RANGE_BIT,
> GL_MAP_INVALIDATE_BUFFER_BIT, or GL_MAP_UNSYNCHRONIZED_BIT is set.


It also states that:

GL_MAP_UNSYNCHRONIZED_BIT indicates that the GL should not attempt to
> synchronize pending operations on the buffer prior to returning from
> glMapBufferRange. No GL error is generated if pending operations which
> source or modify the buffer overlap the mapped region, but the result of
> such previous and any subsequent operations is undefined.


In a nutshell this means for instance if you do:

   1. first mapBuffer[Range] for read or write without unsynchronized bit
   2. do a second mapBufferRange overlapping a previous still active
   mapping in step #1 and set the unsynchronized bit, that the result of step
   #1 is undefined.

Since it is undefined, this indicates that this usage scheme is not very
useful, and so I find it entirely permissible to restrict overlap for that
case and generate an invalid operation.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://khronos.org/pipermail/public_webgl_khronos.org/attachments/20150312/7998be46/attachment.html>


More information about the public_webgl mailing list