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) {