From 22f8e5196508c7075493c246edb9cb9cad097c45 Mon Sep 17 00:00:00 2001 From: Nicolas James Date: Mon, 30 Mar 2026 16:26:51 +1100 Subject: Force 'capability' to query anti_lag or low_latency2 based on EXPOSE_REFLEX env var --- src/device_context.cc | 4 ++-- src/layer.cc | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/device_context.cc b/src/device_context.cc index e2f2a4a..c9f1fd5 100644 --- a/src/device_context.cc +++ b/src/device_context.cc @@ -14,8 +14,8 @@ DeviceContext::DeviceContext(InstanceContext& parent_instance, was_capability_requested(was_capability_requested), device(device), vtable(std::move(vtable)) { - // Only create our clock if we can support creating it. - if (this->physical_device.supports_required_extensions) { + // Only create our clock if we were asked to do anything. + if (this->was_capability_requested) { this->clock = std::make_unique(*this); } } diff --git a/src/layer.cc b/src/layer.cc index 813c267..3f31979 100644 --- a/src/layer.cc +++ b/src/layer.cc @@ -155,11 +155,12 @@ static VKAPI_ATTR VkResult VKAPI_CALL CreateDevice( std::from_range, enabled_extensions); const auto was_capability_requested = - requested.contains(VK_AMD_ANTI_LAG_EXTENSION_NAME) || - requested.contains(VK_NV_LOW_LATENCY_2_EXTENSION_NAME); + requested.contains(!layer_context.should_expose_reflex + ? VK_AMD_ANTI_LAG_EXTENSION_NAME + : VK_NV_LOW_LATENCY_2_EXTENSION_NAME); const auto context = layer_context.get_context(physical_device); - if (!context->supports_required_extensions && was_capability_requested) { + if (was_capability_requested && !context->supports_required_extensions) { return VK_ERROR_INITIALIZATION_FAILED; } @@ -180,8 +181,7 @@ static VKAPI_ATTR VkResult VKAPI_CALL CreateDevice( const auto next_extensions = [&]() -> std::vector { auto next_extensions = std::vector(std::from_range, enabled_extensions); - // Don't append anything extra if we don't support what we need. - if (!context->supports_required_extensions) { + if (!was_capability_requested) { return next_extensions; } -- cgit v1.2.3