From: Boris Brezillon Date: Tue, 23 Jun 2020 10:49:23 +0000 (+0200) Subject: spirv: Don't accept CPacked decoration on struct members X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=938d6ceb8300b194a7cbaf640e2c899cbecc6c5a;p=mesa.git spirv: Don't accept CPacked decoration on struct members CPacked decoration is only allowed on struct definitions, not struct members. Signed-off-by: Boris Brezillon Reviewed-by: Karol Herbst Reviewed-by: Jason Ekstrand Reviewed-by: Jesse Natalie Part-of: --- diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index 12699ce5d6d..6f29ab62484 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -1041,6 +1041,7 @@ struct_member_decoration_cb(struct vtn_builder *b, case SpvDecorationLinkageAttributes: case SpvDecorationNoContraction: case SpvDecorationInputAttachmentIndex: + case SpvDecorationCPacked: vtn_warn("Decoration not allowed on struct members: %s", spirv_decoration_to_string(dec->decoration)); break; @@ -1050,14 +1051,6 @@ struct_member_decoration_cb(struct vtn_builder *b, /* This is handled later by var_decoration_cb in vtn_variables.c */ break; - case SpvDecorationCPacked: - if (b->shader->info.stage != MESA_SHADER_KERNEL) - vtn_warn("Decoration only allowed for CL-style kernels: %s", - spirv_decoration_to_string(dec->decoration)); - else - ctx->type->packed = true; - break; - case SpvDecorationSaturatedConversion: case SpvDecorationFuncParamAttr: case SpvDecorationFPRoundingMode: