diff options
author | Eric Anholt <[email protected]> | 2016-05-17 12:24:06 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2016-05-17 18:07:39 -0700 |
commit | 8835eb689b51593dcbe09f39a79af9e551c3e0b4 (patch) | |
tree | 9a801ccc17cc9aa417ed60ad33510773eab1042c /src/gallium/drivers/vc4/vc4_program.c | |
parent | 62087cb9b80c271139370a242841def40cfdabae (diff) |
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.c | 3 |
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 0a7bcb0374c..36ad3875e7e 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) { |