From 6d7f04e5de66a6463464dd7843db16fe8dc3c6aa Mon Sep 17 00:00:00 2001 From: Igor Torrente Date: Fri, 11 Feb 2022 07:25:43 -0300 Subject: [PATCH] venus: add VK_EXT_calibrated_timestamps extension Implements all the necessary code in the device initialization and extension functions. Signed-off-by: Igor Torrente Part-of: --- src/virtio/vulkan/vn_device.c | 15 +++++++++++++++ src/virtio/vulkan/vn_physical_device.c | 14 ++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/src/virtio/vulkan/vn_device.c b/src/virtio/vulkan/vn_device.c index 6c41ee97a03..14cc2efe9ad 100644 --- a/src/virtio/vulkan/vn_device.c +++ b/src/virtio/vulkan/vn_device.c @@ -432,3 +432,18 @@ vn_DeviceWaitIdle(VkDevice device) return VK_SUCCESS; } + +VkResult +vn_GetCalibratedTimestampsEXT( + VkDevice device, + uint32_t timestampCount, + const VkCalibratedTimestampInfoEXT *pTimestampInfos, + uint64_t *pTimestamps, + uint64_t *pMaxDeviation) +{ + struct vn_device *dev = vn_device_from_handle(device); + + return vn_call_vkGetCalibratedTimestampsEXT( + dev->instance, device, timestampCount, pTimestampInfos, pTimestamps, + pMaxDeviation); +} diff --git a/src/virtio/vulkan/vn_physical_device.c b/src/virtio/vulkan/vn_physical_device.c index 8d786db66b5..b396d668e99 100644 --- a/src/virtio/vulkan/vn_physical_device.c +++ b/src/virtio/vulkan/vn_physical_device.c @@ -944,6 +944,7 @@ vn_physical_device_get_passthrough_extensions( .EXT_shader_demote_to_helper_invocation = true, /* EXT */ + .EXT_calibrated_timestamps = true, .EXT_conservative_rasterization = true, .EXT_custom_border_color = true, .EXT_depth_clip_enable = true, @@ -2551,3 +2552,16 @@ vn_GetPhysicalDeviceExternalSemaphoreProperties( pExternalSemaphoreProperties->externalSemaphoreFeatures = 0; } } + +VkResult +vn_GetPhysicalDeviceCalibrateableTimeDomainsEXT( + VkPhysicalDevice physicalDevice, + uint32_t *pTimeDomainCount, + VkTimeDomainEXT *pTimeDomains) +{ + struct vn_physical_device *physical_dev = + vn_physical_device_from_handle(physicalDevice); + + return vn_call_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT( + physical_dev->instance, physicalDevice, pTimeDomainCount, pTimeDomains); +}