Jump to content
  • Advertisement
Sign in to follow this  
doctorsixstring

"Cost" of various DirectX calls

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

A while back I remember looking at a list of the various DirectX functions and their performance relative to each other. I can't seem to find the link, so I will pose my question here. I am currently working on my own scene graph system, and I'm trying to figure out the best way to order my nodes. In other words, a single rendered "entity" could be represented by a world transformation, a texture, a material, and a set of triangles. I want to group these nodes together, when possible. In other words, I want to minimize the number of times I change the current texture, material, transformation, current geometry source, etc. The more expensive operations would go near the "top" of the entity's set of nodes (where they are more likely to be grouped), while the less expensive operations would be at the bottom. In summary, what is the order of performance of the following operations: SetTexture() SetMaterial() SetTransform() SetStreamSource() DrawPrimitives/DrawIndexedPrimitives() SetVertexShader() SetPixelShader() SetRenderState() I'm looking for a rough guideline here. I'm not expecting exact benchmarks (since they don't really exist). - Mike

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Brian Klamik
We published a rough list available in the Appendix of "Accurately Profiling Direct3D API calls".

It's available at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/programmingguide/advancedtopics/ProfilingDirect3D.asp


brilliant! Rating++ (first time I ever rated anyone)

So it seems that in the most average case, its better to sort your states by vertex-shader/pixel-shader rather than by textures (assuming such a situation occurs).

I always thought that texture-changes were the killers.

Incidentally, I noticed that "present" was not in the list, which IMO is the flagship of slowness, but I guess everyone needs to do a present no matter what (each frame).

Share this post


Link to post
Share on other sites
Perfect - just what I was looking for. The "Average number of Cycles" looks suspiciously familiar - I would bet that the article I'm thinking of took the list from there.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!