Go to the documentation of this file.
9 #define LOC QString("VulkanVis: ")
12 std::vector<VkDynamicState> Dynamic,
13 std::vector<int> Stages,
17 m_dynamicState(
std::move(Dynamic)),
18 m_shaderStages(
std::move(Stages)),
19 m_shaderSources(Sources),
20 m_shaderBindings(Bindings)
52 QRect viewport(QPoint{0, 0},
m_vulkanWindow->swapChainImageSize());
63 QMatrix4x4 projection;
64 projection.setToIdentity();
65 projection.ortho(viewport);
71 VkDescriptorPoolCreateInfo pool { VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO,
nullptr,
72 0, 1,
static_cast<uint32_t
>(sizes.size()), sizes.data() };
75 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Failed to create descriptor pool for projection");
81 VkDescriptorSetAllocateInfo alloc { };
82 alloc.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO;
84 alloc.descriptorSetCount = 1;
85 alloc.pSetLayouts = &layout;
90 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Failed to allocate projection descriptor set");
96 VkWriteDescriptorSet
write { };
97 write.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
100 write.dstArrayElement = 0;
101 write.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
102 write.descriptorCount = 1;
103 write.pBufferInfo = &buffdesc;
VkDescriptorSetLayout GetDescSetLayout(size_t Set) const
MythShaderVulkan * m_vulkanShader
const std::vector< VkDescriptorPoolSize > & GetPoolSizes(size_t Set) const
virtual MythRenderVulkan * InitialiseVulkan(QRect)
std::vector< int > m_shaderStages
#define MYTH_NULL_DISPATCH
def write(text, progress=True)
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
MythUniformBufferVulkan * m_projectionUniform
virtual ~MythVisualVulkan()
static MythShaderVulkan * Create(MythVulkanObject *Vulkan, const std::vector< int > &Stages, const MythShaderMap *Sources=nullptr, const MythBindingMap *Bindings=nullptr)
MythRenderVulkan * m_vulkanRender
const MythBindingMap * m_shaderBindings
VkDescriptorPool m_descriptorPool
std::map< int, MythBindingDesc > MythBindingMap
MythVisualVulkan(MythRenderVulkan *Render, std::vector< VkDynamicState > Dynamic, std::vector< int > Stages, const MythShaderMap *Sources, const MythBindingMap *Bindings)
const MythShaderMap * m_shaderSources
QVulkanDeviceFunctions * m_vulkanFuncs
std::vector< VkDynamicState > m_dynamicState
virtual void TearDownVulkan()
VkPipeline CreatePipeline(MythShaderVulkan *Shader, QRect Viewport, std::vector< VkDynamicState > Dynamic={ })
MythWindowVulkan * m_vulkanWindow
bool IsValidVulkan() const
std::map< int, std::pair< QString, std::vector< uint32_t > >> MythShaderMap
VkDescriptorSet m_projectionDescriptor