1#ifndef MYTHRENDERVULKAN_H
2#define MYTHRENDERVULKAN_H
9#include <QVulkanWindowRenderer>
10#include <QVulkanDeviceFunctions>
26#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
27#define MYTH_NULL_DISPATCH nullptr
29#define MYTH_NULL_DISPATCH 0
39 bool IsValidVulkan()
const;
42 QVulkanDeviceFunctions* Funcs ();
47 bool m_vulkanValid {
true };
49 VkDevice m_vulkanDevice {
nullptr };
50 QVulkanDeviceFunctions* m_vulkanFuncs {
nullptr };
70 void SetFrameExpected (
void);
71 bool GetFrameExpected (
void)
const;
72 bool GetFrameStarted (
void)
const;
74 QStringList GetDescription(
void)
override;
76 void preInitResources (
void)
override;
77 void initResources (
void)
override;
78 void initSwapChainResources (
void)
override;
79 void releaseSwapChainResources (
void)
override;
80 void releaseResources (
void)
override;
81 void startNextFrame (
void)
override;
82 void physicalDeviceLost (
void)
override;
83 void logicalDeviceLost (
void)
override;
85 void BeginDebugRegion(VkCommandBuffer CommandBuffer,
const char *
Name,
87 void EndDebugRegion(VkCommandBuffer CommandBuffer);
88 bool CreateImage(QSize Size, VkFormat
Format, VkImageTiling Tiling,
89 VkImageUsageFlags Usage, VkMemoryPropertyFlags
Properties,
90 VkImage& Image, VkDeviceMemory& ImageMemory);
91 void TransitionImageLayout(VkImage &Image, VkImageLayout OldLayout,
92 VkImageLayout NewLayout, VkCommandBuffer CommandBuffer =
nullptr);
93 void CopyBufferToImage(VkBuffer
Buffer, VkImage Image,
94 uint32_t Width, uint32_t Height,
95 VkCommandBuffer CommandBuffer =
nullptr);
96 bool CreateBuffer(VkDeviceSize Size, VkBufferUsageFlags Usage,
98 VkDeviceMemory& Memory);
99 void CopyBuffer(VkBuffer Src, VkBuffer Dst, VkDeviceSize Size,
100 VkCommandBuffer CommandBuffer =
nullptr);
102 std::vector<VkDynamicState> Dynamic = { });
103 VkCommandBuffer CreateSingleUseCommandBuffer(
void);
104 void FinishSingleUseCommandBuffer(VkCommandBuffer &
Buffer);
105 VkSampler CreateSampler(VkFilter Min, VkFilter Mag);
106 VkPhysicalDeviceFeatures GetPhysicalDeviceFeatures()
const;
107 VkPhysicalDeviceLimits GetPhysicalDeviceLimits ()
const;
117 std::optional<uint32_t> FindMemoryType(uint32_t Filter, VkMemoryPropertyFlags
Properties);
119 void BeginFrame (
void);
120 void DebugVulkan (
void);
123 VkDevice m_device {
nullptr };
124 QVulkanFunctions* m_funcs {
nullptr };
125 QVulkanDeviceFunctions *m_devFuncs {
nullptr };
126 VkPhysicalDeviceFeatures m_phyDevFeatures { };
127 VkPhysicalDeviceLimits m_phyDevLimits { };
128 bool m_frameExpected {
false };
129 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