Mesa (master): nir/spirv: don't use bare types, remove assert in split vars for testing

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Mar 21 00:43:16 UTC 2019


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Wed Mar 20 08:19:45 2019 +1000

nir/spirv: don't use bare types, remove assert in split vars for testing

For OpenCL we never want to strip the info from the types, and it makes
type comparisons easier in later stages. We might later need a nir pass to
strip this for GLSL, but so far the only regression is the assert and Jason
said removing that is fine.

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Signed-off-by: Dave Airlie <airlied at redhat.com>

---

 src/compiler/nir/nir_split_vars.c  | 1 -
 src/compiler/spirv/vtn_variables.c | 6 +++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/compiler/nir/nir_split_vars.c b/src/compiler/nir/nir_split_vars.c
index 394021e608e..777c4ac7225 100644
--- a/src/compiler/nir/nir_split_vars.c
+++ b/src/compiler/nir/nir_split_vars.c
@@ -341,7 +341,6 @@ init_var_list_array_infos(struct exec_list *vars,
 
       const struct glsl_type *type = var->type;
       for (int i = 0; i < num_levels; i++) {
-         assert(glsl_get_explicit_stride(type) == 0);
          info->levels[i].array_len = glsl_get_length(type);
          type = glsl_get_array_element(type);
 
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
index da4c57f7c77..782ad08d321 100644
--- a/src/compiler/spirv/vtn_variables.c
+++ b/src/compiler/spirv/vtn_variables.c
@@ -2054,7 +2054,7 @@ vtn_create_variable(struct vtn_builder *b, struct vtn_value *val,
          /* Private variables don't have any explicit layout but some layouts
           * may have leaked through due to type deduplication in the SPIR-V.
           */
-         var->var->type = glsl_get_bare_type(var->type->type);
+         var->var->type = var->type->type;
       }
       var->var->data.mode = nir_mode;
       var->var->data.location = -1;
@@ -2072,7 +2072,7 @@ vtn_create_variable(struct vtn_builder *b, struct vtn_value *val,
           * layouts may have leaked through due to type deduplication in the
           * SPIR-V.
           */
-         var->var->type = glsl_get_bare_type(var->type->type);
+         var->var->type = var->type->type;
          var->var->data.mode = nir_var_mem_shared;
       }
       break;
@@ -2130,7 +2130,7 @@ vtn_create_variable(struct vtn_builder *b, struct vtn_value *val,
        * the SPIR-V.  We do, however, keep the layouts in the variable's
        * interface_type because we need offsets for XFB arrays of blocks.
        */
-      var->var->type = glsl_get_bare_type(var->type->type);
+      var->var->type = var->type->type;
       var->var->data.mode = nir_mode;
       var->var->data.patch = var->patch;
 




More information about the mesa-commit mailing list