microsoft / DirectXMath

DirectXMath is an all inline SIMD C++ linear algebra library for use in games and graphics apps
https://walbourn.github.io/introducing-directxmath/
MIT License
1.51k stars 231 forks source link

More constexpr usage in DirectXMath #150

Closed Zwaliebaba closed 1 year ago

Zwaliebaba commented 1 year ago

Is there a possibility to include more constexpr for standard functions in DirectXMath? Especially for XMVectorSet

walbourn commented 1 year ago

The implementation of many of these is limited by the support of the underlying intrinsic. _mm_set_ps is not constexpr for example.

Note that for 'vector constants', the better approach is to use XMVECTORF32 and friends which do support constexpr.

https://docs.microsoft.com/en-us/windows/win32/dxmath/pg-xnamath-getting-started#constant-vectors