summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-12-14 15:48:07 -0800
committerKenneth Graunke <[email protected]>2019-02-21 10:26:11 -0800
commit73d525f1883a67a19d30b66d4e30788e781cc436 (patch)
treea99f3b137810d448badb2034ba287a47311be69e /src/gallium/drivers
parent154e3e45bb65d9aed9e277274a9acf1b0947fc72 (diff)
iris: Fix scratch space allocation on Icelake.
Gen9-10 have fewer than 4 subslices per slice, so they need this to be rounded up. Gen11 isn't documented as needing this hack, and it can also have more than 4 subslices, so the hack actually can break things. Fixes tests/spec/arb_enhanced_layouts/execution/component-layout/ sso-vs-gs-fs-array-interleave
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/iris/iris_program.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c
index 4b1a5d9958b..95c56a11748 100644
--- a/src/gallium/drivers/iris/iris_program.c
+++ b/src/gallium/drivers/iris/iris_program.c
@@ -1497,14 +1497,18 @@ iris_get_scratch_space(struct iris_context *ice,
/* The documentation for 3DSTATE_PS "Scratch Space Base Pointer" says:
*
- * "Scratch Space per slice is computed based on 4 sub-slices. SW must
- * allocate scratch space enough so that each slice has 4 slices
- * allowed."
+ * "Scratch Space per slice is computed based on 4 sub-slices. SW
+ * must allocate scratch space enough so that each slice has 4
+ * slices allowed."
*
* According to the other driver team, this applies to compute shaders
* as well. This is not currently documented at all.
+ *
+ * This hack is no longer necessary on Gen11+.
*/
- unsigned subslice_total = 4 * devinfo->num_slices;
+ unsigned subslice_total = screen->subslice_total;
+ if (devinfo->gen < 11)
+ subslice_total = 4 * devinfo->num_slices;
assert(subslice_total >= screen->subslice_total);
if (!*bop) {