Mesa (main): r300: improve precission of linear interpolation

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Oct 28 15:34:45 UTC 2021


Module: Mesa
Branch: main
Commit: 021ec93273819bb6922df01beef51feb5abfb333
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=021ec93273819bb6922df01beef51feb5abfb333

Author: Filip Gawin <filip.gawin at zoho.com>
Date:   Wed Oct 27 18:45:00 2021 +0200

r300: improve precission of linear interpolation

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13554>

---

 src/gallium/drivers/r300/compiler/radeon_program_alu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/r300/compiler/radeon_program_alu.c b/src/gallium/drivers/r300/compiler/radeon_program_alu.c
index 9d96307f117..5178da1f1c8 100644
--- a/src/gallium/drivers/r300/compiler/radeon_program_alu.c
+++ b/src/gallium/drivers/r300/compiler/radeon_program_alu.c
@@ -427,12 +427,12 @@ static void transform_LRP(struct radeon_compiler* c,
 {
 	struct rc_dst_register dst = try_to_reuse_dst(c, inst);
 
-	emit2(c, inst->Prev, RC_OPCODE_ADD, 0,
+	emit3(c, inst->Prev, RC_OPCODE_MAD, 0,
 		dst,
-		inst->U.I.SrcReg[1], negate(inst->U.I.SrcReg[2]));
+		negate(inst->U.I.SrcReg[0]), inst->U.I.SrcReg[2], inst->U.I.SrcReg[2]);
 	emit3(c, inst->Prev, RC_OPCODE_MAD, &inst->U.I,
 		inst->U.I.DstReg,
-		inst->U.I.SrcReg[0], srcreg(RC_FILE_TEMPORARY, dst.Index), inst->U.I.SrcReg[2]);
+		inst->U.I.SrcReg[0], inst->U.I.SrcReg[1], srcreg(RC_FILE_TEMPORARY, dst.Index));
 
 	rc_remove_instruction(inst);
 }



More information about the mesa-commit mailing list