summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_program.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2016-05-17 12:24:06 -0700
committerEric Anholt <eric@anholt.net>2016-05-17 18:07:39 -0700
commit8835eb689b51593dcbe09f39a79af9e551c3e0b4 (patch)
tree9a801ccc17cc9aa417ed60ad33510773eab1042c /src/gallium/drivers/vc4/vc4_program.c
parent62087cb9b80c271139370a242841def40cfdabae (diff)
downloadexternal_mesa3d-8835eb689b51593dcbe09f39a79af9e551c3e0b4.zip
external_mesa3d-8835eb689b51593dcbe09f39a79af9e551c3e0b4.tar.gz
external_mesa3d-8835eb689b51593dcbe09f39a79af9e551c3e0b4.tar.bz2
vc4: Enable sharing shaders across contexts.
This allows the same pipe_shader_state to be referenced from multiple contexts. Since our pipe_shader_state is treated as immutable (other than the variant number) within the driver, this is no problem.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_program.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_program.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c
index 0a7bcb0..36ad387 100644
--- a/src/gallium/drivers/vc4/vc4_program.c
+++ b/src/gallium/drivers/vc4/vc4_program.c
@@ -1766,7 +1766,8 @@ vc4_shader_ntq(struct vc4_context *vc4, enum qstage stage,
c->stage = stage;
c->shader_state = &key->shader_state->base;
c->program_id = key->shader_state->program_id;
- c->variant_id = key->shader_state->compiled_variant_count++;
+ c->variant_id =
+ p_atomic_inc_return(&key->shader_state->compiled_variant_count);
c->key = key;
switch (stage) {