unsigned subslices = MAX2(device->physical->subslice_total, 1);
- /* For, Gen11+, scratch space allocation is based on the number of threads
- * in the base configuration. */
+ /* 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."
+ *
+ * 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+.
+ *
+ * For, Gen11+, scratch space allocation is based on the number of threads
+ * in the base configuration.
+ */
if (devinfo->gen >= 12)
subslices = devinfo->num_subslices[0];
else if (devinfo->gen == 11)
subslices = 8;
+ else if (devinfo->gen >= 9)
+ subslices = 4 * devinfo->num_slices;
unsigned scratch_ids_per_subslice;
if (devinfo->gen >= 12) {