From f6481effc853a1a0749ec0860f06c508788d7e1b Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Mon, 5 Mar 2018 13:34:45 -0800 Subject: Enable VK_KHR_swapchain for instances. This is a specific instance of a general capability. Beginning with Vulkan 1.1, physical-device commands can part of device extensions, and can be called before the application creates a device. vkGetInstanceProcAddr only returns commands for enabled extensions, and so we must internally enable device extensions inside of the instance. This commit enables VK_KHR_swapchain so that GIPA will return vkGetPhysicalDevicePresentRectanglesKHR. Bug: b/71744435 Test: Modified LunarG cube demo that can successfully GIPA the command. Change-Id: Iefb9f82d3f21e110d45f7d6aae7c8c9ea3af20b9 (cherry picked from commit d3d887ab4640fd948834651b8e82782955f53941) --- vulkan/libvulkan/driver.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'vulkan/libvulkan/driver.cpp') diff --git a/vulkan/libvulkan/driver.cpp b/vulkan/libvulkan/driver.cpp index a9d473dcb1..dec39e0b0f 100644 --- a/vulkan/libvulkan/driver.cpp +++ b/vulkan/libvulkan/driver.cpp @@ -407,6 +407,12 @@ VkResult CreateInfoWrapper::SanitizeExtensions() { for (uint32_t i = 0; i < ext_count; i++) FilterExtension(ext_names[i]); + // Enable device extensions that contain physical-device commands, so that + // vkGetInstanceProcAddr will return those physical-device commands. + if (is_instance_) { + hook_extensions_.set(ProcHook::KHR_swapchain); + } + ext_names = extension_filter_.names; ext_count = extension_filter_.name_count; -- cgit v1.2.3-59-g8ed1b