aboutsummaryrefslogtreecommitdiff
path: root/src/physical_device_context.hh
diff options
context:
space:
mode:
authorNicolas James <nj3ahxac@gmail.com>2026-03-10 22:41:39 +1100
committerNicolas James <nj3ahxac@gmail.com>2026-03-10 22:41:39 +1100
commitf10074d9897850b9b746ff8d8e0b2dc4af24f3ff (patch)
tree4609d86b8222115c3e3d19824748861cbec78e20 /src/physical_device_context.hh
parent50f009b81218c5367031ce9c51089ecddc2e853a (diff)
Don't advertise anti lag if the PD doesn't support it
Diffstat (limited to 'src/physical_device_context.hh')
-rw-r--r--src/physical_device_context.hh17
1 files changed, 15 insertions, 2 deletions
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
@@ -11,15 +11,28 @@ 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<const VkPhysicalDeviceProperties> properties;
-
+
using queue_properties_t = std::vector<VkQueueFamilyProperties2>;
std::unique_ptr<const queue_properties_t> 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);