Sign in to follow this  

Offscreen rendertarget sync problem

This topic is 2819 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

This topic is 2819 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this