From 7decc7efbacf9382a150733679d638d56e878e26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Ondra=C4=8Dka?= Date: Mon, 2 Jan 2023 17:17:17 +0100 Subject: [PATCH] r300: allow copy propagate of RC_FILE_NONE reads to TEX instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Texturing instructions can't read from constant sources, however this can work when the constant was transformed to constant swizzles and hence RC_FILE_NONE. Prevents a regression in single Unigine Tropics shader that uses constant (0.5,0.5) as a TEX coordinate in a next patch. We now convert to constant swizzles twice, first when translating from TGSI and than in constant folding. If we disable the first conversion rc_transform_tex will emit a mov from constant to temporary. With this patch, copy propagate will clean it up later. Signed-off-by: Pavel Ondračka Reviewed-by: Filip Gawin Tested-by: Filip Gawin Part-of: --- src/gallium/drivers/r300/compiler/radeon_optimize.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/drivers/r300/compiler/radeon_optimize.c b/src/gallium/drivers/r300/compiler/radeon_optimize.c index 3e034a06f74..5cb7230539e 100644 --- a/src/gallium/drivers/r300/compiler/radeon_optimize.c +++ b/src/gallium/drivers/r300/compiler/radeon_optimize.c @@ -107,6 +107,7 @@ static void copy_propagate_scan_read(void * data, struct rc_instruction * inst, */ if(reader_data->Writer->U.I.SrcReg[0].File != RC_FILE_TEMPORARY && reader_data->Writer->U.I.SrcReg[0].File != RC_FILE_INPUT && + reader_data->Writer->U.I.SrcReg[0].File != RC_FILE_NONE && (inst->U.I.Opcode == RC_OPCODE_TEX || inst->U.I.Opcode == RC_OPCODE_TXB || inst->U.I.Opcode == RC_OPCODE_TXP ||