From f10074d9897850b9b746ff8d8e0b2dc4af24f3ff Mon Sep 17 00:00:00 2001 From: Nicolas James Date: Tue, 10 Mar 2026 22:41:39 +1100 Subject: Don't advertise anti lag if the PD doesn't support it --- src/physical_device_context.hh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/physical_device_context.hh') diff --git a/src/physical_device_context.hh b/src/physical_device_context.hh index 291946f..9624faa 100644 --- a/src/physical_device_context.hh +++ b/src/physical_device_context.hh @@ -10,16 +10,29 @@ namespace low_latency { class PhysicalDeviceContext final : public Context { + public: + // The extensions we need for our layer to function. + // If the PD doesn't support this then the layer shouldn't set the anti lag + // flag in VkGetPhysicalDevices2 (check this->supports_required_extensions). + static constexpr auto required_extensions = { + VK_KHR_SYNCHRONIZATION_2_EXTENSION_NAME, + VK_KHR_CALIBRATED_TIMESTAMPS_EXTENSION_NAME, + VK_EXT_HOST_QUERY_RESET_EXTENSION_NAME}; + public: InstanceContext& instance; const VkPhysicalDevice physical_device; - + std::unique_ptr properties; - + using queue_properties_t = std::vector; std::unique_ptr queue_properties; + // Will be set to true in the constructor if the physical device supports + // everything we need to track gpu timing data. + bool supports_required_extensions = false; + public: PhysicalDeviceContext(InstanceContext& instance_context, const VkPhysicalDevice& physical_device); -- cgit v1.2.3