nvk: Bump the sparse alignment requirement on buffers to 64K

Otherwise, if they live in VRAM, binding might fail.

Fixes: 03f0f01904 ("nvk: Add support for sparse buffers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30033>
This commit is contained in:
Faith Ekstrand
2024-07-06 10:37:46 -05:00
committed by Marge Bot
parent 9bd64cbefe
commit 58181b7bbc
2 changed files with 3 additions and 1 deletions

View File

@@ -28,7 +28,7 @@ nvk_get_buffer_alignment(const struct nvk_physical_device *pdev,
if (create_flags & (VK_BUFFER_CREATE_SPARSE_BINDING_BIT |
VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT))
alignment = MAX2(alignment, 4096);
alignment = MAX2(alignment, NVK_SPARSE_BIND_ALIGN_B);
return alignment;
}

View File

@@ -35,6 +35,8 @@
/* Max size of a bound cbuf */
#define NVK_MAX_CBUF_SIZE (1u << 16)
#define NVK_SPARSE_BIND_ALIGN_B (1u << 16)
struct nvk_addr_range {
uint64_t addr;
uint64_t range;