Commit d98afb78 by Mohan Maiya Committed by Commit Bot

Vulkan: Enable VK_KHR_get_memory_requirements2 extension

1. Don't assume support for VK_KHR_get_memory_requirements2. Enable the extension, if supported, during device creation. 2. Also let VMA fill in the function pointers for these commands based on Vulkan API version - 1. vkGetBufferMemoryRequirements2KHR 2. vkGetImageMemoryRequirements2KHR Bug: angleproject:4830 Change-Id: Icd0b3baf56732b5f5f49f320c1feb996204169ed Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2293633Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
parent 66d85686
...@@ -1090,6 +1090,12 @@ angle::Result RendererVk::initializeDevice(DisplayVk *displayVk, uint32_t queueF ...@@ -1090,6 +1090,12 @@ angle::Result RendererVk::initializeDevice(DisplayVk *displayVk, uint32_t queueF
// Initialize features and workarounds. // Initialize features and workarounds.
initFeatures(displayVk, deviceExtensionNames); initFeatures(displayVk, deviceExtensionNames);
// Enable VK_KHR_get_memory_requirements2, if supported
if (ExtensionFound(VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME, deviceExtensionNames))
{
enabledDeviceExtensions.push_back(VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME);
}
// Selectively enable KHR_MAINTENANCE1 to support viewport flipping. // Selectively enable KHR_MAINTENANCE1 to support viewport flipping.
if ((getFeatures().flipViewportY.enabled) && if ((getFeatures().flipViewportY.enabled) &&
(mPhysicalDeviceProperties.apiVersion < VK_MAKE_VERSION(1, 1, 0))) (mPhysicalDeviceProperties.apiVersion < VK_MAKE_VERSION(1, 1, 0)))
......
...@@ -37,17 +37,6 @@ VkResult InitAllocator(VkPhysicalDevice physicalDevice, ...@@ -37,17 +37,6 @@ VkResult InitAllocator(VkPhysicalDevice physicalDevice,
funcs.vkCreateImage = vkCreateImage; funcs.vkCreateImage = vkCreateImage;
funcs.vkDestroyImage = vkDestroyImage; funcs.vkDestroyImage = vkDestroyImage;
funcs.vkCmdCopyBuffer = vkCmdCopyBuffer; funcs.vkCmdCopyBuffer = vkCmdCopyBuffer;
{
#if !defined(ANGLE_SHARED_LIBVULKAN)
// When the vulkan-loader is statically linked, we need to use the extension
// functions defined in ANGLE's rx namespace. When it's dynamically linked
// with volk, this will default to the function definitions with no namespace
using rx::vkGetBufferMemoryRequirements2KHR;
using rx::vkGetImageMemoryRequirements2KHR;
#endif // !defined(ANGLE_SHARED_LIBVULKAN)
funcs.vkGetBufferMemoryRequirements2KHR = vkGetBufferMemoryRequirements2KHR;
funcs.vkGetImageMemoryRequirements2KHR = vkGetImageMemoryRequirements2KHR;
}
VmaAllocatorCreateInfo allocatorInfo = {}; VmaAllocatorCreateInfo allocatorInfo = {};
allocatorInfo.physicalDevice = physicalDevice; allocatorInfo.physicalDevice = physicalDevice;
......
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