OpenXR - Rendering into VR framebuffer works

This commit is contained in:
Lubos 2022-07-15 15:41:21 +02:00
parent 08e01c9a2a
commit 553363a5b5
6 changed files with 44 additions and 18 deletions

View file

@ -30,6 +30,11 @@ static constexpr int TEXCACHE_NAME_CACHE_SIZE = 16;
extern void bindDefaultFBO();
#endif
#ifdef OPENXR
#include "VR/VRBase.h"
#include "VR/VRRenderer.h"
#endif
// Workaround for Retroarch. Simply declare
// extern GLuint g_defaultFBO;
// and set is as appropriate. Can adjust the variables in ext/native/base/display.h as
@ -1653,6 +1658,11 @@ void GLQueueRunner::fbo_unbind() {
bindDefaultFBO();
#endif
#ifdef OPENXR
GLuint fbo = VR_Framebuffer(VR_GetEngine(), 0);
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
#endif
currentDrawHandle_ = 0;
currentReadHandle_ = 0;
CHECK_GL_ERROR_IF_DEBUG();