mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
OpenXR - NonVR option fixed
This commit is contained in:
+11
-9
@@ -508,12 +508,6 @@ bool StartVRRender() {
|
||||
|
||||
if (VR_InitFrame(VR_GetEngine())) {
|
||||
|
||||
// VR flags
|
||||
bool vrIncompatibleGame = PSP_CoreParameter().compat.vrCompat().ForceFlatScreen;
|
||||
bool vrMode = (g_Config.bEnableVR || IsImmersiveVRMode()) && !vrIncompatibleGame;
|
||||
bool vrScene = !vrFlatForced && (g_Config.bManualForceVR || (vr3DGeometryCount > 15));
|
||||
bool vrStereo = !PSP_CoreParameter().compat.vrCompat().ForceMono && g_Config.bEnableStereo;
|
||||
|
||||
// Get VR status
|
||||
for (int eye = 0; eye < ovrMaxNumEyes; eye++) {
|
||||
vrView[eye] = VR_GetView(eye);
|
||||
@@ -548,7 +542,8 @@ bool StartVRRender() {
|
||||
|
||||
// Decide if the scene is 3D or not
|
||||
VR_SetConfigFloat(VR_CONFIG_CANVAS_ASPECT, 480.0f / 272.0f);
|
||||
if (vrMode && vrScene && (appMode == VR_GAME_MODE)) {
|
||||
bool vrStereo = !PSP_CoreParameter().compat.vrCompat().ForceMono && g_Config.bEnableStereo;
|
||||
if (!IsBigScreenVRMode() && (appMode == VR_GAME_MODE)) {
|
||||
VR_SetConfig(VR_CONFIG_MODE, vrStereo ? VR_MODE_STEREO_6DOF : VR_MODE_MONO_6DOF);
|
||||
VR_SetConfig(VR_CONFIG_REPROJECTION, IsImmersiveVRMode() ? 0 : 1);
|
||||
vrFlatGame = false;
|
||||
@@ -566,7 +561,7 @@ bool StartVRRender() {
|
||||
vrCompat[VR_COMPAT_SKYPLANE] = PSP_CoreParameter().compat.vrCompat().Skyplane;
|
||||
|
||||
// Set customizations
|
||||
VR_SetConfigFloat(VR_CONFIG_CANVAS_DISTANCE, vrScene && (appMode == VR_GAME_MODE) ? g_Config.fCanvas3DDistance : g_Config.fCanvasDistance);
|
||||
VR_SetConfigFloat(VR_CONFIG_CANVAS_DISTANCE, !IsBigScreenVRMode() && (appMode == VR_GAME_MODE) ? g_Config.fCanvas3DDistance : g_Config.fCanvasDistance);
|
||||
VR_SetConfig(VR_CONFIG_PASSTHROUGH, g_Config.bPassthrough && IsPassthroughSupported());
|
||||
return true;
|
||||
}
|
||||
@@ -599,6 +594,13 @@ bool IsPassthroughSupported() {
|
||||
return VR_GetPlatformFlag(VR_PLATFORM_EXTENSION_PASSTHROUGH);
|
||||
}
|
||||
|
||||
bool IsBigScreenVRMode() {
|
||||
bool vrIncompatibleGame = PSP_CoreParameter().compat.vrCompat().ForceFlatScreen;
|
||||
bool vrMode = (g_Config.bEnableVR || IsImmersiveVRMode()) && !vrIncompatibleGame;
|
||||
bool vrScene = !vrFlatForced && (g_Config.bManualForceVR || (vr3DGeometryCount > 15));
|
||||
return !vrMode || !vrScene;
|
||||
}
|
||||
|
||||
bool IsFlatVRGame() {
|
||||
return vrFlatGame;
|
||||
}
|
||||
@@ -691,7 +693,7 @@ void UpdateVRParams(float* projMatrix) {
|
||||
|
||||
void UpdateVRProjection(float* projMatrix, float* output) {
|
||||
for (int i = 0; i < 16; i++) {
|
||||
if (!IsVREnabled()) {
|
||||
if (!IsVREnabled() || IsBigScreenVRMode()) {
|
||||
output[i] = projMatrix[i];
|
||||
} else if (PSP_CoreParameter().compat.vrCompat().ProjectionHack && ((i == 8) || (i == 9))) {
|
||||
output[i] = 0;
|
||||
|
||||
@@ -53,6 +53,7 @@ void PostVRFrameRender();
|
||||
int GetVRFBOIndex();
|
||||
int GetVRPassesCount();
|
||||
bool IsPassthroughSupported();
|
||||
bool IsBigScreenVRMode();
|
||||
bool IsFlatVRGame();
|
||||
bool IsFlatVRScene();
|
||||
bool IsGameVRScene();
|
||||
|
||||
@@ -341,8 +341,10 @@ static inline void FlipProjMatrix(Matrix4x4 &in, bool useBufferedRendering) {
|
||||
static inline bool GuessVRDrawingHUD(bool is2D, bool flatScreen) {
|
||||
|
||||
bool hud = true;
|
||||
//HUD shouldn't be modified in nonVR mode
|
||||
if (IsBigScreenVRMode()) hud = false;
|
||||
//HUD can be disabled in settings
|
||||
if (!g_Config.bRescaleHUD) hud = false;
|
||||
else if (!g_Config.bRescaleHUD) hud = false;
|
||||
//HUD cannot be rendered in flatscreen
|
||||
else if (flatScreen) hud = false;
|
||||
//HUD has to be 2D
|
||||
|
||||
Reference in New Issue
Block a user