From d869f0f7ca51fb8767ea4dfd457b713b6c875a26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Ondra=C4=8Dka?= Date: Mon, 2 Jan 2023 21:02:05 +0100 Subject: [PATCH] r300: don't copy propagate constant swizzles to KIL on R300 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Transforming 0: MOV temp[1], -none.1111; 1: KIL temp[1]; to 0: KIL -none.1111; Doesn't work on R300 while it works just fine with R500. Prevents a regression when we enable the copy propagate of RC_FILE_NONE to texture instructions in the next commit. Signed-off-by: Pavel Ondračka Reviewed-by: Filip Gawin Tested-by: Filip Gawin Part-of: --- .../drivers/r300/compiler/radeon_optimize.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/gallium/drivers/r300/compiler/radeon_optimize.c b/src/gallium/drivers/r300/compiler/radeon_optimize.c index 33350b7fa41..3e034a06f74 100644 --- a/src/gallium/drivers/r300/compiler/radeon_optimize.c +++ b/src/gallium/drivers/r300/compiler/radeon_optimize.c @@ -88,6 +88,20 @@ static void copy_propagate_scan_read(void * data, struct rc_instruction * inst, return; } + /* R300/R400 is unhappy about propagating + * 0: MOV temp[1], -none.1111; + * 1: KIL temp[1]; + * to + * 0: KIL -none.1111; + * + * R500 is fine with it. + */ + if (!reader_data->C->is_r500 && inst->U.I.Opcode == RC_OPCODE_KIL && + reader_data->Writer->U.I.SrcReg[0].File == RC_FILE_NONE) { + reader_data->Abort = 1; + return; + } + /* These instructions cannot read from the constants file. * see radeonTransformTEX() */