mirror of
https://github.com/bearstonem/openmohaa-vr.git
synced 2026-10-21 02:00:23 +02:00
Two bugs, both found on the device, both with the evidence recorded in VR_RENDERER_HANDOFF.md sections 8 and 9. The menu was a renderer restart. SDL reports a window resize; the handler compares it against glconfig.vidWidth/Height, which in VR is the eye buffer and never the Android surface, so it can never match. It set r_customwidth, r_customheight and r_mode -1 - cvars the renderer then ignores, because the VR resolution comes from GetVRRenderResolution - and scheduled a vid_restart that destroyed and rebuilt the GL context and the OpenXR session under a running frame loop. The panel drew a full 256/256 samples up to CL_Vid_Restart_f and nothing ever after. VR_PORT_STATUS called that restart harmless; it was the whole bug. RB_SurfaceFace declared its output pointer as unsigned* and assigned tess.indexes to it, which is glIndex_t* - unsigned short under gl4es. Every index went in four bytes apart in a two byte array, so each triangle picked up whichever vertex the zero high halves pointed at. That was the world smeared into streaks that dragged its textures with it; models never come through that function, which is why they were always correct. ProjectDlightTexture had the same fault in hitIndexes. The compiler had been reporting it all along, under sixty other warnings in that file. Also: renderergl1 culled against the game's symmetric fov rather than the runtime's asymmetric per-eye frustum; the VR layer set viewport, cull, depth, blend, colour mask and scissor state natively while gl4es caches all of them and drops the engine's next request for a value its stale copy already claims; and GfxInfo_f reported a different draw route than R_DrawElements took. The remaining diagnostics are CVAR_TEMP and default off. vr_captureEye is worth keeping: it writes the eye buffer to a TGA, and one image settled questions that six rounds of verbal description could not. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>