Module: Mesa
Branch: master
Commit: 2213ffdb4bb79856f0556bdf2bfd4bdf57720232
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2213ffdb4bb79856f0556bdf2bfd4bdf57720232

Author: Kenneth Graunke <[email protected]>
Date:   Mon Jun  6 21:37:34 2016 -0700

i965: Allocate scratch space for the maximum number of compute threads.

We were allocating enough space for the number of threads per subslice,
when we should have been allocating space for the number of threads in
the entire GPU.

Even though we currently run with a reduced thread count (due to a bug),
we might still overflow the scratch buffer because the address
calculation is based on the FFTID, which can depend on exactly which
threads, EUs, and threads are executing.  We need to allocate enough
for every possible thread that could run.

Fixes rendering corruption in Synmark's Gl43CSDof on Gen8+.
Earlier platforms need additional bug fixes.

Cc: "12.0" <[email protected]>
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Francisco Jerez <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>

---

 src/mesa/drivers/dri/i965/brw_cs.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_cs.c 
b/src/mesa/drivers/dri/i965/brw_cs.c
index 2a25584..c8598d6 100644
--- a/src/mesa/drivers/dri/i965/brw_cs.c
+++ b/src/mesa/drivers/dri/i965/brw_cs.c
@@ -149,8 +149,10 @@ brw_codegen_cs_prog(struct brw_context *brw,
    }
 
    if (prog_data.base.total_scratch) {
+      const unsigned subslices = MAX2(brw->intelScreen->subslice_total, 1);
       brw_get_scratch_bo(brw, &brw->cs.base.scratch_bo,
-                         prog_data.base.total_scratch * brw->max_cs_threads);
+                         prog_data.base.total_scratch *
+                         brw->max_cs_threads * subslices);
    }
 
    if (unlikely(INTEL_DEBUG & DEBUG_CS))

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to