Jump to content
  • Advertisement
Sign in to follow this  
m4ster

Lock. vs Blt SOLVED

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

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
Advertisement
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
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!