Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does glSubTexImage block?

This is a question about syncronization in OpenGL. And the question is:

At which point in the following (pseudo) code sample does syncronization happen.

// 1.
try to map buffer object (write only and invalidate buffer)
  copy new data to mapped buffer   
unmap buffer

// 2.
bind buffer
  call subteximage to fill texture from buffer
unbind buffer

// 3.
render with texture

As far as i know syncronization happens as soon as 'an object is used'. Now it's questionable if the texture is used if it is filled from the buffer or if it is used in rendering.

If glSubTexImage doesn't block it would be possible to generally stream texture data by using buffer updates in texture update calls.

Florian

like image 445
fho Avatar asked Aug 28 '26 00:08

fho


1 Answers

Your code can block anywhere between copy and glFlush after render with texture (or frame buffer swap). It's up to the implementation.

like image 200
Yakov Galka Avatar answered Aug 29 '26 18:08

Yakov Galka



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!