diff options
Diffstat (limited to 'src/queue_context.cc')
| -rw-r--r-- | src/queue_context.cc | 12 |
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)); |
