Mesa (master): nir/linking: fix issue with two compact variables in a row. (v2)

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Apr 20 21:59:04 UTC 2020


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Apr 20 11:23:45 2020 +1000

nir/linking: fix issue with two compact variables in a row. (v2)

If we have a clip dist float[1] compact followed by a tess factor
float[2] we don't want to overlap them, but the partial check
only happens for non-compact vars.

This fixes some issues seen with my sw vulkan layer with
dEQP-VK.clipping.user_defined.clip_distance*

v2: v1 failed with clip/cull mixtures, since in that
case the cull has a location_frac to follow after the clip
so only reset if we get a location_frac of 0 in a subsequent
clip var

Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4635>

---

 src/compiler/nir/nir_linking_helpers.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/compiler/nir/nir_linking_helpers.c b/src/compiler/nir/nir_linking_helpers.c
index d187096cf45..34a6f9a4d6b 100644
--- a/src/compiler/nir/nir_linking_helpers.c
+++ b/src/compiler/nir/nir_linking_helpers.c
@@ -1113,6 +1113,14 @@ nir_assign_io_var_locations(struct exec_list *var_list, unsigned *size,
 
       unsigned var_size;
       if (var->data.compact) {
+         /* If we are inside a partial compact,
+          * don't allow another compact to be in this slot
+          * if it starts at component 0.
+          */
+         if (last_partial && var->data.location_frac == 0) {
+            location++;
+         }
+
          /* compact variables must be arrays of scalars */
          assert(glsl_type_is_array(type));
          assert(glsl_type_is_scalar(glsl_get_array_element(type)));



More information about the mesa-commit mailing list