summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIago Toral Quiroga <[email protected]>2017-01-24 10:48:01 +0100
committerIago Toral Quiroga <[email protected]>2017-01-25 08:07:09 +0100
commit9467d78d380695b38f48949497f7de12c1054e81 (patch)
tree7072b3a0cf380b0cf3d939171f2fc0148b7f7db9
parent2ab2be092d15ddb449b4a215609705bae68089a0 (diff)
spirv: acknowledge multisampled input attachments
Reviewed-by: Lionel Landwerlin <[email protected]>
-rw-r--r--src/compiler/spirv/spirv_to_nir.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index 28ab5f1e6ff..aecda172717 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -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));