Mesa (main): nouveau/nv30: Make sure fsat is lowered in the VS.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 7 03:04:35 UTC 2022


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

Author: Emma Anholt <emma at anholt.net>
Date:   Tue May 31 13:18:09 2022 -0700

nouveau/nv30: Make sure fsat is lowered in the VS.

GLSL lowers fsat to clamps based on PIPE_CAP_VERTEX_SHADER_SATURATE
(EmitNoSat), but nir is happy to optimize that back to fsat unless you
tell it not to.

Noticed by inspection while looking at deleting EmitNoSat.

Fixes: ca1ec7272685 ("nv30/40: Switch to using NIR-to-TGSI by default.")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16823>

---

 src/gallium/drivers/nouveau/nv30/nv30_screen.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gallium/drivers/nouveau/nv30/nv30_screen.c b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
index 792e1da3083..a4739e00b1c 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_screen.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
@@ -482,6 +482,7 @@ static const nir_shader_compiler_options nv30_base_compiler_options = {
    .lower_extract_byte = true,
    .lower_extract_word = true,
    .lower_fdiv = true,
+   .lower_fsat = true,
    .lower_insert_byte = true,
    .lower_insert_word = true,
    .lower_fdph = true,
@@ -668,6 +669,7 @@ nv30_screen_create(struct nouveau_device *dev)
    }
 
    screen->fs_compiler_options = nv30_base_compiler_options;
+   screen->fs_compiler_options.lower_fsat = false;
    if (oclass >= NV40_3D_CLASS)
       screen->fs_compiler_options.lower_fpow = false;
 



More information about the mesa-commit mailing list