summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_pipeline.c
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2017-06-26 12:14:37 +0100
committerEric Engestrom <[email protected]>2017-06-26 18:21:22 +0100
commita2ae2d1fb00cf8c0edf392e1c666ee6e8ced9a82 (patch)
tree704e96eb56c5cbebec97c6cc1e8c8f36dcdc25d0 /src/amd/vulkan/radv_pipeline.c
parent6fafba0e677ec9a6dfa551e34b59814e6f643e21 (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.c')
-rw-r--r--src/amd/vulkan/radv_pipeline.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index 0c262799f0c..efe641dc0be 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -26,6 +26,7 @@
*/
#include "util/mesa-sha1.h"
+#include "util/u_atomic.h"
#include "radv_private.h"
#include "nir/nir.h"
#include "nir/nir_builder.h"
@@ -374,7 +375,7 @@ static void radv_dump_pipeline_stats(struct radv_device *device, struct radv_pip
void radv_shader_variant_destroy(struct radv_device *device,
struct radv_shader_variant *variant)
{
- if (__sync_fetch_and_sub(&variant->ref_count, 1) != 1)
+ if (!p_atomic_dec_zero(&variant->ref_count))
return;
device->ws->buffer_destroy(variant->bo);