anv: don't try to access dynamic buffers from surface states
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Thu, 20 Jul 2023 13:43:08 +0000 (16:43 +0300)
committerMarge Bot <emma+marge@anholt.net>
Mon, 14 Aug 2023 07:27:16 +0000 (07:27 +0000)
Even with direct descriptors, our current implementation works by
doing A64 messages to read/write dynamic buffers. This is so that we
can apply the sliding range view of the descriptor while having
robustness support.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 06dfd216d3 ("anv: add direct descriptor support to apply_layout")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24256>

src/intel/vulkan/anv_nir_apply_pipeline_layout.c

index 487ecc6..7958ad2 100644 (file)
@@ -1199,8 +1199,7 @@ try_lower_direct_buffer_intrinsic(nir_builder *b,
    /* If a dynamic has not been assigned a binding table entry, we need to
     * bail here.
     */
-   if (state->layout->type == ANV_PIPELINE_DESCRIPTOR_SET_LAYOUT_TYPE_INDIRECT &&
-       (bind_layout->type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC ||
+   if ((bind_layout->type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC ||
         bind_layout->type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC) &&
        !descriptor_has_bti(desc, state))
       return false;