mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-10 03:50:13 +01:00
vulkan: use p_atomic_read on vk_descriptor_set_layout::ref_cnt
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36652>
This commit is contained in:
parent
5b6ad73ac7
commit
fe09dfbcf3
1 changed files with 2 additions and 2 deletions
|
|
@ -84,7 +84,7 @@ void vk_descriptor_set_layout_destroy(struct vk_device *device,
|
|||
static inline struct vk_descriptor_set_layout *
|
||||
vk_descriptor_set_layout_ref(struct vk_descriptor_set_layout *layout)
|
||||
{
|
||||
assert(layout && layout->ref_cnt >= 1);
|
||||
assert(layout && p_atomic_read(&layout->ref_cnt) >= 1);
|
||||
p_atomic_inc(&layout->ref_cnt);
|
||||
return layout;
|
||||
}
|
||||
|
|
@ -93,7 +93,7 @@ static inline void
|
|||
vk_descriptor_set_layout_unref(struct vk_device *device,
|
||||
struct vk_descriptor_set_layout *layout)
|
||||
{
|
||||
assert(layout && layout->ref_cnt >= 1);
|
||||
assert(layout && p_atomic_read(&layout->ref_cnt) >= 1);
|
||||
if (p_atomic_dec_zero(&layout->ref_cnt))
|
||||
layout->destroy(device, layout);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue