diff options
| author | 2017-01-19 09:05:58 -0700 | |
|---|---|---|
| committer | 2017-01-19 09:05:58 -0700 | |
| commit | 8a977261a012b0b02c062ac4a5a133f79ef74b62 (patch) | |
| tree | 01b9602e4940c091676c8aca7703c508b9033ab3 /vulkan/libvulkan/driver.cpp | |
| parent | cd89857b19da616e9a98eed755b8218e74df2c1a (diff) | |
Enumerate initial version of VK_GOOGLE_display_timing
The implementation seems correct with the exception that it is not obtaining
the refresh durations from SurfaceFlinger/HAL. A maximum of 10 TimingInfo's
(containing the timing for previous presents) are stored, and timestamps are
only queried from SurfaceFlinger for presents (a.k.a. frames) that occured 5
presents/frames ago.
Test: Manually tested with a modified cube demo, that changes its timing as a
result of the data returned from this extension.
Change-Id: I199614ed58877b64eab2568a76ba517acca3bf87
Diffstat (limited to 'vulkan/libvulkan/driver.cpp')
| -rw-r--r-- | vulkan/libvulkan/driver.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/vulkan/libvulkan/driver.cpp b/vulkan/libvulkan/driver.cpp index 800e474e8a..6c9a449d9c 100644 --- a/vulkan/libvulkan/driver.cpp +++ b/vulkan/libvulkan/driver.cpp @@ -405,6 +405,10 @@ void CreateInfoWrapper::FilterExtension(const char* name) { name = VK_ANDROID_NATIVE_BUFFER_EXTENSION_NAME; ext_bit = ProcHook::ANDROID_native_buffer; break; + case ProcHook::GOOGLE_display_timing: + hook_extensions_.set(ext_bit); + // return now as these extensions do not require HAL support + return; case ProcHook::EXTENSION_UNKNOWN: // HAL's extensions break; @@ -663,10 +667,12 @@ VkResult EnumerateDeviceExtensionProperties( uint32_t* pPropertyCount, VkExtensionProperties* pProperties) { const InstanceData& data = GetData(physicalDevice); - static const std::array<VkExtensionProperties, 1> loader_extensions = {{ + static const std::array<VkExtensionProperties, 2> loader_extensions = {{ // WSI extensions {VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME, VK_KHR_INCREMENTAL_PRESENT_SPEC_VERSION}, + {VK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAME, + VK_GOOGLE_DISPLAY_TIMING_SPEC_VERSION}, }}; // enumerate our extensions first |