diff options
Diffstat (limited to 'src/freedreno')
-rw-r--r-- | src/freedreno/ir3/ir3_shader.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/freedreno/ir3/ir3_shader.c b/src/freedreno/ir3/ir3_shader.c index bbe27ce4dbb..7c686f0ee2a 100644 --- a/src/freedreno/ir3/ir3_shader.c +++ b/src/freedreno/ir3/ir3_shader.c @@ -24,6 +24,7 @@ * Rob Clark <[email protected]> */ +#include "util/u_atomic.h" #include "util/u_string.h" #include "util/u_memory.h" #include "util/u_format.h" @@ -278,7 +279,7 @@ ir3_shader_from_nir(struct ir3_compiler *compiler, nir_shader *nir) mtx_init(&shader->variants_lock, mtx_plain); shader->compiler = compiler; - shader->id = ++shader->compiler->shader_count; + shader->id = p_atomic_inc_return(&shader->compiler->shader_count); shader->type = nir->info.stage; NIR_PASS_V(nir, nir_lower_io, nir_var_all, ir3_glsl_type_size, |