HoviTron Video Pipeline
VulkanHelperFunction.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/*****************************************************************/
19#pragma once
20
21#include "commonVulkan.h"
22
23#include"VulkanContext.h"
24
25uint32_t findMemoryType(vk::PhysicalDevice& physicalDevice, uint32_t typeFilter, vk::MemoryPropertyFlags properties);
26uint32_t findFastMemoryType(vk::PhysicalDevice& physicalDevice, uint32_t typeFilter, vk::MemoryPropertyFlags properties);
27
28void createImage(vk::Device& device, vk::PhysicalDevice& physicalDevice, uint32_t width, uint32_t height, vk::Format format, vk::ImageTiling tiling, vk::ImageUsageFlags usage, vk::MemoryPropertyFlags properties, vk::Image& image, vk::DeviceMemory& imageMemory);
29
30vk::ImageView createImageView(vk::Device& device, vk::Image image, vk::Format format, vk::ImageAspectFlags aspectFlags);
31vk::CommandBuffer beginSingleTimeCommands(VulkanContext* context, vk::CommandPool& commandPool);
32
33void endSingleTimeCommands(VulkanContext* context, vk::CommandPool& commandPool, vk::CommandBuffer commandBuffer);
34
35void transitionImageLayout(VulkanContext* context, vk::CommandPool& commandPool, vk::Image image, vk::Format format, vk::ImageLayout oldLayout, vk::ImageLayout newLayout);
36
37void createBuffer(vk::DeviceSize size, vk::BufferUsageFlags usage, vk::MemoryPropertyFlags properties, vk::Buffer& buffer, vk::DeviceMemory& bufferMemory, vk::Device& device, vk::PhysicalDevice& physicalDevice);
38void createFastBuffer(vk::DeviceSize size, vk::BufferUsageFlags usage, vk::MemoryPropertyFlags properties, vk::Buffer& buffer, vk::DeviceMemory& bufferMemory, vk::Device& device, vk::PhysicalDevice& physicalDevice);
39
40
41#define INDEX_E(x,y,W) ((y)*(W) + (x))
42std::vector<uint32_t> generate_picture_EBO(const glm::vec2 & s);
44glm::mat3x3 glmEulerAnglesDegreeToRotationMatrix(glm::vec3);
45
48
50glm::quat ApproximateAverage(std::vector<glm::quat> quaternions);
51
52#ifdef USE_OPENXR
53glm::quat XrQuaternionToGLMQuat(XrQuaternionf& q);
54XrQuaternionf GLMQuatToXrQuaternion(glm::quat& q);
55#endif
56
57glm::vec3 eulerAngleXYZFromRotationMatrix(glm::mat3x3& mat);
58
59glm::vec3 quatToEuler(glm::quat);
File that contain the VulkanContext class to manage Vulkan Instance, Physical device,...
glm::quat ApproximateAverage(std::vector< glm::quat > quaternions)
glm::mat3x3 glmEulerAnglesDegreeToRotationMatrix(glm::vec3)
glm::mat3x3 glmEulerAnglesDegreeToRotationMatrixNotOMAF(glm::vec3)
class that manages tasks related to Vulkan context (Vulkan Instance, Vulkan Physical device,...
Definition: VulkanContext.h:59
file that contains the common include for the Vulkan part