diff options
author | Francisco Jerez <currojerez@riseup.net> | 2016-06-10 16:41:59 -0700 |
---|---|---|
committer | Francisco Jerez <currojerez@riseup.net> | 2016-06-13 15:55:58 -0700 |
commit | a84b5d43e2e54dbebe3600111f4f35c29411f831 (patch) | |
tree | 54630d8e5f460373793422356e95cdee0ebdb578 /src/mesa/drivers/dri/i965/gen7_gs_state.c | |
parent | d960284e447df9b1563deef0ce950617decfba63 (diff) | |
download | external_mesa3d-a84b5d43e2e54dbebe3600111f4f35c29411f831.zip external_mesa3d-a84b5d43e2e54dbebe3600111f4f35c29411f831.tar.gz external_mesa3d-a84b5d43e2e54dbebe3600111f4f35c29411f831.tar.bz2 |
i965: Fix cross-primitive scratch corruption when changing the per-thread allocation.
I haven't found any mention of this in the hardware docs, but
experimentally what seems to be going on is that when the per-thread
scratch slot size is changed between two pipelined draw calls, shader
invocations using the old and new scratch size setting may end up
being executed in parallel, causing their scratch offset calculations
to be based in a different partitioning of the scratch space, which
can cause their thread-local scratch space to overlap leading to
cross-thread scratch corruption.
I've been experimenting with alternative workarounds, like emitting a
PIPE_CONTROL with DC flush and CS stall between draw (or dispatch
compute) calls using different per-thread scratch allocation settings,
or avoiding reuse of the scratch BO if the per-thread scratch
allocation doesn't exactly match the original. Both seem to be as
effective as this workaround, but they have potential performance
implications, while this should be basically for free.
Fixes over 40 failures in our CI system with spilling forced on
(including CTS, dEQP and Piglit failures) on a number of different
platforms from Gen4 to Gen9. The 'glsl-max-varyings' piglit test
seems to be able to reproduce this bug consistently in the vertex
shader on at least Gen4, Gen8 and Gen9 with spilling forced on.
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/drivers/dri/i965/gen7_gs_state.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/gen7_gs_state.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/gen7_gs_state.c b/src/mesa/drivers/dri/i965/gen7_gs_state.c index 6b126fe..7d73393 100644 --- a/src/mesa/drivers/dri/i965/gen7_gs_state.c +++ b/src/mesa/drivers/dri/i965/gen7_gs_state.c @@ -64,7 +64,7 @@ upload_gs_state(struct brw_context *brw) if (brw->gs.prog_data->base.base.total_scratch) { OUT_RELOC(stage_state->scratch_bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, - ffs(brw->gs.prog_data->base.base.total_scratch) - 11); + ffs(stage_state->per_thread_scratch) - 11); } else { OUT_BATCH(0); } |