turnip: do not do STATIC_ASSERT on a variable
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 23 May 2022 11:36:09 +0000 (13:36 +0200)
committerMarge Bot <emma+marge@anholt.net>
Fri, 3 Jun 2022 07:14:43 +0000 (07:14 +0000)
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16670>

src/freedreno/vulkan/tu_cs.h

index 6e830a9..1a01f76 100644 (file)
@@ -366,8 +366,8 @@ tu_cond_exec_end(struct tu_cs *cs)
    const struct fd_reg_pair regs[] = { __VA_ARGS__ };   \
    unsigned count = ARRAY_SIZE(regs);                   \
                                                         \
-   STATIC_ASSERT(count > 0);                            \
-   STATIC_ASSERT(count <= 16);                          \
+   STATIC_ASSERT(ARRAY_SIZE(regs) > 0);                 \
+   STATIC_ASSERT(ARRAY_SIZE(regs) <= 16);               \
                                                         \
    tu_cs_emit_pkt4((cs), regs[0].reg, count);             \
    uint32_t *p = (cs)->cur;                               \