Fixed bug in CalculateAlphaCoverage

This commit is contained in:
Chuck Walbourn 2022-03-10 21:23:49 -08:00
parent 1c20d528d4
commit 9b01346eeb

View File

@ -260,10 +260,17 @@ namespace
for (size_t x = 0; x < srcImage.width - 1; ++x) 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) // [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)); XMVECTOR r0 = XMVectorSplatW(*pRow0);
const XMVECTOR v2 = XMVectorSaturate(XMVectorMultiply(XMVectorSplatW(*pRow1), scale)); XMVECTOR r1 = XMVectorSplatW(*pRow1);
XMVECTOR v3 = XMVectorSaturate(XMVectorMultiply(XMVectorSplatW(*(pRow0++)), scale));
const XMVECTOR v4 = XMVectorSaturate(XMVectorMultiply(XMVectorSplatW(*(pRow1++)), scale)); 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 --- ---] v1 = XMVectorMergeXY(v1, v2); // [v1.x v2.x --- ---]
v3 = XMVectorMergeXY(v3, v4); // [v3.x v4.x --- ---] v3 = XMVectorMergeXY(v3, v4); // [v3.x v4.x --- ---]