From b910cd17f4c849961e18cb885555fb2a2bb28f45 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Mon, 16 Nov 2026 12:35:13 -0800 Subject: [PATCH 1/2] Update for DirectXMath 3.22 changes --- DirectXTex/DirectXTexConvert.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DirectXTex/DirectXTexConvert.cpp b/DirectXTex/DirectXTexConvert.cpp index 886a8e05..a5e7f91b 100644 --- a/DirectXTex/DirectXTexConvert.cpp +++ b/DirectXTex/DirectXTexConvert.cpp @@ -2079,7 +2079,7 @@ _Use_decl_annotations_ bool DirectX::Internal::StoreScanline(void* pDestination, if (sPtr >= ePtr) break; XMVECTOR v = XMVectorSwizzle<2, 1, 0, 3>(*sPtr++); -#if defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__ +#if (DIRECTX_MATH_VERSION < 322) && (defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__) v = XMVectorMultiplyAdd(v, s_Scale, g_XMOneHalf); #else v = XMVectorMultiply(v, s_Scale); @@ -2094,7 +2094,7 @@ _Use_decl_annotations_ bool DirectX::Internal::StoreScanline(void* pDestination, if (size >= sizeof(XMU555)) { static const XMVECTORF32 s_Scale = { { { 31.f, 31.f, 31.f, 1.f } } }; -#if defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__ +#if (DIRECTX_MATH_VERSION < 322) && (defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__) static const XMVECTORF32 s_OneHalfXYZ = { { { 0.5f, 0.5f, 0.5f, 0.f } } }; #endif XMU555* __restrict dPtr = static_cast(pDestination); @@ -2103,7 +2103,7 @@ _Use_decl_annotations_ bool DirectX::Internal::StoreScanline(void* pDestination, if (sPtr >= ePtr) break; XMVECTOR v = XMVectorSwizzle<2, 1, 0, 3>(*sPtr++); -#if defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__ +#if (DIRECTX_MATH_VERSION < 322) && (defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__) v = XMVectorMultiplyAdd(v, s_Scale, s_OneHalfXYZ); #else v = XMVectorMultiply(v, s_Scale); @@ -2392,7 +2392,7 @@ _Use_decl_annotations_ bool DirectX::Internal::StoreScanline(void* pDestination, if (sPtr >= ePtr) break; XMVECTOR v = XMVectorSwizzle<2, 1, 0, 3>(*sPtr++); -#if defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__ +#if (DIRECTX_MATH_VERSION < 322) && (defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__) v = XMVectorMultiplyAdd(v, s_Scale, g_XMOneHalf); #else v = XMVectorMultiply(v, s_Scale); @@ -2413,7 +2413,7 @@ _Use_decl_annotations_ bool DirectX::Internal::StoreScanline(void* pDestination, if (sPtr >= ePtr) break; XMVECTOR v = XMVectorSwizzle<3, 2, 1, 0>(*sPtr++); -#if defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__ +#if (DIRECTX_MATH_VERSION < 322) && (defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__) v = XMVectorMultiplyAdd(v, s_Scale, g_XMOneHalf); #else v = XMVectorMultiply(v, s_Scale); @@ -2496,7 +2496,7 @@ _Use_decl_annotations_ bool DirectX::Internal::StoreScanline(void* pDestination, { if (sPtr >= ePtr) break; -#if defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__ +#if (DIRECTX_MATH_VERSION < 322) && (defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__) const XMVECTOR v = XMVectorMultiplyAdd(*sPtr++, s_Scale, g_XMOneHalf); #else const XMVECTOR v = XMVectorMultiply(*sPtr++, s_Scale); From a36c8f50e193a392c82bfac2ce1202832f2ff84c Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Mon, 16 Nov 2026 12:50:37 -0800 Subject: [PATCH 2/2] clang format --- DirectXTex/DirectXTexConvert.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/DirectXTex/DirectXTexConvert.cpp b/DirectXTex/DirectXTexConvert.cpp index a5e7f91b..678f1101 100644 --- a/DirectXTex/DirectXTexConvert.cpp +++ b/DirectXTex/DirectXTexConvert.cpp @@ -2079,7 +2079,8 @@ _Use_decl_annotations_ bool DirectX::Internal::StoreScanline(void* pDestination, if (sPtr >= ePtr) break; XMVECTOR v = XMVectorSwizzle<2, 1, 0, 3>(*sPtr++); -#if (DIRECTX_MATH_VERSION < 322) && (defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__) +#if (DIRECTX_MATH_VERSION < 322) \ + && (defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__) v = XMVectorMultiplyAdd(v, s_Scale, g_XMOneHalf); #else v = XMVectorMultiply(v, s_Scale); @@ -2094,7 +2095,8 @@ _Use_decl_annotations_ bool DirectX::Internal::StoreScanline(void* pDestination, if (size >= sizeof(XMU555)) { static const XMVECTORF32 s_Scale = { { { 31.f, 31.f, 31.f, 1.f } } }; -#if (DIRECTX_MATH_VERSION < 322) && (defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__) +#if (DIRECTX_MATH_VERSION < 322) \ + && (defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__) static const XMVECTORF32 s_OneHalfXYZ = { { { 0.5f, 0.5f, 0.5f, 0.f } } }; #endif XMU555* __restrict dPtr = static_cast(pDestination); @@ -2103,7 +2105,8 @@ _Use_decl_annotations_ bool DirectX::Internal::StoreScanline(void* pDestination, if (sPtr >= ePtr) break; XMVECTOR v = XMVectorSwizzle<2, 1, 0, 3>(*sPtr++); -#if (DIRECTX_MATH_VERSION < 322) && (defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__) +#if (DIRECTX_MATH_VERSION < 322) \ + && (defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__) v = XMVectorMultiplyAdd(v, s_Scale, s_OneHalfXYZ); #else v = XMVectorMultiply(v, s_Scale); @@ -2392,7 +2395,8 @@ _Use_decl_annotations_ bool DirectX::Internal::StoreScanline(void* pDestination, if (sPtr >= ePtr) break; XMVECTOR v = XMVectorSwizzle<2, 1, 0, 3>(*sPtr++); -#if (DIRECTX_MATH_VERSION < 322) && (defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__) +#if (DIRECTX_MATH_VERSION < 322) \ + && (defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__) v = XMVectorMultiplyAdd(v, s_Scale, g_XMOneHalf); #else v = XMVectorMultiply(v, s_Scale); @@ -2413,7 +2417,8 @@ _Use_decl_annotations_ bool DirectX::Internal::StoreScanline(void* pDestination, if (sPtr >= ePtr) break; XMVECTOR v = XMVectorSwizzle<3, 2, 1, 0>(*sPtr++); -#if (DIRECTX_MATH_VERSION < 322) && (defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__) +#if (DIRECTX_MATH_VERSION < 322) \ + && (defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__) v = XMVectorMultiplyAdd(v, s_Scale, g_XMOneHalf); #else v = XMVectorMultiply(v, s_Scale); @@ -2496,7 +2501,8 @@ _Use_decl_annotations_ bool DirectX::Internal::StoreScanline(void* pDestination, { if (sPtr >= ePtr) break; -#if (DIRECTX_MATH_VERSION < 322) && (defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__) +#if (DIRECTX_MATH_VERSION < 322) \ + && (defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__) const XMVECTOR v = XMVectorMultiplyAdd(*sPtr++, s_Scale, g_XMOneHalf); #else const XMVECTOR v = XMVectorMultiply(*sPtr++, s_Scale);