From 837d8f44d1a8c95ac87b5042c4d2ac5c793235ae Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Wed, 30 Nov 2016 09:08:49 +0100 Subject: [PATCH] The precision of the SSE2 rcp opcode was a little bit too low --- tools/drawergen/fixedfunction/drawtrianglecodegen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/drawergen/fixedfunction/drawtrianglecodegen.cpp b/tools/drawergen/fixedfunction/drawtrianglecodegen.cpp index b53a5f7913..2671ac0cf7 100644 --- a/tools/drawergen/fixedfunction/drawtrianglecodegen.cpp +++ b/tools/drawergen/fixedfunction/drawtrianglecodegen.cpp @@ -204,7 +204,7 @@ void DrawTriangleCodegen::LoopBlockX() stack_x.store(minx); stack_posx_w.store(posy_w); for (int i = 0; i < TriVertex::NumVarying; i++) - stack_posx_varying[i].store(stack_posy_varying[i].load()); + stack_posx_varying[i].store(posy_varying[i]); SSAForBlock loop; x = stack_x.load(); @@ -277,7 +277,7 @@ void DrawTriangleCodegen::LoopBlockX() void DrawTriangleCodegen::SetupAffineBlock() { // Calculate varying variables for affine block - SSAVec4f rcpW = SSAVec4f::rcp(SSAVec4f(posx_w, posx_w + gradWX, posx_w + gradWY, posx_w + gradWX + gradWY)); + SSAVec4f rcpW = SSAVec4f(1.0f) / SSAVec4f(posx_w, posx_w + gradWX, posx_w + gradWY, posx_w + gradWX + gradWY); for (int i = 0; i < TriVertex::NumVarying; i++) { // Top left, top right, bottom left, bottom right: