summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_shader.h
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-10-22 17:38:32 +0200
committerNicolai Hähnle <[email protected]>2017-11-09 11:37:51 +0100
commit4f493c79eee01724152b6e56c71b81303e3bc54e (patch)
tree52236d0f1efe12b44ddc444c46a842933343e4ce /src/gallium/drivers/radeonsi/si_shader.h
parentd1ff0826370cb1cfbcf741c8eb35caf1fddd7d52 (diff)
radeonsi: use ready fences on all shaders, not just optimized ones
There's a race condition between si_shader_select_with_key and si_bind_XX_shader: Thread 1 Thread 2 -------- -------- si_shader_select_with_key begin compiling the first variant (guarded by sel->mutex) si_bind_XX_shader select first_variant by default as state->current si_shader_select_with_key match state->current and early-out Since thread 2 never takes sel->mutex, it may go on rendering without a PM4 for that shader, for example. The solution taken by this patch is to broaden the scope of shader->optimized_ready to a fence shader->ready that applies to all shaders. This does not hurt the fast path (if anything it makes it faster, because we don't explicitly check is_optimized). It will also allow reducing the scope of sel->mutex locks, but this is deferred to a later commit for better bisectability. Fixes dEQP-EGL.functional.sharing.gles2.multithread.simple.buffers.bufferdata_render Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_shader.h')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h
index b8f9d18f5c8..41851627a87 100644
--- a/src/gallium/drivers/radeonsi/si_shader.h
+++ b/src/gallium/drivers/radeonsi/si_shader.h
@@ -593,7 +593,7 @@ struct si_shader {
struct r600_resource *bo;
struct r600_resource *scratch_bo;
struct si_shader_key key;
- struct util_queue_fence optimized_ready;
+ struct util_queue_fence ready;
bool compilation_failed;
bool is_monolithic;
bool is_optimized;