Immersive mode: fix gamma, raise quad resolution, stop duplicate compositing (#1846)
* Skip hidden-surface compositing while the immersive session owns presentation The native render loop parks on its condvar and only renders when a content update dirties it. With the XR bridge attached, the quad samples the AHardwareBuffer directly, so forwarding the frame and returning before nativeUpdateWindowContentAHB leaves the native Vulkan compositor idle — no scene draw and no present to the invisible surface, per game frame. Flat mode is unchanged; the bridge is null there. * Raise the immersive swapchain to 1920x1080 and fix gamma via an sRGB swapchain The 720p intermediate was the quality ceiling: game frames were sampled down into it and back up onto the quad. The prior 1080p attempt measured worse, but that was against a pipeline still paying the per-frame EGLImage recreate and the duplicate hidden-surface compositor, both since removed. Gamma: the swapchain preferred linear GL_RGBA8 while the content is sRGB-encoded, so the compositor double-applied the transfer (washed-out output). Prefer GL_SRGB8_ALPHA8 and linearize sampled content in the shaders, since GLES re-encodes on write to sRGB attachments; a linear-format fallback keeps old behavior when sRGB is not offered. libxrimmersive.so rebuilt (NDK 27.3.13750724) for both XR flavors. * Render the composited scene into a shared AHardwareBuffer for the immersive session * Let the immersive session run at the system default refresh rate * Forward ASurfaceRenderer game buffers to the immersive session * Gate the immersive bridge attach points to XR builds * Drop the ASR immersive forwarding; keep bridge re-attach on renderer change * Harden the XR scene target: resize handling, memory-type guard, write-completion fence, real extents * Follow the container screen size and a per-container refresh rate in immersive mode --------- Co-authored-by: Utkarsh Dalal <utkarsh.dalal@toptal.com>
U
Utkarsh Dalal committed
12433d921891ebd024d5c1f3cb6ccdf81ed1183c
Parent: 14607a4
Committed by GitHub <noreply@github.com>
on 8/21/2026, 3:15:18 PM