nvk: Advertise KHR_dedicated_allocation

We're not requiring or even requesting anything to be dedicated yet but
we may as well put in the plumbing.  This gets more tests running.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
Faith Ekstrand
2023-01-30 20:11:50 -06:00
committed by Marge Bot
parent fedff04fbd
commit fae4f1884c
3 changed files with 16 additions and 2 deletions

View File

@@ -50,8 +50,14 @@ nvk_GetBufferMemoryRequirements2(VkDevice _device,
.memoryTypeBits = BITFIELD_MASK(device->pdev->mem_type_cnt),
};
vk_foreach_struct(ext, pMemoryRequirements->pNext) {
vk_foreach_struct_const(ext, pMemoryRequirements->pNext) {
switch (ext->sType) {
case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: {
VkMemoryDedicatedRequirements *dedicated = (void *)ext;
dedicated->prefersDedicatedAllocation = false;
dedicated->requiresDedicatedAllocation = false;
break;
}
default:
nvk_debug_ignored_stype(ext->sType);
break;

View File

@@ -262,8 +262,14 @@ nvk_GetImageMemoryRequirements2(VkDevice _device,
pMemoryRequirements->memoryRequirements.alignment = 0x1000;
pMemoryRequirements->memoryRequirements.size = image->nil.size_B;
vk_foreach_struct_const(ext, pInfo->pNext) {
vk_foreach_struct_const(ext, pMemoryRequirements->pNext) {
switch (ext->sType) {
case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: {
VkMemoryDedicatedRequirements *dedicated = (void *)ext;
dedicated->prefersDedicatedAllocation = false;
dedicated->requiresDedicatedAllocation = false;
break;
}
default:
nvk_debug_ignored_stype(ext->sType);
break;

View File

@@ -145,6 +145,8 @@ nvk_get_device_extensions(const struct nvk_physical_device *device,
{
*ext = (struct vk_device_extension_table) {
.KHR_copy_commands2 = true,
.KHR_dedicated_allocation = true,
.KHR_get_memory_requirements2 = true,
.KHR_format_feature_flags2 = true,
#ifdef NVK_USE_WSI_PLATFORM
.KHR_swapchain = true,