diff --git a/src/gallium/drivers/r300/compiler/nir_to_rc.c b/src/gallium/drivers/r300/compiler/nir_to_rc.c index 08fa792cf81..e631e78fd4b 100644 --- a/src/gallium/drivers/r300/compiler/nir_to_rc.c +++ b/src/gallium/drivers/r300/compiler/nir_to_rc.c @@ -1866,26 +1866,6 @@ nir_to_rc(struct nir_shader *s, struct pipe_screen *screen, ntr_fixup_varying_slots(s, s->info.stage == MESA_SHADER_FRAGMENT ? nir_var_shader_in : nir_var_shader_out); - if (s->info.stage == MESA_SHADER_FRAGMENT) { - if (is_r500) { - NIR_PASS(_, s, r300_transform_fs_trig_input); - } - } else if (r300_screen(screen)->caps.has_tcl) { - if (is_r500) { - /* Only nine should set both NTT shader name and - * use_legacy_math_rules and D3D9 already mandates - * the proper range for the trigonometric inputs. - */ - if (!s->info.use_legacy_math_rules || !(s->info.name && !strcmp("TTN", s->info.name))) { - NIR_PASS(_, s, r300_transform_vs_trig_input); - } - } else { - if (r300_screen(screen)->caps.is_r400) { - NIR_PASS(_, s, r300_transform_vs_trig_input); - } - } - } - /* Lower array indexing on FS inputs. Since we don't set * ureg->supports_any_inout_decl_range, the TGSI input decls will be split to * elements by ureg, and so dynamically indexing them would be invalid. diff --git a/src/gallium/drivers/r300/compiler/r300_nir.c b/src/gallium/drivers/r300/compiler/r300_nir.c index b228cbe5241..384f177be74 100644 --- a/src/gallium/drivers/r300/compiler/r300_nir.c +++ b/src/gallium/drivers/r300/compiler/r300_nir.c @@ -265,6 +265,17 @@ r300_optimize_nir(struct nir_shader *s, struct r300_screen *screen) NIR_PASS(_, s, nir_lower_var_copies); NIR_PASS(_, s, nir_remove_dead_variables, nir_var_function_temp, NULL); + + /* FIXME: this could be probably moved earlier... */ + if (s->info.stage == MESA_SHADER_FRAGMENT) { + if (is_r500) { + NIR_PASS(_, s, r300_transform_fs_trig_input); + } + } else if (screen->caps.has_tcl) { + if (is_r500 || screen->caps.is_r400) { + NIR_PASS(_, s, r300_transform_vs_trig_input); + } + } } char *