I'm building a high-performance UI layout engine on top of Direct3D 11. The application is being developed using Visual Studio 2013, targeting x64 and is intended for Windows 7 (with Platform Update) and up.
I need to do matrix transformations on 2D elements in the visual tree and I am wondering whether using DirextXMath's built-in (SIMD-optimized) XMMATRIX
and its related functions is efficient for 2D use (as that only requires a 3x3 matrix while XMMATRIX
et al is 4x4), or whether I should roll my own matrix class / functions (probably without any SIMD-specific code, though).
It seems to me that a 4x4 matrix throughout would mean a lot of redundant calculations being performed, but then again that might be offset by SIMD instructions when compared to non-SIMD 3x3 matrix work.
Edit: Comments about how "premature optimization is the root of all evil" (and derivatives thereof) are superfluous here (and ironically premature, since you know nothing about the project - or me). The question sums up what I am interested in some viewpoints on / knowing more about.