spirv: Make sampled images a real type

Previously, we just gave them exactly the same type as the respective
image (which already had a sampler2D or similar type).  Now they have
their own base type and a pointer to the vtn_type for the image.
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
This commit is contained in:
Jason Ekstrand
2017-12-07 23:42:13 -08:00
committed by Jason Ekstrand
parent ec0a4fcec0
commit aaeda8d7d4
2 changed files with 11 additions and 1 deletions

View File

@@ -511,6 +511,7 @@ vtn_type_copy(struct vtn_builder *b, struct vtn_type *src)
case vtn_base_type_pointer:
case vtn_base_type_image:
case vtn_base_type_sampler:
case vtn_base_type_sampled_image:
/* Nothing more to do */
break;
@@ -1130,7 +1131,9 @@ vtn_handle_type(struct vtn_builder *b, SpvOp opcode,
}
case SpvOpTypeSampledImage:
val->type = vtn_value(b, w[2], vtn_value_type_type)->type;
val->type->base_type = vtn_base_type_sampled_image;
val->type->image = vtn_value(b, w[2], vtn_value_type_type)->type;
val->type->type = val->type->image->type;
break;
case SpvOpTypeSampler: