XNA Math equivalent of ID3DXMatrixStack?

Started by
1 comment, last by Chris_J_H 11 years, 3 months ago

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.

Advertisement

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.

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).

This topic is closed to new replies.

Advertisement