aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan
diff options
context:
space:
mode:
authorPaulo Zanoni <[email protected]>2020-02-28 16:03:02 -0800
committerMarge Bot <[email protected]>2020-03-03 00:36:10 +0000
commit62f7197fb54d2fbb7bd5646115008d3c27a3dfb9 (patch)
tree8973722ff958fdf37426e27b93209f5e79afb22f /src/intel/vulkan
parentaa78801f0a6cfeaf3d16b4333239c0b862f73c10 (diff)
anv: multiply the scratch space by 4 on gen9-10 like iris and i965
My understanding is that there's no reason for the scratch space allocation to be different between iris, i965 and anv. Let's make all the functions behave the same. I don't know if this fixes any specific gen9 bugs, it it might since it increases the scratch space. v2: Rebase. v3: Rebase. v4: Remove redundant gen 11 check (Jason). Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Signed-off-by: Paulo Zanoni <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4006> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4006>
Diffstat (limited to 'src/intel/vulkan')
-rw-r--r--src/intel/vulkan/anv_allocator.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/intel/vulkan/anv_allocator.c b/src/intel/vulkan/anv_allocator.c
index f698289155b..4ab5827623e 100644
--- a/src/intel/vulkan/anv_allocator.c
+++ b/src/intel/vulkan/anv_allocator.c
@@ -1397,12 +1397,26 @@ anv_scratch_pool_alloc(struct anv_device *device, struct anv_scratch_pool *pool,
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) {