Avoiding stall on texture fetch

Started by
4 comments, last by bzroom 16 years ago
I'm reading back from a rendertexture (unavoidable, unfortunately) and obviously it's causing a big hit in performance. I've read that it's possible to wait until the GPU has "flushed its pipeline" before requesting the texture, as long as you don't mind the slight lag that this causes. How do you go about doing this? How do you know when the right time to get the texture is?
Advertisement
Wait a frame or two before trying to read it back
Quote:Original post by AndyPandyV2
Wait a frame or two before trying to read it back

I guess I don't understand. Wait a frame or two after doing what? I'm getting the data with glGetTexImage.
He means wait a frame or two after you have written to the render texture so that the GPU is no longer using it for any purpose.

Even then i'm not sure it would remove the stall completely; the best way to do that would be to use a Pixel Buffer Object to read back the data in an async. manner.
Oh, it was that simple. :D

Got my FPS up from 200 to 1100 (which it was at previously) so I think it's likely the stall is completely gone, but I'll take a look at pixel buffers too. Cheers.
200 to 1100 !!!! 0_o

you need some freakin' content haha.

but anyways. texture stalls are funny. If i disable HDR in my engine i lose about 10 frames per second.. FTW? HDR uses like 6 more shader changes and a ton of buffer swapping and it's still significantly faster than _not_ doing all that stuff... bazarre.

This topic is closed to new replies.

Advertisement