diff options
| author | Nicolas James <nj3ahxac@gmail.com> | 2026-03-10 22:41:39 +1100 |
|---|---|---|
| committer | Nicolas James <nj3ahxac@gmail.com> | 2026-03-10 22:41:39 +1100 |
| commit | f10074d9897850b9b746ff8d8e0b2dc4af24f3ff (patch) | |
| tree | 4609d86b8222115c3e3d19824748861cbec78e20 /src/device_context.cc | |
| parent | 50f009b81218c5367031ce9c51089ecddc2e853a (diff) | |
Don't advertise anti lag if the PD doesn't support it
Diffstat (limited to 'src/device_context.cc')
| -rw-r--r-- | src/device_context.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/device_context.cc b/src/device_context.cc index b149311..49b7808 100644 --- a/src/device_context.cc +++ b/src/device_context.cc @@ -11,7 +11,13 @@ DeviceContext::DeviceContext(InstanceContext& parent_instance, const VkDevice& device, VkuDeviceDispatchTable&& vtable) : instance(parent_instance), physical_device(parent_physical_device), - device(device), vtable(std::move(vtable)), clock(*this) {} + device(device), vtable(std::move(vtable)) { + + // Only create our clock if we can support creating it. + if (this->physical_device.supports_required_extensions) { + this->clock = std::make_unique<Clock>(*this); + } +} DeviceContext::~DeviceContext() { this->present_queue.reset(); @@ -102,7 +108,7 @@ void DeviceContext::sleep_in_input() { // stall until it's finished. const auto& last_frame = frames.back(); assert(std::size(last_frame.submissions)); - const auto& last_frame_submission = frames.back().submissions.back(); + const auto& last_frame_submission = last_frame.submissions.back(); last_frame_submission->end_handle->get_time_spinlock(); // From our sleep in present implementation, just spinning until @@ -123,9 +129,8 @@ void DeviceContext::notify_antilag_update(const VkAntiLagDataAMD& data) { return; } - const auto& presentation_info = *data.pPresentationInfo; // Only care about the input stage for now. - if (presentation_info.stage != VK_ANTI_LAG_STAGE_INPUT_AMD) { + if (data.pPresentationInfo->stage != VK_ANTI_LAG_STAGE_INPUT_AMD) { return; } |
