intel/fs: put scratch surface in the surface state heap
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Mon, 14 Nov 2022 13:54:01 +0000 (15:54 +0200)
committerMarge Bot <emma+marge@anholt.net>
Sat, 19 Nov 2022 14:58:58 +0000 (14:58 +0000)
commit9c1c1888d9895d05246005620953ee307d1a17f1
treee574e1c1d3905eb88a4ca0a1319f128efe4e0715
parentdaab161535747cf5aef443e4cee46c5415662848
intel/fs: put scratch surface in the surface state heap

In 4ceaed7839af we made scratch surface state allocations part of the
internal heap (mapped to STATE_BASE_ADDRESS::SurfaceStateBaseAddress)
so that it doesn't uses slots in the application's expected 1M
descriptors (especially with vkd3d-proton).

But all our compiler code relies on BSS
(STATE_BASE_ADDRESS::BindlessSurfaceStateBaseAddress).

The additional issue is that there is only 26bits of surface offset
available in CS instruction (CFE_STATE, 3DSTATE_VS, etc...) for
scratch surfaces. So we need the drivers to put the scratch surfaces
in the first chunk of STATE_BASE_ADDRESS::SurfaceStateBaseAddress
(hence all the driver changes).

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 4ceaed7839af ("anv: split internal surface states from descriptors")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7687
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19727>
12 files changed:
src/gallium/drivers/iris/iris_state.c
src/intel/compiler/brw_eu_defines.h
src/intel/compiler/brw_fs_nir.cpp
src/intel/compiler/brw_fs_reg_allocate.cpp
src/intel/compiler/brw_lower_logical_sends.cpp
src/intel/vulkan/anv_allocator.c
src/intel/vulkan/anv_batch_chain.c
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_image.c
src/intel/vulkan/anv_private.h
src/intel/vulkan/genX_blorp_exec.c
src/intel/vulkan/genX_cmd_buffer.c