Mesa (main): nir_to_tgsi: Set LEGACY_MATH_RULES cap for use_legacy_math_rules shaders.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 10 03:54:57 UTC 2022


Module: Mesa
Branch: main
Commit: c93e5a7c94ba0ef9e5c1ebfd005ac1c24bce0f8e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c93e5a7c94ba0ef9e5c1ebfd005ac1c24bce0f8e

Author: Emma Anholt <emma at anholt.net>
Date:   Tue Apr 26 12:01:01 2022 -0700

nir_to_tgsi: Set LEGACY_MATH_RULES cap for use_legacy_math_rules shaders.

This should help get correct math for ARB_fp/vp after the NTT transition,
and will be used for wine nine shortly.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16176>

---

 src/gallium/auxiliary/nir/nir_to_tgsi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gallium/auxiliary/nir/nir_to_tgsi.c b/src/gallium/auxiliary/nir/nir_to_tgsi.c
index 371b43c8a8e..7c7650bb978 100644
--- a/src/gallium/auxiliary/nir/nir_to_tgsi.c
+++ b/src/gallium/auxiliary/nir/nir_to_tgsi.c
@@ -3852,6 +3852,8 @@ const void *nir_to_tgsi_options(struct nir_shader *s,
    c->native_integers = native_integers;
    c->ureg = ureg_create(pipe_shader_type_from_mesa(s->info.stage));
    ureg_setup_shader_info(c->ureg, &s->info);
+   if (s->info.use_legacy_math_rules && screen->get_param(screen, PIPE_CAP_TGSI_LEGACY_MATH_RULES))
+      ureg_property(c->ureg, TGSI_PROPERTY_LEGACY_MATH_RULES, 1);
 
    if (s->info.stage == MESA_SHADER_FRAGMENT) {
       /* The draw module's polygon stipple layer doesn't respect the chosen



More information about the mesa-commit mailing list