Jump to content
  • Advertisement
Sign in to follow this  
tcige

why stuck when drawing a lot of triangles

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

for example, drawing 100 * 100 triangles

 

when using D3DCREATE_SOFTWARE_VERTEXPROCESSING, the program is stuck and its cpu usage is high

 

when using D3DCREATE_HARDWARE_VERTEXPROCESSING, the program is ok and its cpu usage is alomost 0

 

so what can i do to make the program ok when using D3DCREATE_SOFTWARE_VERTEXPROCESSING

Share this post


Link to post
Share on other sites
Advertisement

You're not really providing enough information for someone to offer much in the way of help:

 

Your CPU usage will be high when you create with software vertex processing, as the CPU will be performing the transforms for you. You don't define what you mean by 'stuck' usually 'stuck' means a hang, but I don't think you mean that from your description and I'm going to take it that you just mean the CPU usage is high (which should be the case).

 

Conversely your CPU usage will be low with hardware vertex processing, as your hardware will be performing the transforms for you leaving your CPU free for other things.

 

So you've asked a question based on expected behaviour, you should probably show the draw calls you're making.

 

Taking a guess, when you use software vertex processing you must make sure your vertices are consecutive in your vertex buffer, ie. when you call DrawPrimitives the CPU will transform every primitive from start vertex through the vertex count. So make sure you're specifying 100*100 triangles in your draw call rather than 100*100 triangles in a list of 100,000 or something (even for indexed vertices). That's the only 'gotcha' I can think of given your description, if that's not it I would suggest more details if possible.

 

Hopefully that help''s some,

n!

Share this post


Link to post
Share on other sites

for example, drawing 100 * 100 triangles

 

when using D3DCREATE_SOFTWARE_VERTEXPROCESSING, the program is stuck and its cpu usage is high

 

when using D3DCREATE_HARDWARE_VERTEXPROCESSING, the program is ok and its cpu usage is alomost 0

And this is exactly the behaviour you should be experiencing, since You are explicitly forcing DX runtime use CPU to do the transformations instead of GPU.

 

so what can i do to make the program ok when using D3DCREATE_SOFTWARE_VERTEXPROCESSING

Easy. Buy a Faster CPU.

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!