Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualcr88192

Posted 02 April 2013 - 02:41 PM

There's no specific OpenGL technique for this.  Instead you allocate two textures (let's call them 0 and 1), then update texture 0/draw using texture 1 and vice-versa on alternate frames.

 

But I'm assuming you can't have both textures bound for this to work, right? If you updated texture 0, and the shaders knew to only sample from texture 1 this frame, would the GPU really know that texture 0 wasn't accessed? Or would you still end up with a synchronous flush from updating texture 0?

 

AFAICT, "the magic" happens when you try to bind and draw using the texture or similar.

so, if the texture is updated but never used, there wont really be a stall (and the driver will update it later at some point).


#1cr88192

Posted 02 April 2013 - 02:39 PM

There's no specific OpenGL technique for this.  Instead you allocate two textures (let's call them 0 and 1), then update texture 0/draw using texture 1 and vice-versa on alternate frames.

 

But I'm assuming you can't have both textures bound for this to work, right? If you updated texture 0, and the shaders knew to only sample from texture 1 this frame, would the GPU really know that texture 0 wasn't accessed? Or would you still end up with a synchronous flush from updating texture 0?

 

AFAICT, "the magic" happens when you try to bind and draw using the texture or similar.

so, if the texture is updated but never bound, there wont really be a stall (and the driver will update it later at some point).


PARTNERS