From 4e31f5d54d9358957588233609007d8e18099799 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Tue, 16 Mar 2021 18:01:14 +0000 Subject: [PATCH] vkd3d: Align d3d12_rtv_desc to D3D12_DESC_ALIGNMENT Otherwise we can do an alligned_malloc with a non-aligned size as the descriptor size is 48 for a d3d12_rtv_desc otherwise. Signed-off-by: Joshua Ashton --- libs/vkd3d/vkd3d_private.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index e18e6f95..cfb576ec 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -1009,7 +1009,7 @@ HRESULT d3d12_create_static_sampler(struct d3d12_device *device, struct d3d12_rtv_desc { - VkSampleCountFlagBits sample_count; + DECLSPEC_ALIGN(D3D12_DESC_ALIGNMENT) VkSampleCountFlagBits sample_count; const struct vkd3d_format *format; unsigned int width; unsigned int height; @@ -1017,6 +1017,7 @@ struct d3d12_rtv_desc struct vkd3d_view *view; struct d3d12_resource *resource; }; +STATIC_ASSERT(sizeof(struct d3d12_rtv_desc) == 64); void d3d12_rtv_desc_copy(struct d3d12_rtv_desc *dst, struct d3d12_rtv_desc *src, unsigned int count);