Mesa (main): gallium: Rename PIPE_CAP_TGSI_LEGACY_MATH_RULES to drop "TGSI"
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Jun 10 03:54:57 UTC 2022
Module: Mesa
Branch: main
Commit: c761f9bde5fe5b789b913d7ce8678c743454bf67
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c761f9bde5fe5b789b913d7ce8678c743454bf67
Author: Emma Anholt <emma at anholt.net>
Date: Tue Apr 26 13:48:41 2022 -0700
gallium: Rename PIPE_CAP_TGSI_LEGACY_MATH_RULES to drop "TGSI"
Now NIR drivers can implement it as well.
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>
---
docs/gallium/screen.rst | 5 +++--
src/gallium/auxiliary/nir/nir_to_tgsi.c | 2 +-
src/gallium/auxiliary/util/u_screen.c | 2 +-
src/gallium/drivers/nouveau/nv30/nv30_screen.c | 2 +-
src/gallium/drivers/nouveau/nv50/nv50_screen.c | 2 +-
src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 2 +-
src/gallium/drivers/r600/r600_pipe.c | 2 +-
src/gallium/frontends/nine/nine_shader.c | 2 +-
src/gallium/include/pipe/p_defines.h | 2 +-
9 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/docs/gallium/screen.rst b/docs/gallium/screen.rst
index 0baac22234b..e358de4c4ce 100644
--- a/docs/gallium/screen.rst
+++ b/docs/gallium/screen.rst
@@ -424,8 +424,9 @@ The integer capabilities:
and a larger value would mean that multiple render targets are supported.
* ``PIPE_CAP_FBFETCH_COHERENT``: Whether framebuffer fetches from the fragment
shader can be guaranteed to be coherent with framebuffer writes.
-* ``PIPE_CAP_TGSI_LEGACY_MATH_RULES``: Whether TGSI shaders support the
- ``TGSI_PROPERTY_LEGACY_MATH_RULES`` shader property.
+* ``PIPE_CAP_LEGACY_MATH_RULES``: Whether NIR shaders support the
+ ``shader_info.use_legacy_math_rules`` flag (see documentation there), and
+ TGSI shaders support the corresponding ``TGSI_PROPERTY_LEGACY_MATH_RULES``.
* ``PIPE_CAP_DOUBLES``: Whether double precision floating-point operations
are supported.
* ``PIPE_CAP_INT64``: Whether 64-bit integer operations are supported.
diff --git a/src/gallium/auxiliary/nir/nir_to_tgsi.c b/src/gallium/auxiliary/nir/nir_to_tgsi.c
index 7c7650bb978..390a532b546 100644
--- a/src/gallium/auxiliary/nir/nir_to_tgsi.c
+++ b/src/gallium/auxiliary/nir/nir_to_tgsi.c
@@ -3852,7 +3852,7 @@ 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))
+ if (s->info.use_legacy_math_rules && screen->get_param(screen, PIPE_CAP_LEGACY_MATH_RULES))
ureg_property(c->ureg, TGSI_PROPERTY_LEGACY_MATH_RULES, 1);
if (s->info.stage == MESA_SHADER_FRAGMENT) {
diff --git a/src/gallium/auxiliary/util/u_screen.c b/src/gallium/auxiliary/util/u_screen.c
index d8ee15f6447..0379bca0347 100644
--- a/src/gallium/auxiliary/util/u_screen.c
+++ b/src/gallium/auxiliary/util/u_screen.c
@@ -307,7 +307,7 @@ u_pipe_screen_get_param_defaults(struct pipe_screen *pscreen,
case PIPE_CAP_FBFETCH:
case PIPE_CAP_FBFETCH_COHERENT:
case PIPE_CAP_BLEND_EQUATION_ADVANCED:
- case PIPE_CAP_TGSI_LEGACY_MATH_RULES:
+ case PIPE_CAP_LEGACY_MATH_RULES:
case PIPE_CAP_DOUBLES:
case PIPE_CAP_INT64:
case PIPE_CAP_INT64_DIVMOD:
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_screen.c b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
index b2381546457..59fe05c9b16 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_screen.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
@@ -218,7 +218,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_SHADER_CAN_READ_OUTPUTS:
case PIPE_CAP_NATIVE_FENCE_FD:
case PIPE_CAP_FBFETCH:
- case PIPE_CAP_TGSI_LEGACY_MATH_RULES:
+ case PIPE_CAP_LEGACY_MATH_RULES:
case PIPE_CAP_DOUBLES:
case PIPE_CAP_INT64:
case PIPE_CAP_INT64_DIVMOD:
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
index 50ffff560c8..647aa5b63b5 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
@@ -248,7 +248,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_STRING_MARKER:
case PIPE_CAP_CULL_DISTANCE:
case PIPE_CAP_SHADER_ARRAY_COMPONENTS:
- case PIPE_CAP_TGSI_LEGACY_MATH_RULES:
+ case PIPE_CAP_LEGACY_MATH_RULES:
case PIPE_CAP_TGSI_TEX_TXF_LZ:
case PIPE_CAP_SHADER_CLOCK:
case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
index a57a2e72c33..e3a1e551afb 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
@@ -288,7 +288,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_SHADER_GROUP_VOTE:
case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
case PIPE_CAP_SHADER_ARRAY_COMPONENTS:
- case PIPE_CAP_TGSI_LEGACY_MATH_RULES:
+ case PIPE_CAP_LEGACY_MATH_RULES:
case PIPE_CAP_DOUBLES:
case PIPE_CAP_INT64:
case PIPE_CAP_TGSI_TEX_TXF_LZ:
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index d50efef7cfc..b178c708980 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -312,7 +312,7 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
case PIPE_CAP_CLEAR_TEXTURE:
- case PIPE_CAP_TGSI_LEGACY_MATH_RULES:
+ case PIPE_CAP_LEGACY_MATH_RULES:
case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
case PIPE_CAP_ALLOW_MAPPED_BUFFERS_DURING_EXECUTION:
case PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR:
diff --git a/src/gallium/frontends/nine/nine_shader.c b/src/gallium/frontends/nine/nine_shader.c
index 833953d974c..31ae6fd213c 100644
--- a/src/gallium/frontends/nine/nine_shader.c
+++ b/src/gallium/frontends/nine/nine_shader.c
@@ -3666,7 +3666,7 @@ tx_ctor(struct shader_translator *tx, struct pipe_screen *screen, struct nine_sh
ureg_property(tx->ureg, TGSI_PROPERTY_FS_COORD_PIXEL_CENTER, TGSI_FS_COORD_PIXEL_CENTER_INTEGER);
}
- tx->mul_zero_wins = GET_CAP(TGSI_LEGACY_MATH_RULES);
+ tx->mul_zero_wins = GET_CAP(LEGACY_MATH_RULES);
if (tx->mul_zero_wins)
ureg_property(tx->ureg, TGSI_PROPERTY_LEGACY_MATH_RULES, 1);
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index 7f8cedea2a7..f3a3b9fd636 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -891,7 +891,7 @@ enum pipe_cap
PIPE_CAP_NATIVE_FENCE_FD,
PIPE_CAP_GLSL_TESS_LEVELS_AS_INPUTS,
PIPE_CAP_FBFETCH,
- PIPE_CAP_TGSI_LEGACY_MATH_RULES,
+ PIPE_CAP_LEGACY_MATH_RULES,
PIPE_CAP_DOUBLES,
PIPE_CAP_INT64,
PIPE_CAP_INT64_DIVMOD,
More information about the mesa-commit
mailing list