spirv: acknowledge multisampled input attachments
authorIago Toral Quiroga <itoral@igalia.com>
Tue, 24 Jan 2017 09:48:01 +0000 (10:48 +0100)
committerIago Toral Quiroga <itoral@igalia.com>
Wed, 25 Jan 2017 07:07:09 +0000 (08:07 +0100)
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/compiler/spirv/spirv_to_nir.c

index 28ab5f1e6ffac4b2f4a05a4ed634ae6531dc267f..aecda172717ccc3deb5b27fdd318daad28f48b99 100644 (file)
@@ -854,8 +854,12 @@ vtn_handle_type(struct vtn_builder *b, SpvOp opcode,
          val->type->access_qualifier = SpvAccessQualifierReadWrite;
 
       if (multisampled) {
-         assert(dim == GLSL_SAMPLER_DIM_2D);
-         dim = GLSL_SAMPLER_DIM_MS;
+         if (dim == GLSL_SAMPLER_DIM_2D)
+            dim = GLSL_SAMPLER_DIM_MS;
+         else if (dim == GLSL_SAMPLER_DIM_SUBPASS)
+            dim = GLSL_SAMPLER_DIM_SUBPASS_MS;
+         else
+            assert(!"Unsupported multisampled image type");
       }
 
       val->type->image_format = translate_image_format(format);
@@ -864,7 +868,8 @@ vtn_handle_type(struct vtn_builder *b, SpvOp opcode,
          val->type->type = glsl_sampler_type(dim, is_shadow, is_array,
                                              glsl_get_base_type(sampled_type));
       } else if (sampled == 2) {
-         assert((dim == GLSL_SAMPLER_DIM_SUBPASS) || format);
+         assert((dim == GLSL_SAMPLER_DIM_SUBPASS ||
+                 dim == GLSL_SAMPLER_DIM_SUBPASS_MS) || format);
          assert(!is_shadow);
          val->type->type = glsl_image_type(dim, is_array,
                                            glsl_get_base_type(sampled_type));