Using fence sync objects in OpenGL

前端 未结 1 2066
遥遥无期
遥遥无期 2021-02-15 20:50

I am trying to look for scenarios where Sync Objects can be used in OpenGL. My understanding is that a sync object once put in GL command stream ( using glFenceSync() ) will be

1条回答
  •  一整个雨季
    2021-02-15 21:26

    Fences are not so much meant to synchronize threads, but to know, when asynchronus operations are finished. For example if you do a glReadPixels into a pixel buffer object (PBO), you might want to know, that the read has been completed, before you even attempt to read from or map the PBO to client address space.

    If you do a glReadPixels with a PBO being the target, the call will return immediately, but the data transfer may indeed take some time. That's where fences come in handy.

    0 讨论(0)
提交回复
热议问题