Mesa (master): nir: Fix serialize/deserialize of void samplers/images

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Aug 17 13:27:00 UTC 2020


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

Author: Jesse Natalie <jenatali at microsoft.com>
Date:   Fri May  1 15:04:06 2020 -0700

nir: Fix serialize/deserialize of void samplers/images

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6222>

---

 src/compiler/glsl_types.cpp      | 6 ++++--
 src/compiler/nir/nir_serialize.c | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp
index 051d8e8c382..e093034aa9f 100644
--- a/src/compiler/glsl_types.cpp
+++ b/src/compiler/glsl_types.cpp
@@ -917,6 +917,8 @@ glsl_type::get_sampler_instance(enum glsl_sampler_dim dim,
       case GLSL_SAMPLER_DIM_SUBPASS_MS:
          return error_type;
       }
+   case GLSL_TYPE_VOID:
+      return shadow ? samplerShadow_type : sampler_type;
    default:
       return error_type;
    }
@@ -2656,8 +2658,8 @@ union packed_type {
       unsigned dimensionality:4;
       unsigned shadow:1;
       unsigned array:1;
-      unsigned sampled_type:2;
-      unsigned _pad:19;
+      unsigned sampled_type:5;
+      unsigned _pad:16;
    } sampler;
    struct {
       unsigned base_type:5;
diff --git a/src/compiler/nir/nir_serialize.c b/src/compiler/nir/nir_serialize.c
index b2b3afb151e..626b7d44a02 100644
--- a/src/compiler/nir/nir_serialize.c
+++ b/src/compiler/nir/nir_serialize.c
@@ -1442,7 +1442,7 @@ read_ssa_undef(read_ctx *ctx, union packed_instr header)
 union packed_tex_data {
    uint32_t u32;
    struct {
-      enum glsl_sampler_dim sampler_dim:4;
+      unsigned sampler_dim:4;
       unsigned dest_type:8;
       unsigned coord_components:3;
       unsigned is_array:1;



More information about the mesa-commit mailing list