Mesa (main): microsoft/spirv_to_dxil: turn sysvals into input varyings

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Oct 26 16:28:41 UTC 2021


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

Author: Michael Tang <tangm at microsoft.com>
Date:   Fri Oct  8 14:19:04 2021 -0700

microsoft/spirv_to_dxil: turn sysvals into input varyings

Fixes: b47090c5b33 ("spirv: Always declare FragCoord as a sysval")
Reviewed-by: Jesse Natalie <jenatali at microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13276>

---

 src/microsoft/spirv_to_dxil/spirv_to_dxil.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/microsoft/spirv_to_dxil/spirv_to_dxil.c b/src/microsoft/spirv_to_dxil/spirv_to_dxil.c
index 36bb65ff26a..b3649d01176 100644
--- a/src/microsoft/spirv_to_dxil/spirv_to_dxil.c
+++ b/src/microsoft/spirv_to_dxil/spirv_to_dxil.c
@@ -194,6 +194,12 @@ spirv_to_dxil(const uint32_t *words, size_t word_count,
    nir_validate_shader(nir,
                        "Validate before feeding NIR to the DXIL compiler");
 
+   const struct nir_lower_sysvals_to_varyings_options sysvals_to_varyings = {
+      .frag_coord = true,
+      .point_coord = true,
+   };
+   NIR_PASS_V(nir, nir_lower_sysvals_to_varyings, &sysvals_to_varyings);
+
    NIR_PASS_V(nir, nir_lower_system_values);
 
    if (conf->zero_based_vertex_instance_id) {



More information about the mesa-commit mailing list