vulkan: Add a bunch of -Wpadded errors

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28615>
This commit is contained in:
Faith Ekstrand 2024-04-06 22:07:33 -05:00
parent 6ea591d372
commit aac2a31b3d
2 changed files with 6 additions and 0 deletions

View file

@ -511,6 +511,8 @@ vk_shader_unref(struct vk_device *device, struct vk_shader *shader)
vk_pipeline_cache_object_unref(device, &shader->pipeline.cache_obj);
}
PRAGMA_DIAGNOSTIC_PUSH
PRAGMA_DIAGNOSTIC_ERROR(-Wpadded)
struct vk_pipeline_tess_info {
unsigned tcs_vertices_out : 8;
unsigned primitive_mode : 2; /* tess_primitive_mode */
@ -519,6 +521,7 @@ struct vk_pipeline_tess_info {
unsigned point_mode : 1;
unsigned _pad : 18;
};
PRAGMA_DIAGNOSTIC_POP
static_assert(sizeof(struct vk_pipeline_tess_info) == 4,
"This struct has no holes");

View file

@ -167,6 +167,8 @@ vk_shader_compile_info_init(struct vk_shader_compile_info *info,
};
}
PRAGMA_DIAGNOSTIC_PUSH
PRAGMA_DIAGNOSTIC_ERROR(-Wpadded)
struct vk_shader_bin_header {
char mesavkshaderbin[16];
VkDriverId driver_id;
@ -176,6 +178,7 @@ struct vk_shader_bin_header {
uint8_t sha1[SHA1_DIGEST_LENGTH];
uint32_t _pad;
};
PRAGMA_DIAGNOSTIC_POP
static_assert(sizeof(struct vk_shader_bin_header) == 72,
"This struct has no holes");