[Mesa-dev] [PATCH 3/5] compiler/types: Serialize/deserialize subpass input types correctly

Jason Ekstrand jason at jlekstrand.net
Sat Oct 13 00:08:17 UTC 2018


They have glsl_sampler_dim enum values of 8 and 9 which don't work when
you & them with 0x7.  Fortunately, we have plenty of bits.
---
 src/compiler/glsl_types.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp
index 70bce6ace8e..d3cfcf24dd8 100644
--- a/src/compiler/glsl_types.cpp
+++ b/src/compiler/glsl_types.cpp
@@ -2175,14 +2175,14 @@ decode_type_from_blob(struct blob_reader *blob)
    case GLSL_TYPE_INT64:
       return glsl_type::get_instance(base_type, (u >> 4) & 0x0f, u & 0x0f);
    case GLSL_TYPE_SAMPLER:
-      return glsl_type::get_sampler_instance((enum glsl_sampler_dim) ((u >> 4) & 0x07),
+      return glsl_type::get_sampler_instance((enum glsl_sampler_dim) ((u >> 4) & 0x0f),
                                              (u >> 3) & 0x01,
                                              (u >> 2) & 0x01,
                                              (glsl_base_type) ((u >> 0) & 0x03));
    case GLSL_TYPE_SUBROUTINE:
       return glsl_type::get_subroutine_instance(blob_read_string(blob));
    case GLSL_TYPE_IMAGE:
-      return glsl_type::get_image_instance((enum glsl_sampler_dim) ((u >> 3) & 0x07),
+      return glsl_type::get_image_instance((enum glsl_sampler_dim) ((u >> 3) & 0x0f),
                                              (u >> 2) & 0x01,
                                              (glsl_base_type) ((u >> 0) & 0x03));
    case GLSL_TYPE_ATOMIC_UINT:
-- 
2.19.1



More information about the mesa-dev mailing list