Sign in to follow this  
TheKrust

Drawing without Rendering?

Recommended Posts

Is there a cheap method for copying texture information to another texture, such as, Render to: Texture A copy: Texture A -> Texture B I've been looking for this for a while now. I know that: Texture A = Texture B does not work. That just makes it so every time you render to Tex A, Tex B gets it as well. Not the desired effect. So is there some function like memcopy() or possibly a cheaper method that can preform this? I'm trying to avoid a big drop in frame rate here.

Share this post


Link to post
Share on other sites
It depends where your textures are. If you're rendering to texture A, I assume it's in the default pool, in which case the only way to read from it to Lock() the top-level surface (And then Lock() the top-level surface on Texture B and copy the bits), or to use StretchRect() - which requires that the Texture B is in the default pool too. And StretchRect has some other limitations (Like you need to check for driver support for copying between textures).

Share this post


Link to post
Share on other sites
thanks for the quick reply.

yes, they're in D3DPOOL_DEFAULT.

Wouldn't copying the bits on the CPU be horrendously slow? StretchRect() sounds like a good option. I take it its not really suported on older hardware so that won't be an issue. I'm aiming for newer hardware anyway. So how would I go about doing this?

Share this post


Link to post
Share on other sites
I was hoping to find a more existential discussion... [rolleyes]

Since I'm here though, just though I'd note that StretchRect is gone from DX10.

It exists, no more.

Share this post


Link to post
Share on other sites

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