Jump to content

  • Log In with Google      Sign In   
  • Create Account

why stuck when drawing a lot of triangles


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 tcige   Members   -  Reputation: 206

Like
0Likes
Like

Posted 29 April 2013 - 09:59 PM

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



Sponsor:

#2 nfactorial   Members   -  Reputation: 731

Like
1Likes
Like

Posted 30 April 2013 - 01:36 AM

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!



#3 VladR   Members   -  Reputation: 722

Like
2Likes
Like

Posted 30 April 2013 - 02:39 PM

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.

VladR    My 3rd person action RPG on GreenLight:    http://steamcommunity.com/sharedfiles/filedetails/?id=92951596

 





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS