Merge pull request #21054 from lvonasek/hotfix-openxr-swapchain

OpenXR - Swapchain indexing fixed
This commit is contained in:
Henrik Rydgård
2025-12-02 19:26:42 +01:00
committed by GitHub
+6
View File
@@ -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;