diff --git a/DirectXTex/DirectXTexCompress.cpp b/DirectXTex/DirectXTexCompress.cpp index 23aa74e..07e0c01 100644 --- a/DirectXTex/DirectXTexCompress.cpp +++ b/DirectXTex/DirectXTexCompress.cpp @@ -104,7 +104,7 @@ namespace if (!DetermineEncoderSettings(result.format, pfEncode, blocksize, cflags)) return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); - __declspec(align(16)) XMVECTOR temp[16]; + XM_ALIGNED_DATA(16) XMVECTOR temp[16]; const uint8_t *pSrc = image.pixels; const uint8_t *pEnd = image.pixels + image.slicePitch; const size_t rowPitch = image.rowPitch; @@ -263,7 +263,7 @@ namespace assert(bytesLeft > 0); size_t bytesToRead = std::min(rowPitch, size_t(bytesLeft)); - __declspec(align(16)) XMVECTOR temp[16]; + XM_ALIGNED_DATA(16) XMVECTOR temp[16]; if (!_LoadScanline(&temp[0], pw, pSrc, bytesToRead, format)) fail = true; @@ -441,7 +441,7 @@ namespace return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); } - __declspec(align(16)) XMVECTOR temp[16]; + XM_ALIGNED_DATA(16) XMVECTOR temp[16]; const uint8_t *pSrc = cImage.pixels; const size_t rowPitch = result.rowPitch; for (size_t h = 0; h < cImage.height; h += 4) @@ -534,7 +534,7 @@ namespace DirectX // Scan blocks for non-opaque alpha static const XMVECTORF32 threshold = { { { 0.99f, 0.99f, 0.99f, 0.99f } } }; - __declspec(align(16)) XMVECTOR temp[16]; + XM_ALIGNED_DATA(16) XMVECTOR temp[16]; const uint8_t *pPixels = cImage.pixels; for (size_t h = 0; h < cImage.height; h += 4) { diff --git a/DirectXTex/DirectXTexP.h b/DirectXTex/DirectXTexP.h index 714d0e2..3873ee0 100644 --- a/DirectXTex/DirectXTexP.h +++ b/DirectXTex/DirectXTexP.h @@ -119,6 +119,10 @@ #include +#if (DIRECTX_MATH_VERSION < 315) +#define XM_ALIGNED_DATA(x) __declspec(align(x)) +#endif + #include #include