From 9baaf055e2136697ebbffc3e1c1dd0782b96e272 Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Wed, 11 May 2022 07:33:41 +0800 Subject: [PATCH] llvmpipe: Do not use _Atomic keyword that doesn't support by MSVC Fixes: 3269d34b29a ("llvmpipe/fence: make the fence id counter atomic") Fixes: ``` ../mesa/src/gallium/drivers/llvmpipe/lp_fence.c ../mesa/src/gallium/drivers/llvmpipe/lp_fence.c(47): error C2143: syntax error: missing ';' before 'type' ``` fence_id initialized to 0 Signed-off-by: Yonggang Luo Erik Faye-Lund Part-of: --- src/gallium/drivers/llvmpipe/lp_fence.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_fence.c b/src/gallium/drivers/llvmpipe/lp_fence.c index 7fb24d39046..e103cf2a8bd 100644 --- a/src/gallium/drivers/llvmpipe/lp_fence.c +++ b/src/gallium/drivers/llvmpipe/lp_fence.c @@ -44,7 +44,7 @@ struct lp_fence * lp_fence_create(unsigned rank) { - static _Atomic int fence_id; + static unsigned fence_id = 0; struct lp_fence *fence = CALLOC_STRUCT(lp_fence); if (!fence) @@ -55,7 +55,7 @@ lp_fence_create(unsigned rank) (void) mtx_init(&fence->mutex, mtx_plain); cnd_init(&fence->signalled); - fence->id = fence_id++; + fence->id = p_atomic_inc_return(&fence_id) - 1; fence->rank = rank; if (LP_DEBUG & DEBUG_FENCE)