diff options
author | 2024-06-14 18:26:58 +0000 | |
---|---|---|
committer | 2024-08-15 12:30:16 +0000 | |
commit | ea32184c013e10610a74c9d2a1727ea77ac1bada (patch) | |
tree | f06438ec916de9f06bc868e048247a52ffd781a3 /vulkan/libvulkan/driver.cpp | |
parent | cb0f460a55de131d12c14199a0e3cf1ada8ce7e4 (diff) |
Implement the VK_KHR_swapchain_mutable_format device extension in the vulkan loader
Add an implementation for the VK_KHR_swapchain_mutable_format extension.
Test: Stepped through changes in debugger
Test: Ran sample app with VVL which used the extension
Test: Ran dEQP-VK.image.swapchain_mutable.android.* dEQP tests
Flag: com.android.graphics.libvulkan.flags.swapchain_mutable_format_ext
Bug: 341978292
Change-Id: Ib0e5b9f750cd5a94ab65419542898db207716fcc
Diffstat (limited to 'vulkan/libvulkan/driver.cpp')
-rw-r--r-- | vulkan/libvulkan/driver.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/vulkan/libvulkan/driver.cpp b/vulkan/libvulkan/driver.cpp index ef213f0c7a..01436db4ae 100644 --- a/vulkan/libvulkan/driver.cpp +++ b/vulkan/libvulkan/driver.cpp @@ -41,10 +41,12 @@ #include <new> #include <vector> +#include <com_android_graphics_libvulkan_flags.h> #include "stubhal.h" using namespace android::hardware::configstore; using namespace android::hardware::configstore::V1_0; +using namespace com::android::graphics::libvulkan; extern "C" android_namespace_t* android_get_exported_namespace(const char*); @@ -688,6 +690,7 @@ void CreateInfoWrapper::FilterExtension(const char* name) { case ProcHook::KHR_incremental_present: case ProcHook::KHR_shared_presentable_image: case ProcHook::KHR_swapchain: + case ProcHook::KHR_swapchain_mutable_format: case ProcHook::EXT_hdr_metadata: case ProcHook::EXT_swapchain_maintenance1: case ProcHook::ANDROID_external_memory_android_hardware_buffer: @@ -740,6 +743,7 @@ void CreateInfoWrapper::FilterExtension(const char* name) { break; case ProcHook::ANDROID_external_memory_android_hardware_buffer: case ProcHook::KHR_external_fence_fd: + case ProcHook::KHR_swapchain_mutable_format: case ProcHook::EXTENSION_UNKNOWN: // Extensions we don't need to do anything about at this level break; @@ -1251,6 +1255,15 @@ VkResult EnumerateDeviceExtensionProperties( VK_EXT_SWAPCHAIN_MAINTENANCE_1_SPEC_VERSION}); } + VkPhysicalDeviceProperties pDeviceProperties; + data.driver.GetPhysicalDeviceProperties(physicalDevice, &pDeviceProperties); + if (flags::swapchain_mutable_format_ext() && + pDeviceProperties.apiVersion >= VK_API_VERSION_1_2) { + loader_extensions.push_back( + {VK_KHR_SWAPCHAIN_MUTABLE_FORMAT_EXTENSION_NAME, + VK_KHR_SWAPCHAIN_MUTABLE_FORMAT_SPEC_VERSION}); + } + // enumerate our extensions first if (!pLayerName && pProperties) { uint32_t count = std::min( |