Jump to content
  • Advertisement
Sign in to follow this  
Vertex333

Offscreen rendertarget sync problem

This topic is 3029 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 have a maybe well known problem and need the best solution for it. I use Direct2D1, but it shouldn't differ much from an equal szenario in Direct3D. Imagine you draw elements to a main rendertarget (RT). The elements are not drawn directly, they are drawn via an offscreen RT (there is more than one reason for this). It looks like this (pseudo code): begindraw main RT begindraw offscreen RT clear offscreen RT draw simple rectangle 1 enddraw offscreen RT draw offscreen RT to main RT begindraw offscreen RT clear offscreen RT draw simple rectangle 2 enddraw offscreen RT draw offscreen RT to main RT enddraw main RT At enddraw main RT (when the calls get send to graphics card) the content of the offscreen RT contains rectangle 2 for both draw "offscreen RT to main RT" operations. Why? because the two RTs are asynchron. I could handle it by using flush to force a draw to main RT, but for more than 1000 elements this would hurt performance (as well as using >1000 RTs). Any ideas how to do this, or whats best practice for (re-)using offscreen RTs for single elements. Is there a way to sync the operation of the two RTs to get them executed correctly when enddraw of main RT gets called or so? thx, Vertex

Share this post


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