Vixen
02b45cc4
csharp
public interface IXrSwapchain

The images an eye is rendered into.

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

Remarks

The runtime owns these, and that is the whole difference from ISwapChain. A window's swapchain is created by the engine on a surface the window system provided; an XR swapchain's images are allocated by the OpenXR runtime, possibly in memory the compositor can reproject without a copy, and handed back as native handles the RHI has to be told to adopt rather than create. Everything else about the cycle — acquire, render, release — looks the same on purpose.

There is no Present. Releasing an image says the rendering is done; what actually shows it is EndFrame, which submits every layer of the frame at once. A game that released an image and never submitted a layer referencing it would render correctly and display nothing, which is the second thing to check when an eye buffer is black.

Fields and properties (5)

  • Int2 Size

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

  • PixelFormat Format

    The format the runtime actually granted.

  • int ArrayLayers

    How many array layers each image has.

  • int ImageCount

    How many images it cycles through. The runtime decides.

  • int AcquiredIndex

    The index acquired, or -1 when none is.

Methods (4)

  • TextureHandle Image(int index)

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

  • TextureViewHandle View(int index)

    A view of one of the images.

  • int AcquireImage()

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

  • void ReleaseImage()

    Says the acquired image has been rendered.

Used by (7)

  • IXrSessionVixen.Xr
  • NullXrBackendTestsVixen.Xr.Tests
  • NullXrSessionVixen.Xr
  • NullXrSwapchainVixen.Xr
  • OpenXrSessionVixen.Xr.OpenXR
  • OpenXrSwapchainVixen.Xr.OpenXR
  • XrCompositionViewVixen.Xr