hk: Fix build error with static_assert

../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: 5bc89aa991 ("hk,libagx: handle adjacency without a GS")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12351
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Eric Engestrom <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32988>
This commit is contained in:
Vinson Lee 2025-01-11 23:33:12 -08:00 committed by Marge Bot
parent 2a053b2e60
commit 25f5f1b9b4

View file

@ -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;