diff options
author | Eric Engestrom <[email protected]> | 2017-06-26 12:14:49 +0100 |
---|---|---|
committer | Eric Engestrom <[email protected]> | 2017-06-26 18:21:22 +0100 |
commit | 2b237ff64cd4146e51bf6579293b1e803b1adfb4 (patch) | |
tree | 3645145ead7e6b11df91ea56e031e46dcb8f241f /src/intel/vulkan | |
parent | a2ae2d1fb00cf8c0edf392e1c666ee6e8ced9a82 (diff) |
anv: use Mesa's u_atomic.h header
Signed-off-by: Eric Engestrom <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/intel/vulkan')
-rw-r--r-- | src/intel/vulkan/anv_private.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index e5d88f28150..8079378ae63 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -46,6 +46,7 @@ #include "compiler/brw_compiler.h" #include "util/macros.h" #include "util/list.h" +#include "util/u_atomic.h" #include "util/u_vector.h" #include "vk_alloc.h" @@ -1862,14 +1863,14 @@ static inline void anv_shader_bin_ref(struct anv_shader_bin *shader) { assert(shader && shader->ref_cnt >= 1); - __sync_fetch_and_add(&shader->ref_cnt, 1); + p_atomic_inc(&shader->ref_cnt); } static inline void anv_shader_bin_unref(struct anv_device *device, struct anv_shader_bin *shader) { assert(shader && shader->ref_cnt >= 1); - if (__sync_fetch_and_add(&shader->ref_cnt, -1) == 1) + if (p_atomic_dec_zero(&shader->ref_cnt)) anv_shader_bin_destroy(device, shader); } |