OSDN Git Service

compiler/types: Serialize/deserialize subpass input types correctly
authorJason Ekstrand <jason.ekstrand@intel.com>
Sat, 13 Oct 2018 00:03:30 +0000 (19:03 -0500)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 11 Jan 2019 01:15:27 +0000 (19:15 -0600)
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.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/compiler/glsl_types.cpp

index 00be0e0..9d5451d 100644 (file)
@@ -2311,14 +2311,14 @@ decode_type_from_blob(struct blob_reader *blob)
                                      explicit_stride, (u >> 10) & 0x1);
    }
    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: