Monado OpenXR Runtime
Loading...
Searching...
No Matches
xrt::state_trackers::openvr::SwapchainCache Struct Reference

Since eye textures are created by the clients, and not the runtime, we have to do a copy into a runtime-owned swapchain, this structure cached created swapchains to avoid creating a new one every frame. More...

#include <openvr/compositor/openvr_compositor.hpp>

Collaboration diagram for xrt::state_trackers::openvr::SwapchainCache:

Public Member Functions

xrt_result_t EnsureSwapchain (xrt_compositor *xc, uint32_t storage_format, uint32_t sample_format, uint32_t width, uint32_t height, xrt_swapchain_usage_bits usage_bits, xrt_swapchain_create_flags flags)
 Ensures that there is a swapchain in the cache with the given properties, creating one if necessary.
 
void Reset ()
 Resets the internal state of the cache, releasing any swapchain it holds.
 

Data Fields

xrt_swapchainxsc {nullptr}
 
uint32_t width {0}
 
uint32_t height {0}
 
uint32_t storage_format {0}
 
uint32_t sample_format {0}
 

Detailed Description

Since eye textures are created by the clients, and not the runtime, we have to do a copy into a runtime-owned swapchain, this structure cached created swapchains to avoid creating a new one every frame.

Member Function Documentation

◆ EnsureSwapchain()

xrt_result_t xrt::state_trackers::openvr::SwapchainCache::EnsureSwapchain ( xrt_compositor xc,
uint32_t  storage_format,
uint32_t  sample_format,
uint32_t  width,
uint32_t  height,
xrt_swapchain_usage_bits  usage_bits,
xrt_swapchain_create_flags  flags 
)

Ensures that there is a swapchain in the cache with the given properties, creating one if necessary.

References XRT_ERROR_INVALID_ARGUMENT, XRT_SUCCESS, and XRT_SWAPCHAIN_CREATE_SAMPLE_AS_SRGB.

◆ Reset()

void xrt::state_trackers::openvr::SwapchainCache::Reset ( )

Resets the internal state of the cache, releasing any swapchain it holds.


The documentation for this struct was generated from the following files: