Module: Mesa
Branch: main
Commit: 7c76125db25db9bdf5521baf7c848ccd4bd37b5f
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7c76125db25db9bdf5521baf7c848ccd4bd37b5f

Author: Lionel Landwerlin <lionel.g.landwer...@intel.com>
Date:   Fri Oct 20 17:33:21 2023 +0300

anv: use 2 different buffers for surfaces/samplers in descriptor sets

We had the unfortunate finding on a recent platform to learn that the
bindless sampler heap is not functioning as expected.

Nowhere in the documentation is the size of the heap written down. So
most people assumed that's the max number that we can program (4Gb).

The reality is that it's only 64Mb.

Though it is appearing like it's working properly for the whole 4Gb
range for most apps, this is only because the HW bounds checking
applied is broken. Instead of clamping anything beyong 64Mb, it's only
clamping the last 4Kb of each 64Mb region.

So this heap is useless for us to make a 4Gb region of both sampler &
surface states...

This change essentially turns off the bindless sampler heap on DG2+.

The only location where we can put SAMPLER_STATE elements is the
dynamic state heap. Unfortunately we cannot align the dynamic state
heap with the bindless surface state heap. So the solution is to
allocate sampler & surface states separately, each from the own heap
in the descriptor pool.

We now have to provide 2 sets of offsets for surfaces & samplers.

Signed-off-by: Lionel Landwerlin <lionel.g.landwer...@intel.com>
Reviewed-by: Rohan Garg <rohan.g...@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25897>

---

 src/intel/vulkan/anv_cmd_buffer.c                |  43 +-
 src/intel/vulkan/anv_descriptor_set.c            | 776 ++++++++++++++++-------
 src/intel/vulkan/anv_device.c                    |  13 +-
 src/intel/vulkan/anv_nir_apply_pipeline_layout.c |  96 ++-
 src/intel/vulkan/anv_nir_compute_push_layout.c   |  18 +-
 src/intel/vulkan/anv_nir_lower_resource_intel.c  |   4 +-
 src/intel/vulkan/anv_pipeline_cache.c            |   6 +-
 src/intel/vulkan/anv_private.h                   | 105 ++-
 src/intel/vulkan/anv_va.c                        |  25 +-
 src/intel/vulkan/genX_cmd_buffer.c               |  44 +-
 src/intel/vulkan/genX_init_state.c               |  33 +-
 11 files changed, 781 insertions(+), 382 deletions(-)

Diff:   
http://cgit.freedesktop.org/mesa/mesa/diff/?id=7c76125db25db9bdf5521baf7c848ccd4bd37b5f

Reply via email to