Commit 64b2ef97 by Michael Spang Committed by Nicolas Capens

Silence warnings on dedicated external memory allocations

The VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO extension structure is safe to ignore for Linux and Fuchsia. We already ignored it for private allocations (see vkAllocateMemory). Some drivers can do a better job of allocating if they know that a VkDeviceMemory will contain exactly one object with known properties. This is the case for NVIDIA, but not SwiftShader. For external memory, on some platforms (including Android) the shareable object isn't just a flat blob of memory, it carries format/dimensions etc. The AHardwareBufferExternalMemory implementation in VkDeviceMemoryExternalAndroid.hpp obtains the image/buffer from the VkMemoryDedicatedAllocateInfo structure to pass it to gralloc. External memory on Linux and Fuchsia are just flat memory allocations, so on these platforms we can ignore the dedicated allocation info. Bug: b/156200449 Change-Id: Ia7838bb8a39aac2a1908f314d146ad11f1be79d2 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/45048 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAntonio Maiorano <amaiorano@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com>
parent 62d75bd4
......@@ -66,6 +66,11 @@ public:
exportHandle = true;
break;
}
case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO:
// This can safely be ignored, as the Vulkan spec mentions:
// "If the pNext chain includes a VkMemoryDedicatedAllocateInfo structure, then that structure
// includes a handle of the sole buffer or image resource that the memory *can* be bound to."
break;
default:
WARN("VkMemoryAllocateInfo->pNext sType = %s", vk::Stringify(extInfo->sType).c_str());
......
......@@ -66,6 +66,11 @@ public:
exportFd = true;
}
break;
case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO:
// This can safely be ignored, as the Vulkan spec mentions:
// "If the pNext chain includes a VkMemoryDedicatedAllocateInfo structure, then that structure
// includes a handle of the sole buffer or image resource that the memory *can* be bound to."
break;
default:
WARN("VkMemoryAllocateInfo->pNext sType = %s", vk::Stringify(createInfo->sType).c_str());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment