diff options
author | Bas Nieuwenhuizen <[email protected]> | 2017-07-15 02:08:00 +0200 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-07-15 08:59:38 -0700 |
commit | 6ddc64b93ea462b9755f5f9abfc7c72aa014a5e0 (patch) | |
tree | 7b4dcaee81e7aa0ab354e3e855b579b17411a42a /src/amd | |
parent | 97931f02975b600cbcc6362ac2fcb6e3f426fe7e (diff) |
radv: Add support for VK_KHR_dedicated_allocation.
Signed-off-by: Bas Nieuwenhuizen <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Acked-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r-- | src/amd/vulkan/radv_device.c | 36 | ||||
-rw-r--r-- | src/amd/vulkan/radv_entrypoints_gen.py | 1 |
2 files changed, 35 insertions, 2 deletions
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index c5d66b8bc6d..59c4ea8448e 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -141,6 +141,10 @@ static const VkExtensionProperties common_device_extensions[] = { .extensionName = VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME, .specVersion = 1, }, + { + .extensionName = VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME, + .specVersion = 1, + }, }; static VkResult @@ -2072,8 +2076,8 @@ VkResult radv_AllocateMemory( *pMem = VK_NULL_HANDLE; return VK_SUCCESS; } - const VkDedicatedAllocationMemoryAllocateInfoNV *dedicate_info = - vk_find_struct_const(pAllocateInfo->pNext, DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV); + const VkMemoryDedicatedAllocateInfoKHR *dedicate_info = + vk_find_struct_const(pAllocateInfo->pNext, MEMORY_DEDICATED_ALLOCATE_INFO_KHR); mem = vk_alloc2(&device->alloc, pAllocator, sizeof(*mem), 8, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); @@ -2217,6 +2221,20 @@ void radv_GetBufferMemoryRequirements2KHR( { radv_GetBufferMemoryRequirements(device, pInfo->buffer, &pMemoryRequirements->memoryRequirements); + + vk_foreach_struct(ext, pMemoryRequirements->pNext) { + switch (ext->sType) { + case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR: { + VkMemoryDedicatedRequirementsKHR *req = + (VkMemoryDedicatedRequirementsKHR *) ext; + req->requiresDedicatedAllocation = false; + req->prefersDedicatedAllocation = req->requiresDedicatedAllocation; + break; + } + default: + break; + } + } } void radv_GetImageMemoryRequirements( @@ -2239,6 +2257,20 @@ void radv_GetImageMemoryRequirements2KHR( { radv_GetImageMemoryRequirements(device, pInfo->image, &pMemoryRequirements->memoryRequirements); + + vk_foreach_struct(ext, pMemoryRequirements->pNext) { + switch (ext->sType) { + case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR: { + VkMemoryDedicatedRequirementsKHR *req = + (VkMemoryDedicatedRequirementsKHR *) ext; + req->requiresDedicatedAllocation = false; + req->prefersDedicatedAllocation = req->requiresDedicatedAllocation; + break; + } + default: + break; + } + } } void radv_GetImageSparseMemoryRequirements( diff --git a/src/amd/vulkan/radv_entrypoints_gen.py b/src/amd/vulkan/radv_entrypoints_gen.py index d47a7011197..d305a07e7d7 100644 --- a/src/amd/vulkan/radv_entrypoints_gen.py +++ b/src/amd/vulkan/radv_entrypoints_gen.py @@ -43,6 +43,7 @@ supported_extensions = [ 'VK_KHR_xcb_surface', 'VK_KHR_xlib_surface', 'VK_KHR_get_memory_requirements2', + 'VK_KHR_dedicated_allocation', ] # We generate a static hash table for entry point lookup |