Sign in to follow this  
m4ster

Lock. vs Blt SOLVED

Recommended Posts

What do you think is faster? Fill a Surface with black using a Color Blit or a Lock and setting the VRAM to 0? [Edited by - m4ster on January 14, 2007 12:43:00 PM]

Share this post


Link to post
Share on other sites
Can we have a side-order of context to go with that?

I guess DirectDraw, but you could be using Direct3D (IDirect3DDevice9::ColorFill()?)...

Either way, its difficult to say which is faster - the graphics pipeline is a finely balanced beast that often defies sweeping statements regarding performance [smile]

A simple test would be to profile it yourself - I'm sure that both methods wouldn't be hard to write. Just wrap them inside QueryPerformanceCounter() blocks and see what you get...

hth
Jack

Share this post


Link to post
Share on other sites
Hey,

I mean in DirectDraw. I forget to write this, because I just worked with DirectDraw until now.

But I think it is better to use the blitter, because you dont have to care about the pitch.

[Edited by - m4ster on January 14, 2007 12:16:08 PM]

Share this post


Link to post
Share on other sites
I may be wrong, but wouldn't using Blt allow DirectX to take advantage of any hardware support for the operation that may be present on a given computer? If you use Lock and memset or whatever, you will force the operation into main CPU etc.

Share this post


Link to post
Share on other sites
After a long night I decided to take the Blt(and ColorFill) method. Not because of any speed reasons, just because it's simplyer to implement. I haven't to care about the extra memory pieces to make the surface a multiple of 2.

EasilyConfused
Yes, you are right, this is another very important point. Thank you.

[Edited by - m4ster on January 14, 2007 12:50:29 PM]

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