Are implicit memory barriers per range?

39 views Asked by At

In opengl, a sort of "double buffering" (or even tripple+) is often used for streamed data, so editing a buffer, while reads from a past operation aren't complete, won't cause long stalls.

For glBufferSubData, opengl checks implicitly added barriers. Now I am left wondering: when instead of orphaning, or N buffers, I use one buffer N times as big, operating on disjoint segments of it per frame, like a ringbuffer, round robin, will the driver notice? Given some mentions¹ I've seen or heard, it should. My worry is, that it might only see reads and writes to the same buffer, and stall regardless.

I'm sure this is a duplicate, but choosing the right search terms proved difficult. Note I am on webgl2, therefore manual sync is afaik not an option, as the features aren't available (e.g. glMapBufferRange)? I am still somewhat a novice in this topic :)


[1]: E.g. (emphasiz mine):

Most attempts to write to a buffer object, either with glBufferSubData or mapping, will halt until all rendering commands using that part of the buffer object have completed.

(https://www.khronos.org/opengl/wiki/Synchronization#Implicit_synchronization)

0

There are 0 answers