mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-16 16:00:30 +02:00
OpenXR - Do not mashup Common/GPU
This commit is contained in:
1 parent
64857ce5c7
commit
c9f08a85c6
3 files changed
+22
-14
No files matched your search
+5
-14
@@ -10,19 +10,6 @@
|
||||
#include "Core/KeyMap.h"
|
||||
#include "Core/System.h"
|
||||
|
||||
#include "GPU/GPUState.h"
|
||||
|
||||
enum VRCompat {
|
||||
//compatibility tweaks
|
||||
VR_COMPAT_SKYPLANE,
|
||||
|
||||
//render state
|
||||
VR_COMPAT_GEOMETRY, VR_USE_CLIP,
|
||||
|
||||
//end
|
||||
VR_COMPAT_MAX
|
||||
};
|
||||
|
||||
static long vrCompat[VR_COMPAT_MAX];
|
||||
|
||||
/*
|
||||
@@ -247,7 +234,7 @@ void PreGLRenderPass(const GLRStep& step) {
|
||||
// Clear the screen with fog color, only for passes containing geometry (and no lens flares)
|
||||
if (vrCompat[VR_COMPAT_SKYPLANE] && vrCompat[VR_COMPAT_GEOMETRY] && (step.commands.size() > 50)) {
|
||||
float color[4];
|
||||
Uint8x3ToFloat4(color, gstate.fogcolor);
|
||||
Uint8x3ToFloat4(color, vrCompat[VR_COMPAT_FOG_COLOR]);
|
||||
glClearColor(color[0], color[1], color[2], 1.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
glClearColor(0, 0, 0, 1);
|
||||
@@ -276,6 +263,10 @@ void PostGLCommand(const GLRRenderData& data) {
|
||||
}
|
||||
}
|
||||
|
||||
void SetVRCompat(VRCompat flag, long value) {
|
||||
vrCompat[flag] = value;
|
||||
}
|
||||
|
||||
/*
|
||||
================================================================================
|
||||
|
||||
|
||||
@@ -4,6 +4,20 @@
|
||||
#include "Common/Input/InputState.h"
|
||||
#include "Common/Input/KeyCodes.h"
|
||||
|
||||
enum VRCompat {
|
||||
//compatibility tweaks
|
||||
VR_COMPAT_SKYPLANE,
|
||||
|
||||
//render state
|
||||
VR_COMPAT_GEOMETRY, VR_USE_CLIP,
|
||||
|
||||
//uniforms
|
||||
VR_COMPAT_FOG_COLOR,
|
||||
|
||||
//end
|
||||
VR_COMPAT_MAX
|
||||
};
|
||||
|
||||
#ifdef OPENXR
|
||||
|
||||
// VR app flow integration
|
||||
@@ -18,6 +32,7 @@ void UpdateVRScreenKey(const KeyInput &key);
|
||||
void PreGLRenderPass(const GLRStep& step);
|
||||
void PreGLCommand(const GLRRenderData& data);
|
||||
void PostGLCommand(const GLRRenderData& data);
|
||||
void SetVRCompat(VRCompat flag, long value);
|
||||
|
||||
// VR rendering integration
|
||||
void BindVRFramebuffer();
|
||||
@@ -46,6 +61,7 @@ inline void UpdateVRScreenKey(const KeyInput &key) {}
|
||||
inline void PreGLRenderPass(const GLRStep& step) {}
|
||||
inline void PreGLCommand(const GLRRenderData& data) {}
|
||||
inline void PostGLCommand(const GLRRenderData& data) {}
|
||||
inline void SetVRCompat(VRCompat flag, long value) {}
|
||||
|
||||
// VR rendering integration
|
||||
inline void BindVRFramebuffer() {}
|
||||
|
||||
@@ -354,6 +354,7 @@ void LinkedShader::UpdateUniforms(u32 vertType, const ShaderID &vsid, bool useBu
|
||||
|
||||
if (IsVRBuild()) {
|
||||
dirty |= DIRTY_VIEWMATRIX;
|
||||
SetVRCompat(VR_COMPAT_FOG_COLOR, gstate.fogcolor);
|
||||
}
|
||||
if (!dirty)
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user