diff options
author | Eric Engestrom <[email protected]> | 2017-06-26 12:14:37 +0100 |
---|---|---|
committer | Eric Engestrom <[email protected]> | 2017-06-26 18:21:22 +0100 |
commit | a2ae2d1fb00cf8c0edf392e1c666ee6e8ced9a82 (patch) | |
tree | 704e96eb56c5cbebec97c6cc1e8c8f36dcdc25d0 /src/amd/vulkan/radv_pipeline_cache.c | |
parent | 6fafba0e677ec9a6dfa551e34b59814e6f643e21 (diff) |
radv: use Mesa's u_atomic.h header
Signed-off-by: Eric Engestrom <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_pipeline_cache.c')
-rw-r--r-- | src/amd/vulkan/radv_pipeline_cache.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/amd/vulkan/radv_pipeline_cache.c b/src/amd/vulkan/radv_pipeline_cache.c index 0ab4d2a26e3..e57c99b8e94 100644 --- a/src/amd/vulkan/radv_pipeline_cache.c +++ b/src/amd/vulkan/radv_pipeline_cache.c @@ -23,6 +23,7 @@ #include "util/mesa-sha1.h" #include "util/debug.h" +#include "util/u_atomic.h" #include "radv_private.h" #include "ac_nir_to_llvm.h" @@ -184,7 +185,7 @@ radv_create_shader_variant_from_pipeline_cache(struct radv_device *device, entry->variant = variant; } - __sync_fetch_and_add(&entry->variant->ref_count, 1); + p_atomic_inc(&entry->variant->ref_count); return entry->variant; } @@ -276,7 +277,7 @@ radv_pipeline_cache_insert_shader(struct radv_pipeline_cache *cache, } else { entry->variant = variant; } - __sync_fetch_and_add(&variant->ref_count, 1); + p_atomic_inc(&variant->ref_count); pthread_mutex_unlock(&cache->mutex); return variant; } @@ -296,7 +297,7 @@ radv_pipeline_cache_insert_shader(struct radv_pipeline_cache *cache, entry->rsrc2 = variant->rsrc2; entry->code_size = code_size; entry->variant = variant; - __sync_fetch_and_add(&variant->ref_count, 1); + p_atomic_inc(&variant->ref_count); radv_pipeline_cache_add_entry(cache, entry); |