From d8f59b14d03cff23467dff834780a2613e5dab5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Ondra=C4=8Dka?= Date: Mon, 16 Jan 2023 10:48:42 +0100 Subject: [PATCH] r300: skip sin/cos input range transformation for nine and ntt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pavel Ondračka Reviewed-by: Filip Gawin Part-of: --- src/gallium/drivers/r300/r300_state.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 470f2daa170..85d3845a69d 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -1959,9 +1959,18 @@ static void* r300_create_vs_state(struct pipe_context* pipe, if (r300->screen->caps.has_tcl) { if (r300->screen->caps.is_r500) { ntt_options = &hwtcl_r500_options; - NIR_PASS_V(shader->ir.nir, r300_transform_vs_trig_input); + + /* Only nine should set both NTT shader name and + * use_legacy_math_rules and D3D9 already mandates + * the proper range for the trigonometric inputs. + */ + struct shader_info *info = &(((struct nir_shader *)(shader->ir.nir))->info); + if (!info->use_legacy_math_rules || + !(info->name && !strcmp("TTN", info->name))) { + NIR_PASS_V(shader->ir.nir, r300_transform_vs_trig_input); + } } - else + else ntt_options = &hwtcl_r300_options; } else { ntt_options = &swtcl_options;