venus: add VK_EXT_calibrated_timestamps extension
authorIgor Torrente <igor.torrente@collabora.com>
Fri, 11 Feb 2022 10:25:43 +0000 (07:25 -0300)
committerMarge Bot <emma+marge@anholt.net>
Thu, 17 Mar 2022 00:02:21 +0000 (00:02 +0000)
Implements all the necessary code in the device initialization
and extension functions.

Signed-off-by: Igor Torrente <igor.torrente@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15389>

src/virtio/vulkan/vn_device.c
src/virtio/vulkan/vn_physical_device.c

index 6c41ee9..14cc2ef 100644 (file)
@@ -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);
+}
index 8d786db..b396d66 100644 (file)
@@ -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);
+}