Vixen
02b45cc4
csharp
public sealed class OpenXrSwapchain

Eye buffers the runtime owns and the engine renders into.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

The images are the compositor's. They are allocated by the runtime — possibly in memory it can reproject without a copy — and handed over as VkImage handles, which the graphics backend adopts through IXrImageImporter. Destroying this releases the adoption and leaves the images alone; destroying the OpenXR swapchain is what frees them.

Acquire and wait are one call here, and that is deliberate. The specification separates them so that an application can do other work in between, and in practice nothing does: a renderer acquires an image at the moment it is about to write to it. Merging them removes an ordering that is easy to get wrong and whose only symptom is tearing that appears on the headset and nowhere else.

Fields and properties (5)

  • public Int2 Size

    The size of one view's image, in pixels.

  • public PixelFormat Format

    The format the runtime actually granted.

  • public int ArrayLayers

    How many array layers each image has.

  • public int ImageCount

    How many images it cycles through. The runtime decides.

  • public int AcquiredIndex

    The index acquired, or -1 when none is.

Methods (5)

  • public TextureHandle Image(int index)

    One of the images, as a texture the RHI can render into.

  • public TextureViewHandle View(int index)

    A view of one of the images.

  • public int AcquireImage()

    Takes the next image and waits until the compositor has finished with it.

  • public void ReleaseImage()

    Says the acquired image has been rendered.

  • public void Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Used by (1)

  • OpenXrSessionVixen.Xr.OpenXR