User configurable power level

This commit is contained in:
Patrick Nicolas
2025-11-06 10:54:30 +01:00
parent 7b23715310
commit 6656547e6b
4 changed files with 25 additions and 2 deletions
+9
View File
@@ -667,6 +667,15 @@ void scenes::lobby::gui_settings()
}
}
if (instance.has_extension(XR_EXT_PERFORMANCE_SETTINGS_EXTENSION_NAME))
{
if (ImGui::Checkbox(_S("High power mode"), &config.high_power_mode))
config.save();
if (ImGui::IsItemHovered())
imgui_ctx->tooltip(_("Increase power usage to allow higher resolution and refresh rate"));
imgui_ctx->vibrate_on_hover();
}
{
bool enabled = config.check_feature(feature::microphone);
if (ImGui::Checkbox(_S("Enable microphone"), &enabled))
+10 -2
View File
@@ -493,8 +493,16 @@ void scenes::stream::on_focused()
video_stream_description->defoveated_width / view_count,
video_stream_description->defoveated_height);
session.set_performance_level(XR_PERF_SETTINGS_DOMAIN_CPU_EXT, XR_PERF_SETTINGS_LEVEL_POWER_SAVINGS_EXT);
session.set_performance_level(XR_PERF_SETTINGS_DOMAIN_GPU_EXT, XR_PERF_SETTINGS_LEVEL_POWER_SAVINGS_EXT);
if (application::get_config().high_power_mode)
{
session.set_performance_level(XR_PERF_SETTINGS_DOMAIN_CPU_EXT, XR_PERF_SETTINGS_LEVEL_SUSTAINED_HIGH_EXT);
session.set_performance_level(XR_PERF_SETTINGS_DOMAIN_GPU_EXT, XR_PERF_SETTINGS_LEVEL_SUSTAINED_HIGH_EXT);
}
else
{
session.set_performance_level(XR_PERF_SETTINGS_DOMAIN_CPU_EXT, XR_PERF_SETTINGS_LEVEL_POWER_SAVINGS_EXT);
session.set_performance_level(XR_PERF_SETTINGS_DOMAIN_GPU_EXT, XR_PERF_SETTINGS_LEVEL_POWER_SAVINGS_EXT);
}
}
void scenes::stream::on_unfocused()