From 7d4c0155f0e43a7a65cba6e26d2aa6274309cbf3 Mon Sep 17 00:00:00 2001 From: Lubos Date: Tue, 2 Dec 2025 16:21:01 +0100 Subject: [PATCH] OpenXR - Swapchain indexing fixed --- Common/VR/VRRenderer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Common/VR/VRRenderer.cpp b/Common/VR/VRRenderer.cpp index c2d16f30fa..fb52e95584 100644 --- a/Common/VR/VRRenderer.cpp +++ b/Common/VR/VRRenderer.cpp @@ -342,6 +342,12 @@ bool VR_InitFrame( engine_t* engine ) { hmdorientation = XrQuaternionf_ToEulerAngles(invViewTransform[0].orientation); IN_VRInputFrame(engine); + for (int i = 0; i < ovrMaxNumEyes; i++) { + ovrFramebuffer* frameBuffer = &engine->appState.Renderer.FrameBuffer[i]; + frameBuffer->TextureSwapChainIndex++; + frameBuffer->TextureSwapChainIndex %= frameBuffer->TextureSwapChainLength; + } + engine->appState.LayerCount = 0; memset(engine->appState.Layers, 0, sizeof(ovrCompositorLayer_Union) * ovrMaxLayerCount); return true;