9#include <vulkan/vulkan.h>
31 VkCullModeFlagBits
cullMode = VkCullModeFlagBits::VK_CULL_MODE_NONE;
63 virtual std::vector<VkSpecializationMapEntry>
getMapEntries()
const = 0;
93 std::vector<VkSpecializationMapEntry>
getMapEntries()
const override;
122 std::vector<VkSpecializationMapEntry>
getMapEntries()
const override;
140 :
data{screenWidth, screenHeight} {}
142 std::vector<VkSpecializationMapEntry>
getMapEntries()
const override;
158#if !defined(HEADLESS) && !defined(COMPUTE_DEBUG)
161 VkPipelineLayout pipelineLayout,
162 VkRenderPass renderPass,
163 const std::string& meshShaderFilename,
164 const std::string& fragmentShaderFilename,
165 const std::vector<VkVertexInputBindingDescription>& vertexInputBindingDescriptions,
166 const std::vector<VkVertexInputAttributeDescription>& vertexInputAttributeDescriptions,
168 std::optional<const MeshShaderSpecializationData*> meshShaderSpecialization = std::nullopt,
169 bool depthOnly =
false
175 VkPipelineLayout pipelineLayout,
176 VkRenderPass renderPass,
177 const std::string& vertexShaderName,
178 const std::string& fragmentShaderName
183 void bind(VkCommandBuffer commandBuffer)
const;
223 std::string shaderFilename,
224 std::optional<const PipelineSpecializationData *> pSpecializationData
235 void bind(VkCommandBuffer commandBuffer);
257 VkPipelineLayout
layout = VK_NULL_HANDLE;
std::vector< VkSpecializationMapEntry > getMapEntries() const override
Gets the specialization data which will be uploaded to a shader.
size_t getDataSize() const override
Gets the size of the data stored in the result of getData()
const void * getData() const override
Gets a pointer for the data for the specialization data.
struct EngineCore::ComputePipelineSpecializationData::Data data
virtual uint32_t getThreadCount() const
Getter for how man threads the compute shader this specialization is applied to should have.
ComputePipelineSpecializationData(uint32_t threadCount)
Constructor.
void bind(VkCommandBuffer commandBuffer)
Binds this pipeline to an arbitrary command buffer.
void cleanup()
Cleans up all the resource handles of this object.
ComputePipeline(VkDevice device, VkPipelineLayout layout, std::string shaderFilename, std::optional< const PipelineSpecializationData * > pSpecializationData)
ComputeShader * computeShader
VkPipeline get() const
Getter for the raw vulkan pipeline.
uint32_t getNextStageThreadCount() const
DispatcherComputePipelineSpecializationData(uint32_t threadCount, uint32_t nextStageThreadCount)
const void * getData() const override
Getter for data pointer.
std::vector< VkSpecializationMapEntry > getMapEntries() const override
Creates the list of specialization map entries which are applied to a shader.
struct EngineCore::DispatcherComputePipelineSpecializationData::Data data
size_t getDataSize() const override
Getter for the size at the data pointer.
uint32_t getThreadCount() const
VkSampleCountFlagBits multisampling
std::string fragShaderName
bool operator==(const GraphicsPipeline &other) const
void bind(VkCommandBuffer commandBuffer) const
PipelineMaterialPayload pipelineData
const PipelineMaterialPayload & getPipelineMaterialData() const
GraphicsPipeline(VkDevice device, VkSampleCountFlagBits multisampling, VkPipelineLayout pipelineLayout, VkRenderPass renderPass, const std::string &meshShaderFilename, const std::string &fragmentShaderFilename, const std::vector< VkVertexInputBindingDescription > &vertexInputBindingDescriptions, const std::vector< VkVertexInputAttributeDescription > &vertexInputAttributeDescriptions, PipelineMaterialPayload pipelineData, std::optional< const MeshShaderSpecializationData * > meshShaderSpecialization=std::nullopt, bool depthOnly=false)
const std::string getFragShaderName() const
std::string meshShaderName
const std::string getMeshShaderName() const
bool isValid() const
Checks if the object is fully constructed.
const void * getData() const override
Getter for data pointer.
MeshShaderSpecializationData(float screenWidth, float screenHeight)
float getScreenWidth() const
struct EngineCore::MeshShaderSpecializationData::Data data
std::vector< VkSpecializationMapEntry > getMapEntries() const override
Creates the list of specialization map entries which are applied to a shader.
size_t getDataSize() const override
Getter for the size at the data pointer.
float getScreenHeight() const
Base class which defines the interface for pipeline specialization data. This can be thread count....
virtual size_t getDataSize() const =0
Getter for the size at the data pointer.
virtual std::vector< VkSpecializationMapEntry > getMapEntries() const =0
Creates the list of specialization map entries which are applied to a shader.
virtual const void * getData() const =0
Getter for data pointer.
virtual ~PipelineSpecializationData()=default
Log category system implementation.
uint32_t nextStageThreadCount
VkBlendFactor srcColorBlendFactor
VkCullModeFlagBits cullMode
VkBlendFactor srcAlphaBlendFactor
bool operator==(const PipelineMaterialPayload &other) const
VkBlendFactor dstAlphaBlendFactor
VkBlendFactor dstColorBlendFactor