Commit 31cc1f14 by Nicolas Capens Committed by Nicolas Capens

Fix typo in 'maxPos' constant vector

The last element of sw::Constants::maxPos was inadvertently 0x7F7FFFFE instead of 0x7F7FFFFF. Replace it with a scalar which is broadcast to all elements within Reactor code. Bug: b/175073806 Change-Id: Ia82cfe199bb2ea85367c6ff4f59b31e2acf5c6f2 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/50988Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com>
parent 5add6b5d
......@@ -337,10 +337,6 @@ Constants::Constants()
memcpy(&this->minZ, &minZ, sizeof(minZ));
memcpy(&this->fini, &fini, sizeof(fini));
static const dword4 maxPos = { 0x7F7FFFFF, 0x7F7FFFFF, 0x7F7FFFFF, 0x7F7FFFFE };
memcpy(&this->maxPos, &maxPos, sizeof(maxPos));
static const float4 unscaleByte = { 1.0f / 0xFF, 1.0f / 0xFF, 1.0f / 0xFF, 1.0f / 0xFF };
static const float4 unscaleSByte = { 1.0f / 0x7F, 1.0f / 0x7F, 1.0f / 0x7F, 1.0f / 0x7F };
static const float4 unscaleShort = { 1.0f / 0x7FFF, 1.0f / 0x7FFF, 1.0f / 0x7FFF, 1.0f / 0x7FFF };
......
......@@ -127,8 +127,6 @@ struct Constants
dword minZ[16];
dword fini[16];
dword4 maxPos;
float4 unscaleByte;
float4 unscaleSByte;
float4 unscaleShort;
......
......@@ -136,9 +136,10 @@ void VertexRoutine::computeClipFlags()
clipFlags |= Pointer<Int>(constants + OFFSET(Constants, minY))[SignMask(minY)];
clipFlags |= Pointer<Int>(constants + OFFSET(Constants, minZ))[SignMask(minZ)];
Int4 finiteX = CmpLE(Abs(posX), *Pointer<Float4>(constants + OFFSET(Constants, maxPos)));
Int4 finiteY = CmpLE(Abs(posY), *Pointer<Float4>(constants + OFFSET(Constants, maxPos)));
Int4 finiteZ = CmpLE(Abs(posZ), *Pointer<Float4>(constants + OFFSET(Constants, maxPos)));
Float4 maxPos = As<Float4>(Int4(0x7F7FFFFF));
Int4 finiteX = CmpLE(Abs(posX), maxPos);
Int4 finiteY = CmpLE(Abs(posY), maxPos);
Int4 finiteZ = CmpLE(Abs(posZ), maxPos);
Int4 finiteXYZ = finiteX & finiteY & finiteZ;
clipFlags |= Pointer<Int>(constants + OFFSET(Constants, fini))[SignMask(finiteXYZ)];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment