summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r300
diff options
context:
space:
mode:
authorEmma Anholt <emma@anholt.net>2023-05-18 13:20:12 -0700
committerMarge Bot <emma+marge@anholt.net>2023-06-12 17:37:54 +0000
commitae777b1836715d8a775208f49048440ce17e76d4 (patch)
tree0ef684f3682b70c6d71812821324515fa1ea5a4e /src/gallium/drivers/r300
parent715dcf405306fea8c97148ad26d82cdf25f356e8 (diff)
r300: Drop RADEON_DEBUG=use_tgsi.
The NIR path is default, and well-trodden at this point. By dropping support for input as TGSI, we get rely on the NIR trig lowering. Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Acked-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Pavel Ondračka <pavel.ondracka@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23114>
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r--src/gallium/drivers/r300/compiler/r3xx_fragprog.c1
-rw-r--r--src/gallium/drivers/r300/compiler/radeon_compiler.h1
-rw-r--r--src/gallium/drivers/r300/compiler/radeon_program_alu.c37
-rw-r--r--src/gallium/drivers/r300/compiler/radeon_program_alu.h5
-rw-r--r--src/gallium/drivers/r300/r300_debug.c1
-rw-r--r--src/gallium/drivers/r300/r300_fs.c1
-rw-r--r--src/gallium/drivers/r300/r300_screen.c2
-rw-r--r--src/gallium/drivers/r300/r300_screen.h1
8 files changed, 1 insertions, 48 deletions
diff --git a/src/gallium/drivers/r300/compiler/r3xx_fragprog.c b/src/gallium/drivers/r300/compiler/r3xx_fragprog.c
index 9f058e78189..d9046be81ca 100644
--- a/src/gallium/drivers/r300/compiler/r3xx_fragprog.c
+++ b/src/gallium/drivers/r300/compiler/r3xx_fragprog.c
@@ -85,7 +85,6 @@ void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c)
struct radeon_program_transformation native_rewrite_r500[] = {
{ &radeonTransformALU, NULL },
{ &radeonTransformDeriv, NULL },
- { &radeonTransformTrigScale, NULL },
{ NULL, NULL }
};
diff --git a/src/gallium/drivers/r300/compiler/radeon_compiler.h b/src/gallium/drivers/r300/compiler/radeon_compiler.h
index 100f43423f1..cbedabb4fff 100644
--- a/src/gallium/drivers/r300/compiler/radeon_compiler.h
+++ b/src/gallium/drivers/r300/compiler/radeon_compiler.h
@@ -56,7 +56,6 @@ struct radeon_compiler {
unsigned has_presub:1;
unsigned has_omod:1;
unsigned disable_optimizations:1;
- unsigned needs_trig_input_transform:1;
unsigned max_temp_regs;
unsigned max_constants;
int max_alu_insts;
diff --git a/src/gallium/drivers/r300/compiler/radeon_program_alu.c b/src/gallium/drivers/r300/compiler/radeon_program_alu.c
index 637a07b1d39..2f933d9d856 100644
--- a/src/gallium/drivers/r300/compiler/radeon_program_alu.c
+++ b/src/gallium/drivers/r300/compiler/radeon_program_alu.c
@@ -1036,43 +1036,6 @@ static void r300_transform_SIN_COS(struct radeon_compiler *c,
rc_remove_instruction(inst);
}
-
-/**
- * Transform the trigonometric functions COS and SIN
- * to include pre-scaling by 1/(2*PI) and taking the fractional
- * part, so that the input to COS and SIN is always in the range [0,1).
- *
- * @warning This transformation implicitly changes the semantics of SIN and COS!
- */
-int radeonTransformTrigScale(struct radeon_compiler* c,
- struct rc_instruction* inst,
- void* unused)
-{
- static const float RCP_2PI = 0.15915494309189535;
- unsigned int temp;
- unsigned int constant;
- unsigned int constant_swizzle;
-
- if (inst->U.I.Opcode != RC_OPCODE_COS &&
- inst->U.I.Opcode != RC_OPCODE_SIN)
- return 0;
-
- if (!c->needs_trig_input_transform)
- return 1;
-
- temp = rc_find_free_temporary(c);
- constant = rc_constants_add_immediate_scalar(&c->Program.Constants, RCP_2PI, &constant_swizzle);
-
- emit2(c, inst->Prev, RC_OPCODE_MUL, NULL, dstregtmpmask(temp, RC_MASK_W),
- swizzle_xxxx(inst->U.I.SrcReg[0]),
- srcregswz(RC_FILE_CONSTANT, constant, constant_swizzle));
- emit1(c, inst->Prev, RC_OPCODE_FRC, NULL, dstregtmpmask(temp, RC_MASK_W),
- srcreg(RC_FILE_TEMPORARY, temp));
-
- r300_transform_SIN_COS(c, inst, temp);
- return 1;
-}
-
/**
* Replaces DDX/DDY instructions with MOV 0 to avoid using dummy shaders on r300/r400.
*
diff --git a/src/gallium/drivers/r300/compiler/radeon_program_alu.h b/src/gallium/drivers/r300/compiler/radeon_program_alu.h
index eb522b2ead8..05e801489f7 100644
--- a/src/gallium/drivers/r300/compiler/radeon_program_alu.h
+++ b/src/gallium/drivers/r300/compiler/radeon_program_alu.h
@@ -45,11 +45,6 @@ int r300_transform_trig_simple(
struct rc_instruction * inst,
void*);
-int radeonTransformTrigScale(
- struct radeon_compiler * c,
- struct rc_instruction * inst,
- void*);
-
int r300_transform_trig_scale_vertex(
struct radeon_compiler *c,
struct rc_instruction *inst,
diff --git a/src/gallium/drivers/r300/r300_debug.c b/src/gallium/drivers/r300/r300_debug.c
index dc5568dcbcb..1061bdb8539 100644
--- a/src/gallium/drivers/r300/r300_debug.c
+++ b/src/gallium/drivers/r300/r300_debug.c
@@ -50,7 +50,6 @@ static const struct debug_named_value r300_debug_options[] = {
{ "nozmask", DBG_NO_ZMASK, "Disable zbuffer compression" },
{ "nohiz", DBG_NO_HIZ, "Disable hierarchical zbuffer" },
{ "nocmask", DBG_NO_CMASK, "Disable AA compression and fast AA clear" },
- { "use_tgsi", DBG_USE_TGSI, "Request TGSI shaders from the state tracker" },
{ "notcl", DBG_NO_TCL, "Disable hardware accelerated Transform/Clip/Lighting" },
/* must be last */
diff --git a/src/gallium/drivers/r300/r300_fs.c b/src/gallium/drivers/r300/r300_fs.c
index 201949c838b..75b164afabe 100644
--- a/src/gallium/drivers/r300/r300_fs.c
+++ b/src/gallium/drivers/r300/r300_fs.c
@@ -456,7 +456,6 @@ static void r300_translate_fragment_shader(
compiler.Base.has_half_swizzles = TRUE;
compiler.Base.has_presub = TRUE;
compiler.Base.has_omod = TRUE;
- compiler.Base.needs_trig_input_transform = DBG_ON(r300, DBG_USE_TGSI);
compiler.Base.max_temp_regs =
compiler.Base.is_r500 ? 128 : (compiler.Base.is_r400 ? 64 : 32);
compiler.Base.max_constants = compiler.Base.is_r500 ? 256 : 32;
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index cbe6f0446e4..b6ef2f1ace3 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -256,7 +256,7 @@ static int r300_get_shader_param(struct pipe_screen *pscreen,
switch (param) {
case PIPE_SHADER_CAP_PREFERRED_IR:
- return (r300screen->debug & DBG_USE_TGSI) ? PIPE_SHADER_IR_TGSI : PIPE_SHADER_IR_NIR;
+ return PIPE_SHADER_IR_NIR;
case PIPE_SHADER_CAP_SUPPORTED_IRS:
return (1 << PIPE_SHADER_IR_NIR) | (1 << PIPE_SHADER_IR_TGSI);
default:
diff --git a/src/gallium/drivers/r300/r300_screen.h b/src/gallium/drivers/r300/r300_screen.h
index bcaea3cfb6e..c25e49efc72 100644
--- a/src/gallium/drivers/r300/r300_screen.h
+++ b/src/gallium/drivers/r300/r300_screen.h
@@ -103,7 +103,6 @@ radeon_winsys(struct pipe_screen *screen) {
#define DBG_NO_ZMASK (1 << 21)
#define DBG_NO_HIZ (1 << 22)
#define DBG_NO_CMASK (1 << 23)
-#define DBG_USE_TGSI (1 << 24)
#define DBG_NO_TCL (1 << 25)
/*@}*/
static inline boolean SCREEN_DBG_ON(struct r300_screen * screen, unsigned flags)