aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas James <Eele1Ephe7uZahRie@tutanota.com>2026-03-30 16:26:51 +1100
committerNicolas James <Eele1Ephe7uZahRie@tutanota.com>2026-03-30 16:26:51 +1100
commit22f8e5196508c7075493c246edb9cb9cad097c45 (patch)
tree4ddf1ca58b5cd8414d7378d5146b54a21f6ae60d
parent644bc4ed5edd4e3ffa88750bdacb147c75df9546 (diff)
Force 'capability' to query anti_lag or low_latency2 based on EXPOSE_REFLEX env var
-rw-r--r--src/device_context.cc4
-rw-r--r--src/layer.cc10
2 files changed, 7 insertions, 7 deletions
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<DeviceClock>(*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<const char*> {
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;
}