HoviTron Video Pipeline
SwapchainOpenXR.h
Go to the documentation of this file.
1/* ----------------------
2* Copyright 2023 Université Libre de Bruxelles(ULB), Universidad Politécnica de Madrid(UPM), CREAL, Deutsches Zentrum für Luft - und Raumfahrt(DLR)
3
4* Licensed under the Apache License, Version 2.0 (the "License");
5* you may not use this file except in compliance with the License.
6* You may obtain a copy of the License at < http://www.apache.org/licenses/LICENSE-2.0>
7
8* Unless required by applicable law or agreed to in writing, software
9* distributed under the License is distributed on an "AS IS" BASIS,
10* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11* See the License for the specific language governing permissionsand
12* limitations under the License.
13---------------------- */
14
15
16
17/*****************************************************************/
21#pragma once
22#include "SwapchainAbstract.h"
23#include "openXRHelp.h"
25
26#include <variant>
27
36public:
38 SwapchainOpenXR(int64_t format,const XrViewConfigurationView& vp, WindowAbstract* window, VulkanWrapper* wrapper, XrSession * session);
40 std::tuple<uint32_t, std::optional<vk::Semaphore> > acquireImage() override;
42 void presentImage(uint32_t imageIndex, vk::Semaphore & renderingFinnished) override;
44 void presentImage(uint32_t imageIndex, vk::Fence & renderingFinnishedFence) override;
46 vk::ImageView getSwapchainImageView(int elem) override;
48 vk::Image getSwapchainImage(int index) override;
49
51 void cleanup() override;
53 int getAttachmentSize() override;
55 vk::Image getCurrentImage() override;
56
57private:
59 bool isDepth = false;
61 uint32_t currentImage = 0;
62 /* OpenXR struct that contains the images of the swapchain */
63 std::vector<XrSwapchainImageBaseHeader*> xrSwapchainImagesBase;
65 std::vector<XrSwapchainImageVulkanKHR> swapChainImagesXr;
66
68 void createSwapchain(const XrViewConfigurationView& vp, XrSession* session , int64_t format);
70 void createSwapchainImageViews();
71 std::vector<XrSwapchainImageBaseHeader*> initPresentation(uint32_t count, XrSwapchainCreateInfo swapchainInfo);
72
74 Swapchain xrswapchain;
75
76
77};
Contains the class that encapsulate the notion of Swapchain: SwapchainAbstract.
Encapsulate the notion of Swapchain.
WindowAbstract * window
Class that encapsulate an OpenXR Swapchain and functions associated to it.
int getAttachmentSize() override
vk::ImageView getSwapchainImageView(int elem) override
std::tuple< uint32_t, std::optional< vk::Semaphore > > acquireImage() override
vk::Image getSwapchainImage(int index) override
vk::Image getCurrentImage() override
void presentImage(uint32_t imageIndex, vk::Semaphore &renderingFinnished) override
void cleanup() override
Class that manages the classes related to Vulkan code and act as a wrapper around them.
Definition: VulkanWrapper.h:66
Abstraction of the way of the result is displayed (screen or HMD).
file that contains the common include for the Vulkan part
Some useful functions from the openXR sample (hello_xr)