Implement render-first pacing for Vulkan backend and enhance view location handling

This commit is contained in:
iChris4 committed 2026-09-19 20:36:03 +02:00
1 parent 47b59c7294
commit ffa63fa60a
8 files changed
+553 -9

No files matched your search

+6
View File
@@ -153,6 +153,11 @@ public:
OpenXRFrameStatus WaitFrame(OpenXRFrame& frame);
bool BeginFrame(const OpenXRFrame& frame);
bool LocateViews(OpenXRFrame& frame);
// Locates the views for `display_time` outside the frame protocol, for a
// packet whose eyes are rendered before the compositor frame that will show
// them is begun (the standalone backend's render-first pacing). Fills the
// frame's display time, views, flags and validity; requires a running session.
bool LocateViewsAt(XrTime display_time, OpenXRFrame& frame);
bool EndFrame(
const OpenXRFrame& frame,
const XrCompositionLayerBaseHeader* const* layers,
@@ -224,6 +229,7 @@ private:
bool EnumerateSwapchainFormats();
bool HandleSessionStateChanged(const XrEventDataSessionStateChanged& event);
bool IsFrameTokenCurrent(const OpenXRFrame& frame, FramePhase expected) const;
bool LocateViewsForFrame(OpenXRFrame& frame);
void ResetFrameState();
void DestroyReferenceSpaces();
void ResetSessionState();
+14
View File
@@ -58,6 +58,20 @@ public:
bool RepeatFrame(const OpenXRBackendFrame& frame);
bool FinishFrame(OpenXRBackendFrame& frame, bool submit_layer);
// Render-first pacing, used while VR interpolation is off. A packet is prepared with the
// views located for an estimated display time and handed to Aurora without a compositor
// frame open; once Aurora has rendered the eyes into the shared buffers, the compositor frame
// is begun, the eyes are copied into its swapchain images and it is ended at once. A headset
// frame therefore never waits for a game frame: it stays open for the copy alone.
OpenXRBeginStatus PreparePacket(const OpenXRPresentation& presentation, OpenXRBackendFrame& packet);
bool TryCancelPendingPacket(OpenXRBackendFrame& packet);
OpenXRBeginStatus BeginFrameForPacket(const OpenXRBackendFrame& packet, OpenXRBackendFrame& frame);
OpenXRSubmissionStatus CopyRenderedEyes(const OpenXRBackendFrame& frame);
// One compositor cycle that resubmits the retained layer (or nothing), with no frame left
// active: keeps the runtime fed while the eyes are still being rendered and learns the
// display timing the next packet is located for.
OpenXRBeginStatus KeepAliveCycle();
// Drains this backend's own queue before tearing down. Returns false only
// when the private device could not be waited on, in which case the caller
// retains the backend and runtime for the process lifetime.