zink: Use p_atomic_fetch_add

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17529>
This commit is contained in:
Jesse Natalie
2022-07-08 12:32:33 -07:00
committed by Marge Bot
parent 3245d3a219
commit 4845bc7072
+1 -6
View File
@@ -1218,12 +1218,7 @@ bo_slab_alloc(void *priv, unsigned heap, unsigned entry_size, unsigned group_ind
list_inithead(&slab->base.free);
#ifdef _MSC_VER
/* C11 too hard for msvc, no __sync_fetch_and_add */
base_id = p_atomic_add_return(&screen->pb.next_bo_unique_id, slab->base.num_entries) - slab->base.num_entries;
#else
base_id = __sync_fetch_and_add(&screen->pb.next_bo_unique_id, slab->base.num_entries);
#endif
base_id = p_atomic_fetch_add(&screen->pb.next_bo_unique_id, slab->base.num_entries);
for (unsigned i = 0; i < slab->base.num_entries; ++i) {
struct zink_bo *bo = &slab->entries[i];