From a2c4a34303cd70e1df3e822bec53312b96e94293 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Sat, 9 Nov 2024 21:37:36 -0500 Subject: [PATCH] anv: Align anv_descriptor_pool::host_mem Otherwise anv_descriptor_set is accessed through an unaligned pointer, which is undefined behavior in C. ``` anv_descriptor_set.c:1620:17: runtime error: member access within misaligned address 0x61900002c2b5 for type 'struct anv_descriptor_set', which requires 8 byte alignment 0x61900002c2b5 ``` Fixes: 2570a58bcdf ("anv: Implement descriptor pools") Part-of: --- src/intel/vulkan/anv_private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index d5cc0fe4893..ce50bb80948 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -3035,7 +3035,7 @@ struct anv_descriptor_pool { */ bool host_only; - char host_mem[0]; + alignas(8) char host_mem[0]; }; bool