From 2b7b0868dee049eea8733b436fad76720ec52930 Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Tue, 10 Jan 2023 22:51:30 +0100 Subject: [PATCH] r300: don't cache abs in fragment shader MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently this ends up with unneeded move. fixes: 63f353b45605379b8b81754543907a6b0fc3afdd Reviewed-by: Pavel Ondračka Part-of: --- 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 8e89214e186..c28cebce3a4 100644 --- a/src/gallium/drivers/r300/compiler/radeon_program_alu.c +++ b/src/gallium/drivers/r300/compiler/radeon_program_alu.c @@ -272,11 +272,11 @@ static void transform_TRUNC(struct radeon_compiler* c, struct rc_src_register abs; - if (c->is_r500) { + if (c->is_r500 || c->type == RC_FRAGMENT_PROGRAM) { abs = absolute(inst->U.I.SrcReg[0]); } else { - /* abs isn't free on r300/r400, so we want - * to avoid doing it twice + /* abs isn't free on r300's and r400's vertex shader, + * so we want to avoid doing it twice */ int tmp = rc_find_free_temporary(c);