diff --git a/DirectXTex/DirectXTexMipmaps.cpp b/DirectXTex/DirectXTexMipmaps.cpp index 7fb5549..28245ed 100644 --- a/DirectXTex/DirectXTexMipmaps.cpp +++ b/DirectXTex/DirectXTexMipmaps.cpp @@ -260,10 +260,17 @@ namespace for (size_t x = 0; x < srcImage.width - 1; ++x) { // [0]=(x+0, y+0), [1]=(x+0, y+1), [2]=(x+1, y+0), [3]=(x+1, y+1) - XMVECTOR v1 = XMVectorSaturate(XMVectorMultiply(XMVectorSplatW(*pRow0), scale)); - const XMVECTOR v2 = XMVectorSaturate(XMVectorMultiply(XMVectorSplatW(*pRow1), scale)); - XMVECTOR v3 = XMVectorSaturate(XMVectorMultiply(XMVectorSplatW(*(pRow0++)), scale)); - const XMVECTOR v4 = XMVectorSaturate(XMVectorMultiply(XMVectorSplatW(*(pRow1++)), scale)); + XMVECTOR r0 = XMVectorSplatW(*pRow0); + XMVECTOR r1 = XMVectorSplatW(*pRow1); + + XMVECTOR v1 = XMVectorSaturate(XMVectorMultiply(r0, scale)); + XMVECTOR v2 = XMVectorSaturate(XMVectorMultiply(r1, scale)); + + r0 = XMVectorSplatW(*(++pRow0)); + r1 = XMVectorSplatW(*(++pRow1)); + + XMVECTOR v3 = XMVectorSaturate(XMVectorMultiply(XMVectorSplatW(r0), scale)); + XMVECTOR v4 = XMVectorSaturate(XMVectorMultiply(XMVectorSplatW(r1), scale)); v1 = XMVectorMergeXY(v1, v2); // [v1.x v2.x --- ---] v3 = XMVectorMergeXY(v3, v4); // [v3.x v4.x --- ---]