nvk: fix preprocess buffer alignment

Previously DGC alignment requirements declared by
getGeneratedCommandsMemoryRequirementsExt were not also reported by
getDeviceBufferMemoryRequirements for preprocess buffers.

This fixes 1554 dEQP-VK failures related to device-generated commands
that previously failed with "DGC alignment requirement larger than
preprocess buffer alignment requirement".

Fixes: 976f22a5da ("nvk: Implement CmdProcess/ExecuteGeneratedCommandsEXT")
Reviewed-by: Faith Ekstrand <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33555>
This commit is contained in:
Lorenzo Rossi 2025-02-14 19:36:11 +01:00 committed by Marge Bot
parent a9b6a54a8c
commit cc30e35306
3 changed files with 8 additions and 0 deletions

View file

@ -28,6 +28,9 @@ nvk_get_buffer_alignment(const struct nvk_physical_device *pdev,
VK_BUFFER_USAGE_2_STORAGE_TEXEL_BUFFER_BIT_KHR))
alignment = MAX2(alignment, NVK_MIN_TEXEL_BUFFER_ALIGNMENT);
if (usage_flags & VK_BUFFER_USAGE_2_PREPROCESS_BUFFER_BIT_EXT)
alignment = MAX2(alignment, NVK_DGC_ALIGN);
if (create_flags & (VK_BUFFER_CREATE_SPARSE_BINDING_BIT |
VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT))
alignment = MAX2(alignment, pdev->nvkmd->bind_align_B);

View file

@ -239,6 +239,8 @@ static_assert(sizeof(struct nvk_ies_cs_qmd) % QMD_ALIGN == 0,
"QMD size is not properly algined");
static_assert(sizeof(struct nvk_root_descriptor_table) % QMD_ALIGN == 0,
"Root descriptor table size is not aligned");
static_assert(NVK_DGC_ALIGN >= QMD_ALIGN,
"QMD alignment requirement is a lower bound of DGC alignment");
static void
copy_repl_global_dw(nir_builder *b, nir_def *dst_addr, nir_def *src_addr,

View file

@ -38,6 +38,9 @@
#define NVK_MAX_IMAGE_PLANES 3
#define NVK_MAX_SAMPLER_PLANES 2
/* Device Generated Commands */
#define NVK_DGC_ALIGN 0x100
struct nvk_addr_range {
uint64_t addr;
uint64_t range;