10#include "evan/ASwapchainContext.hpp"
11#include "evan/ASwapchainImage.hpp"
12#include "evan/DeviceContext.hpp"
13#include "evan/openxr/XrDeviceBackend.hpp"
14#include "evan/openxr/XrSwapchainImage.hpp"
203 const std::vector<XrCompositionLayerProjectionView> &
264 void setView(std::size_t index,
265 const utility::graphic::ViewF &view)
override;
301 struct SwapchainHandle {
318 std::optional<SwapchainHandle>
319 createMultiviewSwapchain(
const DeviceContext &deviceContext,
320 VkFormat swapchainFormat);
329 std::vector<SwapchainHandle>
330 createPerViewSwapchains(
const DeviceContext &deviceContext,
331 VkFormat swapchainFormat);
342 void buildSwapchainImages(
const DeviceContext &deviceContext,
343 const std::vector<SwapchainHandle> &handles);
354 bool viewConfigurationsShareLayout()
const;
367 VkSampleCountFlagBits _msaaSamples = VK_SAMPLE_COUNT_1_BIT;
377 bool _multiviewEnabled =
false;
386 ColorAttachmentMode _colorAttachmentMode =
387 ColorAttachmentMode::SwapchainImageAttachment;
393 std::vector<XrCompositionLayerProjectionView> _projectionLayerViews;
417 utility::graphic::PoseF _baseCenterPose {};
422 bool _hasBaseCenter {
false };
Represents the context for managing the swapchain in the rendering system.
Represents the device context for the engine, managing Vulkan-related resources and operations.
Describes a set of views to render, independent of the swapchain image sets.
The XrSwapchainContext class manages the swapchain context for an OpenXR application using Vulkan....
void updateProjectionLayerViews()
Updates the projection layer views based on current swapchain images and view data.
void syncViewSet()
Rebuilds the ViewSet from the latest OpenXR view state.
std::vector< XrView > _views
void recreateSwapchain(const DeviceContext &deviceContext, VkRenderPass renderpass) override
Recreates the swapchain and associated resources.
bool usesMultiview() const override
Indicates whether all views render into one layered swapchain.
void destroy(VkDevice device) override
Destroys all swapchain images and clears the swapchain image collection.
VkResult aquireImage(uint32_t index, VkDevice device, VkSemaphore imageAvailableSemaphore, VkFence inFlightFence, uint32_t &imageIndex) override
Acquires an image from the swapchain for rendering.
VkSampleCountFlagBits getMsaaSamples() const override
Retrieves the MSAA sample count used by this swapchain context.
std::vector< XrViewConfigurationView > _viewsConfigurations
ViewSet & getViewSet() override
Retrieves the set of views to render (mutable).
const std::vector< XrCompositionLayerProjectionView > & getProjectionLayerViews() const
Retrieves the projection layer views for the current view configurations.
void setView(std::size_t index, const utility::graphic::ViewF &view) override
Sets the view matrix for a specific view index.
void waitForImage(uint32_t index) override
Waits for a swapchain image to become available.
Small result wrapper used by helpers that must return both a status and a value (e....