mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-05-29 07:21:14 +02:00
Merge pull request #1422 from Penguin-Guru/master
Changed preset framerates; Add "low power" preset.
This commit is contained in:
commit
35a420d312
8 changed files with 50 additions and 12 deletions
|
@ -52,6 +52,20 @@ Item {
|
||||||
Layout.preferredWidth: parent.width
|
Layout.preferredWidth: parent.width
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
|
HifiControlsUit.RadioButton {
|
||||||
|
id: performanceLowPower
|
||||||
|
colorScheme: hifi.colorSchemes.dark
|
||||||
|
height: 18
|
||||||
|
fontSize: 16
|
||||||
|
leftPadding: 0
|
||||||
|
text: "Low Power"
|
||||||
|
checked: Performance.getPerformancePreset() === PerformanceEnums.LOW_POWER
|
||||||
|
onClicked: {
|
||||||
|
Performance.setPerformancePreset(PerformanceEnums.LOW_POWER);
|
||||||
|
root.refreshAllDropdowns();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
HifiControlsUit.RadioButton {
|
HifiControlsUit.RadioButton {
|
||||||
id: performanceLow
|
id: performanceLow
|
||||||
colorScheme: hifi.colorSchemes.dark
|
colorScheme: hifi.colorSchemes.dark
|
||||||
|
|
|
@ -174,6 +174,15 @@ Flickable {
|
||||||
Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin
|
Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin
|
||||||
spacing: simplifiedUI.margins.settings.spacingBetweenRadiobuttons
|
spacing: simplifiedUI.margins.settings.spacingBetweenRadiobuttons
|
||||||
|
|
||||||
|
SimplifiedControls.RadioButton {
|
||||||
|
id: performanceLow
|
||||||
|
text: "Low Power Quality" + (PlatformInfo.getTierProfiled() === PerformanceEnums.LOW_POWER ? " (Recommended)" : "")
|
||||||
|
checked: Performance.getPerformancePreset() === PerformanceEnums.LOW_POWER
|
||||||
|
onClicked: {
|
||||||
|
Performance.setPerformancePreset(PerformanceEnums.LOW_POWER);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SimplifiedControls.RadioButton {
|
SimplifiedControls.RadioButton {
|
||||||
id: performanceLow
|
id: performanceLow
|
||||||
text: "Low Quality" + (PlatformInfo.getTierProfiled() === PerformanceEnums.LOW ? " (Recommended)" : "")
|
text: "Low Quality" + (PlatformInfo.getTierProfiled() === PerformanceEnums.LOW ? " (Recommended)" : "")
|
||||||
|
|
|
@ -29,10 +29,11 @@ void PerformanceManager::setupPerformancePresetSettings(bool evaluatePlatformTie
|
||||||
|
|
||||||
// Here is the mapping between platformTier and performance profile
|
// Here is the mapping between platformTier and performance profile
|
||||||
const std::array<PerformanceManager::PerformancePreset, platform::Profiler::NumTiers> platformToPerformancePresetMap = { {
|
const std::array<PerformanceManager::PerformancePreset, platform::Profiler::NumTiers> platformToPerformancePresetMap = { {
|
||||||
PerformanceManager::PerformancePreset::MID, // platform::Profiler::UNKNOWN
|
PerformanceManager::PerformancePreset::MID, // platform::Profiler::UNKNOWN
|
||||||
PerformanceManager::PerformancePreset::LOW, // platform::Profiler::LOW
|
PerformanceManager::PerformancePreset::LOW_POWER, // platform::Profiler::LOW_POWER
|
||||||
PerformanceManager::PerformancePreset::MID, // platform::Profiler::MID
|
PerformanceManager::PerformancePreset::LOW, // platform::Profiler::LOW
|
||||||
PerformanceManager::PerformancePreset::HIGH // platform::Profiler::HIGH
|
PerformanceManager::PerformancePreset::MID, // platform::Profiler::MID
|
||||||
|
PerformanceManager::PerformancePreset::HIGH // platform::Profiler::HIGH
|
||||||
} };
|
} };
|
||||||
|
|
||||||
// What is our profile?
|
// What is our profile?
|
||||||
|
@ -71,7 +72,7 @@ void PerformanceManager::applyPerformancePreset(PerformanceManager::PerformanceP
|
||||||
|
|
||||||
// eval recommended PPI and Scale
|
// eval recommended PPI and Scale
|
||||||
float recommendedPpiScale = 1.0f;
|
float recommendedPpiScale = 1.0f;
|
||||||
const float RECOMMENDED_PPI[] = { 200.0f, 120.f, 160.f, 250.f};
|
const float RECOMMENDED_PPI[] = { 200.0f, 200.0f, 120.f, 160.f, 250.f};
|
||||||
if (!masterDisplay.empty() && masterDisplay.count(platform::keys::display::ppi)) {
|
if (!masterDisplay.empty() && masterDisplay.count(platform::keys::display::ppi)) {
|
||||||
float ppi = masterDisplay[platform::keys::display::ppi];
|
float ppi = masterDisplay[platform::keys::display::ppi];
|
||||||
// only scale if the actual ppi is higher than the recommended ppi
|
// only scale if the actual ppi is higher than the recommended ppi
|
||||||
|
@ -94,7 +95,7 @@ void PerformanceManager::applyPerformancePreset(PerformanceManager::PerformanceP
|
||||||
|
|
||||||
DependencyManager::get<LODManager>()->setWorldDetailQuality(WORLD_DETAIL_HIGH);
|
DependencyManager::get<LODManager>()->setWorldDetailQuality(WORLD_DETAIL_HIGH);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case PerformancePreset::MID:
|
case PerformancePreset::MID:
|
||||||
RenderScriptingInterface::getInstance()->setRenderMethod((isDeferredCapable ?
|
RenderScriptingInterface::getInstance()->setRenderMethod((isDeferredCapable ?
|
||||||
RenderScriptingInterface::RenderMethod::DEFERRED :
|
RenderScriptingInterface::RenderMethod::DEFERRED :
|
||||||
|
@ -103,11 +104,21 @@ void PerformanceManager::applyPerformancePreset(PerformanceManager::PerformanceP
|
||||||
RenderScriptingInterface::getInstance()->setViewportResolutionScale(recommendedPpiScale);
|
RenderScriptingInterface::getInstance()->setViewportResolutionScale(recommendedPpiScale);
|
||||||
|
|
||||||
RenderScriptingInterface::getInstance()->setShadowsEnabled(false);
|
RenderScriptingInterface::getInstance()->setShadowsEnabled(false);
|
||||||
qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::INTERACTIVE);
|
qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::REALTIME);
|
||||||
DependencyManager::get<LODManager>()->setWorldDetailQuality(WORLD_DETAIL_MEDIUM);
|
DependencyManager::get<LODManager>()->setWorldDetailQuality(WORLD_DETAIL_MEDIUM);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case PerformancePreset::LOW:
|
case PerformancePreset::LOW:
|
||||||
|
RenderScriptingInterface::getInstance()->setRenderMethod(RenderScriptingInterface::RenderMethod::FORWARD);
|
||||||
|
RenderScriptingInterface::getInstance()->setShadowsEnabled(false);
|
||||||
|
qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::REALTIME);
|
||||||
|
|
||||||
|
RenderScriptingInterface::getInstance()->setViewportResolutionScale(recommendedPpiScale);
|
||||||
|
|
||||||
|
DependencyManager::get<LODManager>()->setWorldDetailQuality(WORLD_DETAIL_LOW);
|
||||||
|
|
||||||
|
break;
|
||||||
|
case PerformancePreset::LOW_POWER:
|
||||||
RenderScriptingInterface::getInstance()->setRenderMethod(RenderScriptingInterface::RenderMethod::FORWARD);
|
RenderScriptingInterface::getInstance()->setRenderMethod(RenderScriptingInterface::RenderMethod::FORWARD);
|
||||||
RenderScriptingInterface::getInstance()->setShadowsEnabled(false);
|
RenderScriptingInterface::getInstance()->setShadowsEnabled(false);
|
||||||
qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::ECO);
|
qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::ECO);
|
||||||
|
@ -116,10 +127,11 @@ void PerformanceManager::applyPerformancePreset(PerformanceManager::PerformanceP
|
||||||
|
|
||||||
DependencyManager::get<LODManager>()->setWorldDetailQuality(WORLD_DETAIL_LOW);
|
DependencyManager::get<LODManager>()->setWorldDetailQuality(WORLD_DETAIL_LOW);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case PerformancePreset::UNKNOWN:
|
case PerformancePreset::UNKNOWN:
|
||||||
|
// Intentionally unbroken.
|
||||||
default:
|
default:
|
||||||
// Do nothing anymore
|
// Do nothing.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ class PerformanceManager {
|
||||||
public:
|
public:
|
||||||
enum PerformancePreset {
|
enum PerformancePreset {
|
||||||
UNKNOWN = 0, // Matching the platform Tier profiles enumeration for coherence
|
UNKNOWN = 0, // Matching the platform Tier profiles enumeration for coherence
|
||||||
|
LOW_POWER,
|
||||||
LOW,
|
LOW,
|
||||||
MID,
|
MID,
|
||||||
HIGH,
|
HIGH,
|
||||||
|
|
|
@ -29,7 +29,7 @@ PerformanceScriptingInterface::PerformancePreset PerformanceScriptingInterface::
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList PerformanceScriptingInterface::getPerformancePresetNames() const {
|
QStringList PerformanceScriptingInterface::getPerformancePresetNames() const {
|
||||||
static const QStringList performancePresetNames = { "UNKNOWN", "LOW", "MID", "HIGH" };
|
static const QStringList performancePresetNames = { "UNKNOWN", "LOW_POWER", "LOW", "MID", "HIGH" };
|
||||||
return performancePresetNames;
|
return performancePresetNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,7 @@ public:
|
||||||
// PerformanceManager PerformancePreset tri state level enums
|
// PerformanceManager PerformancePreset tri state level enums
|
||||||
enum PerformancePreset {
|
enum PerformancePreset {
|
||||||
UNKNOWN = PerformanceManager::PerformancePreset::UNKNOWN,
|
UNKNOWN = PerformanceManager::PerformancePreset::UNKNOWN,
|
||||||
|
LOW_POWER = PerformanceManager::PerformancePreset::LOW_POWER,
|
||||||
LOW = PerformanceManager::PerformancePreset::LOW,
|
LOW = PerformanceManager::PerformancePreset::LOW,
|
||||||
MID = PerformanceManager::PerformancePreset::MID,
|
MID = PerformanceManager::PerformancePreset::MID,
|
||||||
HIGH = PerformanceManager::PerformancePreset::HIGH,
|
HIGH = PerformanceManager::PerformancePreset::HIGH,
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
using namespace platform;
|
using namespace platform;
|
||||||
|
|
||||||
const std::array<const char*, Profiler::Tier::NumTiers> Profiler::TierNames = {{ "UNKNOWN", "LOW", "MID", "HIGH" }};
|
const std::array<const char*, Profiler::Tier::NumTiers> Profiler::TierNames = {{ "UNKNOWN", "LOW_POWER", "LOW", "MID", "HIGH" }};
|
||||||
|
|
||||||
|
|
||||||
bool filterOnComputer(const platform::json& computer, Profiler::Tier& tier);
|
bool filterOnComputer(const platform::json& computer, Profiler::Tier& tier);
|
||||||
|
|
|
@ -19,6 +19,7 @@ class Profiler {
|
||||||
public:
|
public:
|
||||||
enum Tier {
|
enum Tier {
|
||||||
UNKNOWN = 0,
|
UNKNOWN = 0,
|
||||||
|
LOW_POWER,
|
||||||
LOW,
|
LOW,
|
||||||
MID,
|
MID,
|
||||||
HIGH,
|
HIGH,
|
||||||
|
|
Loading…
Reference in a new issue