Mesa (main): nir: fix setting varying from uniform as flat
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Apr 18 12:15:55 UTC 2022
Module: Mesa
Branch: main
Commit: 4b4bb46af41c5e6c773ad3f9c0d34c7272e0149f
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4b4bb46af41c5e6c773ad3f9c0d34c7272e0149f
Author: Timothy Arceri <tarceri at itsqueeze.com>
Date: Mon Apr 18 13:53:21 2022 +1000
nir: fix setting varying from uniform as flat
Here we just make sure we match the interpolation type on both
sides of the shader interface. Drivers like d3d12 are expecting
this.
Fixes: 9401990e6f7a ("nir/linker: set varying from uniform as flat")
Reviewed-by: Qiang Yu <yuq825 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16003>
---
src/compiler/nir/nir_linking_helpers.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/compiler/nir/nir_linking_helpers.c b/src/compiler/nir/nir_linking_helpers.c
index 6a574ec29be..187098cafe9 100644
--- a/src/compiler/nir/nir_linking_helpers.c
+++ b/src/compiler/nir/nir_linking_helpers.c
@@ -1391,8 +1391,10 @@ nir_link_opt_varyings(nir_shader *producer, nir_shader *consumer)
/* The varying is loaded from same uniform, so no need to do any
* interpolation. Mark it as flat explicitly.
*/
- if (in_var && in_var->data.interpolation <= INTERP_MODE_NOPERSPECTIVE)
+ if (in_var && in_var->data.interpolation <= INTERP_MODE_NOPERSPECTIVE) {
in_var->data.interpolation = INTERP_MODE_FLAT;
+ out_var->data.interpolation = INTERP_MODE_FLAT;
+ }
}
}
More information about the mesa-commit
mailing list