mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-13 14:30:27 +02:00
OpenXR - View matrix identity check breaking several games fixed
This commit is contained in:
1 parent
b980f55645
commit
307acaa9b7
4 files changed
+18
-2
No files matched your search
@@ -655,7 +655,8 @@ bool Is2DVRObject(float* projMatrix, bool ortho) {
|
||||
void UpdateVRParams(float* projMatrix, float* viewMatrix) {
|
||||
|
||||
// Set mirroring of axes
|
||||
if (!vrMirroring[VR_MIRRORING_UPDATED] && !IsMatrixIdentity(projMatrix) && !IsMatrixIdentity(viewMatrix)) {
|
||||
bool identityView = PSP_CoreParameter().compat.vrCompat().IdentityViewHack && IsMatrixIdentity(viewMatrix);
|
||||
if (!vrMirroring[VR_MIRRORING_UPDATED] && !IsMatrixIdentity(projMatrix) && !identityView) {
|
||||
vrMirroring[VR_MIRRORING_UPDATED] = true;
|
||||
vrMirroring[VR_MIRRORING_AXIS_X] = projMatrix[0] < 0;
|
||||
vrMirroring[VR_MIRRORING_AXIS_Y] = projMatrix[5] < 0;
|
||||
@@ -697,7 +698,7 @@ void UpdateVRView(float* leftEye, float* rightEye) {
|
||||
for (int index = 0; index < 2; index++) {
|
||||
|
||||
// Validate the view matrix
|
||||
if (IsMatrixIdentity(dst[index])) {
|
||||
if (PSP_CoreParameter().compat.vrCompat().IdentityViewHack && IsMatrixIdentity(dst[index])) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -122,6 +122,7 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) {
|
||||
}
|
||||
|
||||
void Compatibility::CheckVRSettings(IniFile &iniFile, const std::string &gameID) {
|
||||
CheckSetting(iniFile, gameID, "IdentityViewHack", &vrCompat_.IdentityViewHack);
|
||||
CheckSetting(iniFile, gameID, "Skyplane", &vrCompat_.Skyplane);
|
||||
CheckSetting(iniFile, gameID, "UnitsPerMeter", &vrCompat_.UnitsPerMeter);
|
||||
|
||||
|
||||
@@ -93,6 +93,7 @@ struct CompatFlags {
|
||||
};
|
||||
|
||||
struct VRCompat {
|
||||
bool IdentityViewHack;
|
||||
bool Skyplane;
|
||||
float UnitsPerMeter;
|
||||
};
|
||||
|
||||
@@ -30,6 +30,18 @@
|
||||
# ========================================================================================
|
||||
|
||||
|
||||
[IdentityViewHack]
|
||||
# Disables head tracking for render passes where view matrix is Identity
|
||||
|
||||
# Sonic Rivals 1
|
||||
ULES00622 = true
|
||||
ULUS10195 = true
|
||||
|
||||
# Sonic Rivals 2
|
||||
ULES00940 = true
|
||||
ULUS10323 = true
|
||||
|
||||
|
||||
[Skyplane]
|
||||
# Workaround to remove the background skyplane and add clearing framebuffer with a fog color.
|
||||
|
||||
@@ -53,6 +65,7 @@ ULJM05395 = true
|
||||
ULJM05884 = true
|
||||
ULUS10160 = true
|
||||
|
||||
|
||||
[UnitsPerMeter]
|
||||
# Scale of game world to convert the world units into meters. This enables following VR features:
|
||||
# + 3D stereoscopy (that can work only with accurate values)
|
||||
|
||||
Reference in new issue
Block a user