@@ -7025,6 +7025,12 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryHostPointerPropertiesEXT(
VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties);
#endif
+typedef VkResult (VKAPI_PTR *PFN_vkQueryCurrentTimestampMESA)(VkDevice device, uint64_t *timestamp);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkQueryCurrentTimestampMESA(
+ VkDevice _device,
+ uint64_t *timestamp);
+
#ifdef __cplusplus
}
#endif
@@ -68,6 +68,7 @@ endif
EXTRA_DIST += vulkan/registry/vk.xml
EXTRA_DIST += vulkan/registry/vk_android_native_buffer.xml
+EXTRA_DIST += vulkan/registry/vk_mesa_query_timestamp.xml
if HAVE_AMD_DRIVERS
SUBDIRS += amd
@@ -20,6 +20,7 @@
vk_api_xml = files('registry/vk.xml')
vk_android_native_buffer_xml = files('registry/vk_android_native_buffer.xml')
+vk_mesa_query_timestamp_xml = files('registry/vk_mesa_query_timestamp.xml')
inc_vulkan_util = include_directories('util')
inc_vulkan_wsi = include_directories('wsi')
new file mode 100644
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<registry>
+ <commands>
+ <command>
+ <proto><type>VkResult</type> <name>vkQueryCurrentTimestampMESA</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>uint64_t</type>* <name>pTimestamp</name></param>
+ </command>
+ </commands>
+ <extensions>
+ <extension name="VK_MESA_query_timestamp" number="200"
+ type="device" author="MESA"
+ contact="Keith Packard @keithp"
+ supported="vulkan">
+ <require>
+ <enum value="1" name="VK_MESA_QUERY_TIMESTAMP_SPEC_VERSION"/>
+ <enum value=""VK_MESA_query_timestamp"" name="VK_MESA_QUERY_TIMESTAMP_NAME"/>
+ <command name="vkQueryCurrentTimestampMESA"/>
+ </require>
+ </extension>
+ </extensions>
+</registry>
This extension adds a single function to query the current GPU timestamp, just like glGetInteger64v(GL_TIMESTAMP, ×tamp). This function is needed to complete the implementation of GOOGLE_display_timing, which needs to be able to coorelate GPU and CPU timestamps. Signed-off-by: Keith Packard <keithp@keithp.com> --- include/vulkan/vulkan.h | 6 ++++++ src/Makefile.am | 1 + src/vulkan/meson.build | 1 + src/vulkan/registry/vk_mesa_query_timestamp.xml | 22 ++++++++++++++++++++++ 4 files changed, 30 insertions(+) create mode 100644 src/vulkan/registry/vk_mesa_query_timestamp.xml