1#ifndef MYTHRENDERVULKAN_H
2#define MYTHRENDERVULKAN_H
10#if QT_VERSION >= QT_VERSION_CHECK(6,5,0)
11#include <QtProcessorDetection>
13#include <QVulkanWindowRenderer>
14#include <QVulkanDeviceFunctions>
30#if QT_POINTER_SIZE == 8
31#define MYTH_NULL_DISPATCH nullptr
33#define MYTH_NULL_DISPATCH 0
43 bool IsValidVulkan()
const;
46 QVulkanDeviceFunctions* Funcs ();
51 bool m_vulkanValid {
true };
53 VkDevice m_vulkanDevice {
nullptr };
54 QVulkanDeviceFunctions* m_vulkanFuncs {
nullptr };
74 void SetFrameExpected (
void);
75 bool GetFrameExpected (
void)
const;
76 bool GetFrameStarted (
void)
const;
78 QStringList GetDescription(
void)
override;
80 void preInitResources (
void)
override;
81 void initResources (
void)
override;
82 void initSwapChainResources (
void)
override;
83 void releaseSwapChainResources (
void)
override;
84 void releaseResources (
void)
override;
85 void startNextFrame (
void)
override;
86 void physicalDeviceLost (
void)
override;
87 void logicalDeviceLost (
void)
override;
89 void BeginDebugRegion(VkCommandBuffer CommandBuffer,
const char *
Name,
91 void EndDebugRegion(VkCommandBuffer CommandBuffer);
92 bool CreateImage(QSize Size, VkFormat
Format, VkImageTiling Tiling,
93 VkImageUsageFlags Usage, VkMemoryPropertyFlags
Properties,
94 VkImage& Image, VkDeviceMemory& ImageMemory);
95 void TransitionImageLayout(VkImage &Image, VkImageLayout OldLayout,
96 VkImageLayout NewLayout, VkCommandBuffer CommandBuffer =
nullptr);
97 void CopyBufferToImage(VkBuffer
Buffer, VkImage Image,
98 uint32_t Width, uint32_t Height,
99 VkCommandBuffer CommandBuffer =
nullptr);
100 bool CreateBuffer(VkDeviceSize Size, VkBufferUsageFlags Usage,
102 VkDeviceMemory& Memory);
103 void CopyBuffer(VkBuffer Src, VkBuffer Dst, VkDeviceSize Size,
104 VkCommandBuffer CommandBuffer =
nullptr);
106 std::vector<VkDynamicState> Dynamic = { });
107 VkCommandBuffer CreateSingleUseCommandBuffer(
void);
108 void FinishSingleUseCommandBuffer(VkCommandBuffer &
Buffer);
109 VkSampler CreateSampler(VkFilter Min, VkFilter Mag);
110 VkPhysicalDeviceFeatures GetPhysicalDeviceFeatures()
const;
111 VkPhysicalDeviceLimits GetPhysicalDeviceLimits ()
const;
121 std::optional<uint32_t> FindMemoryType(uint32_t Filter, VkMemoryPropertyFlags
Properties);
123 void BeginFrame (
void);
124 void DebugVulkan (
void);
127 VkDevice m_device {
nullptr };
128 QVulkanFunctions* m_funcs {
nullptr };
129 QVulkanDeviceFunctions *m_devFuncs {
nullptr };
130 VkPhysicalDeviceFeatures m_phyDevFeatures { };
131 VkPhysicalDeviceLimits m_phyDevLimits { };
132 bool m_frameExpected {
false };
133 bool m_frameStarted {
false };
A device containing images (ie. USB stick, CD, storage group etc)
void PhysicalDeviceLost(void)
void LogicalDeviceLost(void)
QMap< QString, QString > m_debugInfo
void DoFreeResources(void)
Creates shader objects suitable for use with the Vulkan API.
std::array< float, 4 > MythVulkan4F
QMultiMap< QString, Property * > Properties