Fixed order of operations for -swizzle using 0, 1

This commit is contained in:
Chuck Walbourn 2021-06-16 00:02:58 -07:00
parent fb8393ec8e
commit b6aa25280b
2 changed files with 6 additions and 6 deletions

View File

@ -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) for (size_t j = 0; j < w; ++j)
{ {
XMVECTOR pixel1 = XMVectorSelect(inPixels[j], g_XMZero, zc); XMVECTOR pixel = XMVectorPermute(inPixels[j], inPixels2[j],
pixel1 = XMVectorSelect(pixel1, g_XMOne, oc);
outPixels[j] = XMVectorPermute(pixel1, inPixels2[j],
permuteElements[0], permuteElements[1], permuteElements[2], permuteElements[3]); permuteElements[0], permuteElements[1], permuteElements[2], permuteElements[3]);
pixel = XMVectorSelect(pixel, g_XMZero, zc);
outPixels[j] = XMVectorSelect(pixel, g_XMOne, oc);
} }
}, result); }, result);
if (FAILED(hr)) if (FAILED(hr))

View File

@ -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) for (size_t j = 0; j < w; ++j)
{ {
XMVECTOR pixel = XMVectorSelect(inPixels[j], g_XMZero, zc); XMVECTOR pixel = XMVectorSwizzle(inPixels[j],
pixel = XMVectorSelect(pixel, g_XMOne, oc);
outPixels[j] = XMVectorSwizzle(pixel,
swizzleElements[0], swizzleElements[1], swizzleElements[2], swizzleElements[3]); swizzleElements[0], swizzleElements[1], swizzleElements[2], swizzleElements[3]);
pixel = XMVectorSelect(pixel, g_XMZero, zc);
outPixels[j] = XMVectorSelect(pixel, g_XMOne, oc);
} }
}, *timage); }, *timage);
if (FAILED(hr)) if (FAILED(hr))