Ssbugs, removal of re-vive, and dashboard loop tick (#277)

* minor changes

* debugging testing

* removed un-needed log calls

* moved some logic to run only when dashboard is active

* fixed linker error

* added casting

* removed revive tab

* removed stray revive reference

* removed revive from sources

* fixed misc formatting issues

* added newline
This commit is contained in:
ykeara
2019-08-22 13:40:48 -05:00
committed by GitHub
parent 1b5e092cc2
commit 746aa23207
18 changed files with 108 additions and 2834 deletions
+84 -91
View File
@@ -9,7 +9,7 @@ void SteamVRTabController::initStage1()
{
initMotionSmoothing();
initSupersampleOverride();
eventLoopTick();
dashboardLoopTick();
reloadSteamVRProfiles();
}
@@ -18,105 +18,98 @@ void SteamVRTabController::initStage2( OverlayController* var_parent )
this->parent = var_parent;
}
void SteamVRTabController::eventLoopTick()
void SteamVRTabController::dashboardLoopTick()
{
if ( settingsUpdateCounter >= k_steamVrSettingsUpdateCounter )
{
if ( parent->isDashboardVisible() )
vr::EVRSettingsError vrSettingsError;
// checks supersampling override and resynchs if necessry
// also prints error if can't find.
auto sso = vr::VRSettings()->GetBool(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_SupersampleManualOverride_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
vr::EVRSettingsError vrSettingsError;
// checks supersampling override and resynchs if necessry
// also prints error if can't find.
auto sso = vr::VRSettings()->GetBool(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_SupersampleManualOverride_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_SteamVR_SupersampleManualOverride_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setAllowSupersampleOverride( sso );
// checks supersampling and re-synchs if necessary
auto ss = vr::VRSettings()->GetFloat(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_SupersampleScale_Float,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_SteamVR_SupersampleScale_Float
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
if ( m_superSampling != 1.0f )
{
LOG( WARNING )
<< "Could not read \""
<< vr::k_pch_SteamVR_SupersampleManualOverride_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
LOG( DEBUG ) << "OpenVR returns an error and we have a custom "
"supersampling value: "
<< m_superSampling;
setSuperSampling( 1.0 );
}
setAllowSupersampleOverride( sso );
// checks supersampling and re-synchs if necessary
auto ss = vr::VRSettings()->GetFloat(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_SupersampleScale_Float,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING )
<< "Could not read \""
<< vr::k_pch_SteamVR_SupersampleScale_Float
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
if ( m_superSampling != 1.0f )
{
LOG( DEBUG )
<< "OpenVR returns an error and we have a custom "
"supersampling value: "
<< m_superSampling;
setSuperSampling( 1.0 );
}
}
else if ( m_superSampling != ss )
{
LOG( DEBUG ) << "OpenVR reports a changed supersampling value: "
<< m_superSampling << " => " << ss;
setSuperSampling( ss );
}
// checks if Supersampling filter is on and changes if it has been
// changed elsewhere
auto sf = vr::VRSettings()->GetBool(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING )
<< "Could not read \""
<< vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setAllowSupersampleFiltering( sf );
}
else if ( fabs( static_cast<double>( m_superSampling - ss ) ) > 0.05 )
{
LOG( INFO ) << "OpenVR reports a changed supersampling value: "
<< m_superSampling << " => " << ss;
setSuperSampling( ss );
}
// checks if Supersampling filter is on and changes if it has been
// changed elsewhere
auto sf = vr::VRSettings()->GetBool(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setAllowSupersampleFiltering( sf );
// Checks if Motion smoothing setting can be read and synchs adv
// settings to steamvr/openvr
auto ms = vr::VRSettings()->GetBool(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_MotionSmoothing_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING )
<< "Could not read \""
<< vr::k_pch_SteamVR_MotionSmoothing_Bool << "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setMotionSmoothing( ms );
// Checks if Motion smoothing setting can be read and synchs adv
// settings to steamvr/openvr
auto ms
= vr::VRSettings()->GetBool( vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_MotionSmoothing_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_SteamVR_MotionSmoothing_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setMotionSmoothing( ms );
// Checks and synchs performance graph
auto pg
= vr::VRSettings()->GetBool( vr::k_pch_Perf_Section,
// Checks and synchs performance graph
auto pg = vr::VRSettings()->GetBool( vr::k_pch_Perf_Section,
vr::k_pch_Perf_PerfGraphInHMD_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING )
<< "Could not read \"" << vr::k_pch_Perf_PerfGraphInHMD_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setPerformanceGraph( pg );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_Perf_PerfGraphInHMD_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setPerformanceGraph( pg );
settingsUpdateCounter = 0;
}
else
@@ -310,9 +303,9 @@ void SteamVRTabController::setSuperSampling( float value, const bool notify )
{
bool override = false;
// Mirrors Desktop Clamp
if ( value <= 0.2f )
if ( value < 0.2f )
{
LOG( WARNING ) << "Encountered a supersampling value <= 0.01, setting "
LOG( WARNING ) << "Encountered a supersampling value <= 0.2, setting "
"supersampling to 1.0";
value = 1.0f;
override = true;