Advertisement Jump to content
Sign in to follow this  

Directx Internal Optimization

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

From what I have read so far, directx does a fair amount of optimization. E.g: D3D10Device->IASetInputLayout(A); D3D10Device->IASetInputLayout(B); would result in this as directx optimize by setting a dirty region. D3D10Device->IASetInputLayout(B); What about this scenario: D3D10Device->IASetInputLayout(A); DrawMeshOne(); D3D10Device->IASetInputLayout(A); DrawMeshTwo(); Will directx removes the 2nd similar IASetInputLayout() instruction? Or do I have to optimize them by myself? Reason being that each of my CObject class handles the draw code itselfs meaning CObject::Draw() does this:
    for each effect pass
Hence when many CObject::Draw() are executed, it would lead to the above scenario.

Share this post

Link to post
Share on other sites
The D3D10 runtime generally (and in this case, definitely) turns redundant calls like this into a no-op before it gets to the driver. There is still some overhead in any API call, but it's probably as fast or faster than you checking yourself to see if the handles match.

Share this post

Link to post
Share on other sites
State management and optimization in D3D10 is a lot better than with D3D9. Previously it was a serious concern to all AppDev's to ensure an optimal and efficient interaction with the API, but with D3D10 it can (at least initially) take more of a back seat. As in more conventional optimization - wait until it shows up in your "worst offenders" list before you expend substantial effort on improving it.

Tools like NVPerfHUD are good for trying to identify where the bottlenecks really are. You can start to trace this sort of thing back to the characteristics of your application and hence identify where the code needs attention.


Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!