From fd633562681867a47e8bea5d5eefad0f12b0f891 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 25 Jul 2024 10:38:36 -0400 Subject: [PATCH] r300: switch to derivative intrinsics MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alyssa Rosenzweig Reviewed-by: Pavel Ondračka Part-of: --- src/gallium/drivers/r300/compiler/nir_to_rc.c | 13 +++++++++---- src/gallium/drivers/r300/r300_screen.c | 3 ++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/r300/compiler/nir_to_rc.c b/src/gallium/drivers/r300/compiler/nir_to_rc.c index 8917a95f097..1b8b39df6bf 100644 --- a/src/gallium/drivers/r300/compiler/nir_to_rc.c +++ b/src/gallium/drivers/r300/compiler/nir_to_rc.c @@ -1193,10 +1193,6 @@ ntr_emit_alu(struct ntr_compile *c, nir_alu_instr *instr) [nir_op_sne] = TGSI_OPCODE_SNE, [nir_op_ftrunc] = TGSI_OPCODE_TRUNC, - [nir_op_fddx] = TGSI_OPCODE_DDX, - [nir_op_fddy] = TGSI_OPCODE_DDY, - [nir_op_fddx_coarse] = TGSI_OPCODE_DDX, - [nir_op_fddy_coarse] = TGSI_OPCODE_DDY, [nir_op_fadd] = TGSI_OPCODE_ADD, [nir_op_fmul] = TGSI_OPCODE_MUL, @@ -1644,6 +1640,15 @@ ntr_emit_intrinsic(struct ntr_compile *c, nir_intrinsic_instr *instr) ntr_store(c, &instr->def, ntr_get_src(c, instr->src[0])); break; + case nir_intrinsic_ddx: + case nir_intrinsic_ddx_coarse: + ntr_DDX(c, ntr_get_dest(c, &instr->def), ntr_get_src(c, instr->src[0])); + return; + case nir_intrinsic_ddy: + case nir_intrinsic_ddy_coarse: + ntr_DDY(c, ntr_get_dest(c, &instr->def), ntr_get_src(c, instr->src[0])); + return; + case nir_intrinsic_decl_reg: case nir_intrinsic_load_reg: case nir_intrinsic_load_reg_indirect: diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 27b55cf27a1..bd2b19722c8 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -489,7 +489,8 @@ static int r300_get_video_param(struct pipe_screen *screen, .lower_uniforms_to_ubo = true, \ .lower_vector_cmp = true, \ .no_integers = true, \ - .use_interpolated_input_intrinsics = true + .use_interpolated_input_intrinsics = true, \ + .has_ddx_intrinsics = true static const nir_shader_compiler_options r500_vs_compiler_options = { COMMON_NIR_OPTIONS,