Sign in to follow this  
Chris_J_H

XNA Math equivalent of ID3DXMatrixStack?

Recommended Posts

Chris_J_H    256

Hi - quick topic (I hope): I am refactoring my C++ directx9 game that makes use of an ID3DXMatrixStack in its scene node tree rendering traversal. I am trying to eliminate all references to the old D3DXMath library replacing all with XNA Math/DirectXMath to use SSE. Firstly: is there an equivalent XNA Math Matrix Math structure? - there doesn't appear to be so, so failing that would you give  some suggestions for replacement implementation - and what might be normal? From what I see any solution seems to require an aligned XMMATRIX structure member... if I am to pick-up the SSE performance gain. Thanks vm.

Share this post


Link to post
Share on other sites
MJP    19754

Unfortunately there's no equivalent for ID3DXMatrixStack. However if you know how it works it shouldn't be terribly difficult to implement your own version. If you're going to use something like std::vector to store the matrices in the stack you can store them as XMFLOAT4X4, and then load that into an XMMATRIX only when you need to do math operations with that matrix.

Share this post


Link to post
Share on other sites
Chris_J_H    256
Unfortunately there's no equivalent for ID3DXMatrixStack. However if you know how it works it shouldn't be terribly difficult to implement your own version. If you're going to use something like std::vector to store the matrices in the stack you can store them as XMFLOAT4X4, and then load that into an XMMATRIX only when you need to do math operations with that matrix.

Fair enough,thanks - I was thinking that maybe i would end up putting passing around XMMATRIX values in the function calls to try to keep the values in the SIMD registers but that is probably over-thinking things... I should go for the direct equivalent and optimize later (if necessary).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this