From 25f5f1b9b4de184eea15a254a1212fbf5865ebf1 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 11 Jan 2025 23:33:12 -0800 Subject: [PATCH] hk: Fix build error with static_assert MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ../src/asahi/vulkan/hk_cmd_draw.c: In function ‘hk_draw’: ../src/asahi/vulkan/hk_cmd_draw.c:3471:32: error: expression in static assertion is not constant 3471 | static_assert(size > sizeof(VkDrawIndirectCommand), | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: 5bc89aa991eb ("hk,libagx: handle adjacency without a GS") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12351 Signed-off-by: Vinson Lee Reviewed-by: Eric Engestrom Part-of: --- src/asahi/vulkan/hk_cmd_draw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/asahi/vulkan/hk_cmd_draw.c b/src/asahi/vulkan/hk_cmd_draw.c index 0a0bab8ca45..80d48f7ea5d 100644 --- a/src/asahi/vulkan/hk_cmd_draw.c +++ b/src/asahi/vulkan/hk_cmd_draw.c @@ -3468,7 +3468,8 @@ hk_draw(struct hk_cmd_buffer *cmd, uint16_t draw_id, struct agx_draw draw_) if (agx_is_indirect(draw.b)) { const size_t size = sizeof(VkDrawIndexedIndirectCommand); - static_assert(size > sizeof(VkDrawIndirectCommand), + static_assert(sizeof(VkDrawIndexedIndirectCommand) > + sizeof(VkDrawIndirectCommand), "allocation size is conservative"); uint64_t out_draw = hk_pool_alloc(cmd, size, 4).gpu;