mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-24 14:00:03 +00:00
Merge branch 'hrydgard:master' into feature_openxr_vulkan
This commit is contained in:
commit
6c50fc5b35
@ -235,11 +235,29 @@ bool GLRenderManager::ThreadFrame() {
|
||||
INFO_LOG(G3D, "Running first frame (%d)", threadFrame_);
|
||||
firstFrame = false;
|
||||
}
|
||||
|
||||
// Start of an OpenXR frame. This updates user's head pose and VR timestamps.
|
||||
// For fluent rendering, delay between StartVRRender and FinishVRRender must be very short.
|
||||
if (IsVRBuild() && !vrRenderStarted) {
|
||||
if (StartVRRender()) {
|
||||
vrRenderStarted = true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Render the scene.
|
||||
Run(threadFrame_);
|
||||
|
||||
VLOG("PULL: Finished frame %d", threadFrame_);
|
||||
} while (!nextFrame);
|
||||
|
||||
// Post OpenXR frame on a screen.
|
||||
if (IsVRBuild() && vrRenderStarted) {
|
||||
FinishVRRender();
|
||||
vrRenderStarted = false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -579,17 +597,14 @@ void GLRenderManager::Run(int frame) {
|
||||
}
|
||||
|
||||
if (IsVRBuild()) {
|
||||
if (PreVRRender()) {
|
||||
int passes = 1;
|
||||
if (!IsMultiviewSupported() && g_Config.bEnableStereo) {
|
||||
passes = 2;
|
||||
}
|
||||
for (int i = 0; i < passes; i++) {
|
||||
PreVRFrameRender(i);
|
||||
queueRunner_.RunSteps(stepsOnThread, skipGLCalls_, i < passes - 1);
|
||||
PostVRFrameRender();
|
||||
}
|
||||
PostVRRender();
|
||||
int passes = 1;
|
||||
if (!IsMultiviewSupported() && g_Config.bEnableStereo) {
|
||||
passes = 2;
|
||||
}
|
||||
for (int i = 0; i < passes; i++) {
|
||||
PreVRFrameRender(i);
|
||||
queueRunner_.RunSteps(stepsOnThread, skipGLCalls_, i < passes - 1);
|
||||
PostVRFrameRender();
|
||||
}
|
||||
} else {
|
||||
queueRunner_.RunSteps(stepsOnThread, skipGLCalls_);
|
||||
|
@ -1041,6 +1041,7 @@ private:
|
||||
|
||||
bool nextFrame = false;
|
||||
bool firstFrame = true;
|
||||
bool vrRenderStarted = false;
|
||||
|
||||
GLDeleter deleter_;
|
||||
bool skipGLCalls_ = false;
|
||||
|
@ -238,7 +238,7 @@ void BindVRFramebuffer() {
|
||||
VR_BindFramebuffer(VR_GetEngine());
|
||||
}
|
||||
|
||||
bool PreVRRender() {
|
||||
bool StartVRRender() {
|
||||
if (!VR_GetConfig(VR_CONFIG_VIEWPORT_VALID)) {
|
||||
VR_InitRenderer(VR_GetEngine(), IsMultiviewSupported());
|
||||
VR_SetConfig(VR_CONFIG_VIEWPORT_VALID, true);
|
||||
@ -263,7 +263,7 @@ bool PreVRRender() {
|
||||
return false;
|
||||
}
|
||||
|
||||
void PostVRRender() {
|
||||
void FinishVRRender() {
|
||||
VR_FinishFrame(VR_GetEngine());
|
||||
}
|
||||
|
||||
|
@ -15,8 +15,8 @@ void UpdateVRScreenKey(const KeyInput &key);
|
||||
|
||||
// VR rendering integration
|
||||
void BindVRFramebuffer();
|
||||
bool PreVRRender();
|
||||
void PostVRRender();
|
||||
bool StartVRRender();
|
||||
void FinishVRRender();
|
||||
void PreVRFrameRender(int fboIndex);
|
||||
void PostVRFrameRender();
|
||||
int GetVRFBOIndex();
|
||||
@ -38,8 +38,8 @@ inline void UpdateVRScreenKey(const KeyInput &key) {}
|
||||
|
||||
// VR rendering integration
|
||||
inline void BindVRFramebuffer() {}
|
||||
inline bool PreVRRender() { return false; }
|
||||
inline void PostVRRender() {}
|
||||
inline bool StartVRRender() { return false; }
|
||||
inline void FinishVRRender() {}
|
||||
inline void PreVRFrameRender(int fboIndex) {}
|
||||
inline void PostVRFrameRender() {}
|
||||
inline int GetVRFBOIndex() { return 0; }
|
||||
|
Loading…
Reference in New Issue
Block a user