Jump to content
  • Advertisement
Sign in to follow this  
odessi

Avoiding stall on texture fetch

This topic is 3759 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!