diff --git a/Texassemble/texassemble.cpp b/Texassemble/texassemble.cpp index fd1ccd4..eef1bac 100644 --- a/Texassemble/texassemble.cpp +++ b/Texassemble/texassemble.cpp @@ -2028,10 +2028,10 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) for (size_t j = 0; j < w; ++j) { - XMVECTOR pixel1 = XMVectorSelect(inPixels[j], g_XMZero, zc); - pixel1 = XMVectorSelect(pixel1, g_XMOne, oc); - outPixels[j] = XMVectorPermute(pixel1, inPixels2[j], + XMVECTOR pixel = XMVectorPermute(inPixels[j], inPixels2[j], permuteElements[0], permuteElements[1], permuteElements[2], permuteElements[3]); + pixel = XMVectorSelect(pixel, g_XMZero, zc); + outPixels[j] = XMVectorSelect(pixel, g_XMOne, oc); } }, result); if (FAILED(hr)) diff --git a/Texconv/texconv.cpp b/Texconv/texconv.cpp index c6f4d4d..4698c45 100644 --- a/Texconv/texconv.cpp +++ b/Texconv/texconv.cpp @@ -2458,10 +2458,10 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) for (size_t j = 0; j < w; ++j) { - XMVECTOR pixel = XMVectorSelect(inPixels[j], g_XMZero, zc); - pixel = XMVectorSelect(pixel, g_XMOne, oc); - outPixels[j] = XMVectorSwizzle(pixel, + XMVECTOR pixel = XMVectorSwizzle(inPixels[j], swizzleElements[0], swizzleElements[1], swizzleElements[2], swizzleElements[3]); + pixel = XMVectorSelect(pixel, g_XMZero, zc); + outPixels[j] = XMVectorSelect(pixel, g_XMOne, oc); } }, *timage); if (FAILED(hr))