aboutsummaryrefslogtreecommitdiff
path: root/src/queue_context.cc
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/queue_context.cc
parent50f009b81218c5367031ce9c51089ecddc2e853a (diff)
Don't advertise anti lag if the PD doesn't support it
Diffstat (limited to 'src/queue_context.cc')
-rw-r--r--src/queue_context.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/queue_context.cc b/src/queue_context.cc
index 1f798de..2096df3 100644
--- a/src/queue_context.cc
+++ b/src/queue_context.cc
@@ -33,11 +33,13 @@ QueueContext::QueueContext(DeviceContext& device_context, const VkQueue& queue,
return command_pool;
}();
- this->timestamp_pool = std::make_unique<TimestampPool>(*this);
+ // Only construct a timestamp pool if we support it!
+ if (device_context.physical_device.supports_required_extensions) {
+ this->timestamp_pool = std::make_unique<TimestampPool>(*this);
+ }
}
QueueContext::~QueueContext() {
-
this->in_flight_frames.clear();
this->submissions.clear();
this->timestamp_pool.reset();
@@ -182,7 +184,7 @@ void QueueContext::drain_frames_to_timings() {
// Only need to calibrate this device, we don't support multi device anti
// lag.
- this->device_context.clock.calibrate();
+ this->device_context.clock->calibrate();
while (std::size(this->in_flight_frames)) {
const auto& frame = this->in_flight_frames.front();
@@ -378,6 +380,10 @@ void QueueContext::sleep_in_present() {
bool QueueContext::should_inject_timestamps() const {
const auto& pd = this->device_context.physical_device;
+ if (!pd.supports_required_extensions) {
+ return false;
+ }
+
assert(pd.queue_properties);
const auto& queue_props = *pd.queue_properties;
assert(this->queue_family_index < std::size(queue_props));