svga: Add all tgsi double instructions for shader codegen checks

During translation of tgsi shaders to vgpu10 shader code that is sent to
svga device, we may get as input a double instruction with incorrect
swizzles such as xzxz. In this case we have a workaround to move the value
in that register to a temporary register with an xyzw swizzle.

However the functions that check if the instruction has double source or
destination did not check for all instructions, such as DDIV, so if
incorrect swizzles are sent in the shader tgsi code then the same
incorrect swizzle is also emitted in the vgpu10 shader code.

Fix this by adding all the double instructions in double checking
functions.

Signed-off-by: Maaz Mombasawala <maaz.mombasawala@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33749>
This commit is contained in:
Maaz Mombasawala
2024-11-11 19:02:28 -08:00
committed by Marge Bot
parent 73f4980dba
commit 882ad3fa3e
+12 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998-2024 Broadcom. All Rights Reserved.
* Copyright (c) 1998-2025 Broadcom. All Rights Reserved.
* The term Broadcom refers to Broadcom Inc.
* and/or its subsidiaries.
* SPDX-License-Identifier: MIT
@@ -9292,7 +9292,16 @@ opcode_has_dbl_dst(unsigned opcode)
case TGSI_OPCODE_I2D:
case TGSI_OPCODE_U2D:
case TGSI_OPCODE_DFMA:
// XXX more TBD
case TGSI_OPCODE_DTRUNC:
case TGSI_OPCODE_DCEIL:
case TGSI_OPCODE_DROUND:
case TGSI_OPCODE_DSSG:
case TGSI_OPCODE_DLDEXP:
case TGSI_OPCODE_DMAD:
case TGSI_OPCODE_DDIV:
case TGSI_OPCODE_DRCP:
case TGSI_OPCODE_DSQRT:
case TGSI_OPCODE_DRSQ:
return true;
default:
return false;
@@ -9332,6 +9341,7 @@ opcode_has_dbl_src(unsigned opcode)
case TGSI_OPCODE_DFLR:
case TGSI_OPCODE_DROUND:
case TGSI_OPCODE_DSSG:
case TGSI_OPCODE_DDIV:
return true;
default:
return false;