Files
mxl-multiviewer/RenderPipeline.hpp
2026-05-18 00:03:06 +03:00

43 lines
1.2 KiB
C++

#pragma once
#include <vulkan/vulkan.h>
#include <cstdint>
#include <string>
#include <vector>
class RenderPipeline
{
public:
RenderPipeline(
VkDevice device,
VkFormat swapchainImageFormat);
~RenderPipeline();
RenderPipeline(const RenderPipeline&) = delete;
RenderPipeline& operator=(const RenderPipeline&) = delete;
VkRenderPass renderPass() const { return m_renderPass; }
VkPipelineLayout pipelineLayout() const { return m_pipelineLayout; }
VkDescriptorSetLayout descriptorSetLayout() const { return m_descriptorSetLayout; }
VkPipeline graphicsPipeline() const { return m_graphicsPipeline; }
void release();
private:
std::vector<char> readFile(
const std::string& filename);
VkShaderModule createShaderModule(
const std::vector<char>& code);
VkDevice m_device;
VkRenderPass m_renderPass = VK_NULL_HANDLE;
VkShaderModule m_vertShaderModule = VK_NULL_HANDLE;
VkShaderModule m_fragShaderModule = VK_NULL_HANDLE;
VkDescriptorSetLayout m_descriptorSetLayout = VK_NULL_HANDLE;
VkPipelineLayout m_pipelineLayout = VK_NULL_HANDLE;
VkPipeline m_graphicsPipeline = VK_NULL_HANDLE;
};