summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/amd/vulkan/radv_device.c7
-rw-r--r--src/amd/vulkan/radv_private.h2
2 files changed, 7 insertions, 2 deletions
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 0c2f6fa6312..fce0bff8491 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -2255,13 +2255,13 @@ void radv_GetBufferMemoryRequirements2KHR(
{
radv_GetBufferMemoryRequirements(device, pInfo->buffer,
&pMemoryRequirements->memoryRequirements);
-
+ RADV_FROM_HANDLE(radv_buffer, buffer, pInfo->buffer);
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->requiresDedicatedAllocation = buffer->shareable;
req->prefersDedicatedAllocation = req->requiresDedicatedAllocation;
break;
}
@@ -2775,6 +2775,9 @@ VkResult radv_CreateBuffer(
buffer->offset = 0;
buffer->flags = pCreateInfo->flags;
+ buffer->shareable = vk_find_struct_const(pCreateInfo->pNext,
+ EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR) != NULL;
+
if (pCreateInfo->flags & VK_BUFFER_CREATE_SPARSE_BINDING_BIT) {
buffer->bo = device->ws->buffer_create(device->ws,
align64(buffer->size, 4096),
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index 1b1fa93ee3c..8d96bb43236 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -673,6 +673,8 @@ struct radv_buffer {
/* Set when bound */
struct radeon_winsys_bo * bo;
VkDeviceSize offset;
+
+ bool shareable;
};