Mesa (main): compiler/types: Combine image and sampler type serialization

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Oct 16 06:15:08 UTC 2021


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

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Fri Oct 15 14:25:00 2021 -0500

compiler/types: Combine image and sampler type serialization

Reviewed-by: Jesse Natalie <jenatali at microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13389>

---

 src/compiler/glsl_types.cpp | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp
index 334c05e73bb..83a923549f6 100644
--- a/src/compiler/glsl_types.cpp
+++ b/src/compiler/glsl_types.cpp
@@ -3022,8 +3022,12 @@ encode_type_to_blob(struct blob *blob, const glsl_type *type)
          blob_write_uint32(blob, type->explicit_alignment);
       return;
    case GLSL_TYPE_SAMPLER:
+   case GLSL_TYPE_IMAGE:
       encoded.sampler.dimensionality = type->sampler_dimensionality;
-      encoded.sampler.shadow = type->sampler_shadow;
+      if (type->base_type == GLSL_TYPE_SAMPLER)
+         encoded.sampler.shadow = type->sampler_shadow;
+      else
+         assert(!type->sampler_shadow);
       encoded.sampler.array = type->sampler_array;
       encoded.sampler.sampled_type = type->sampled_type;
       break;
@@ -3031,11 +3035,6 @@ encode_type_to_blob(struct blob *blob, const glsl_type *type)
       blob_write_uint32(blob, encoded.u32);
       blob_write_string(blob, type->name);
       return;
-   case GLSL_TYPE_IMAGE:
-      encoded.sampler.dimensionality = type->sampler_dimensionality;
-      encoded.sampler.array = type->sampler_array;
-      encoded.sampler.sampled_type = type->sampled_type;
-      break;
    case GLSL_TYPE_ATOMIC_UINT:
       break;
    case GLSL_TYPE_ARRAY:



More information about the mesa-commit mailing list