diff --git a/src/gallium/drivers/r300/compiler/r300_nir.h b/src/gallium/drivers/r300/compiler/r300_nir.h index 1bef2ab520b..e645484e8f8 100644 --- a/src/gallium/drivers/r300/compiler/r300_nir.h +++ b/src/gallium/drivers/r300/compiler/r300_nir.h @@ -129,26 +129,6 @@ needs_vs_trig_input_fixup(UNUSED struct hash_table *ht, const nir_alu_instr *ins return false; } -static inline bool -needs_fs_trig_input_fixup(UNUSED struct hash_table *ht, const nir_alu_instr *instr, unsigned src, - unsigned num_components, const uint8_t *swizzle) -{ - /* We are checking for ffract(a * (1 / 2 * pi)) pattern. */ - nir_instr *parent = instr->src[src].src.ssa->parent_instr; - if (parent->type != nir_instr_type_alu) - return true; - nir_alu_instr *fract = nir_instr_as_alu(parent); - if (fract->op != nir_op_ffract) - return true; - parent = fract->src[0].src.ssa->parent_instr; - - /* Now check for fmul(a, 1 / (2 * pi)). */ - if (!check_instr_and_src_value(nir_op_fmul, &parent, 0.1591549)) - return true; - - return false; -} - bool r300_is_only_used_as_float(const nir_alu_instr *instr); char *r300_finalize_nir(struct pipe_screen *pscreen, struct nir_shader *nir); diff --git a/src/gallium/drivers/r300/compiler/r300_nir_algebraic.py b/src/gallium/drivers/r300/compiler/r300_nir_algebraic.py index 65b5c52383d..67c1feff85c 100644 --- a/src/gallium/drivers/r300/compiler/r300_nir_algebraic.py +++ b/src/gallium/drivers/r300/compiler/r300_nir_algebraic.py @@ -27,8 +27,8 @@ transform_trig_input_vs_r500 = [ # y = frac(x / 2PI) # transform_trig_input_fs_r500 = [ - (('fsin', 'a(needs_fs_trig_input_fixup)'), ('fsin', ('ffract', ('fmul', 'a', 1 / (2 * pi))))), - (('fcos', 'a(needs_fs_trig_input_fixup)'), ('fcos', ('ffract', ('fmul', 'a', 1 / (2 * pi))))), + (('fsin', 'a'), ('fsin', ('ffract', ('fmul', 'a', 1 / (2 * pi))))), + (('fcos', 'a'), ('fcos', ('ffract', ('fmul', 'a', 1 / (2 * pi))))), ] # The is a pattern produced by wined3d for A0 register load.