You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

40 lines
1.1 KiB

#pragma once
#include <glm/mat4x4.hpp>
#include <vulkan/vulkan.h>
class Instance;
struct UniformBufferObject {
alignas(16) glm::mat4 model;
glm::mat4 view;
glm::mat4 projection;
};
class Pipeline {
public:
VkPipeline handle = VK_NULL_HANDLE;
VkPipelineLayout layout = VK_NULL_HANDLE;
protected:
explicit Pipeline(const std::vector<VkDescriptorSetLayout> &descriptorSetLayouts,
const std::vector<VkPushConstantRange> &pushConstantRanges);
virtual ~Pipeline();
protected:
static VkShaderModule createShaderModule(const std::vector<char> &code);
};
class GraphicsPipeline : public Pipeline {
public:
explicit GraphicsPipeline(const std::string& vertexShaderPath, const std::string& fragmentShaderPath,
VkRenderPass renderPass,
const std::vector<VkDescriptorSetLayout> &descriptorSetLayouts={},
const std::vector<VkPushConstantRange> &pushConstantRanges={});
};
class ComputePipeline : public Pipeline {
public:
explicit ComputePipeline(const std::string& shaderFile,
const std::vector<VkDescriptorSetLayout> &descriptorSetLayouts={},
const std::vector<VkPushConstantRange> &pushConstantRanges={});
};