7#include <vulkan/vulkan.h>
30 VkCullModeFlagBits
cullMode = VkCullModeFlagBits::VK_CULL_MODE_NONE;
62 virtual std::vector<VkSpecializationMapEntry>
getMapEntries()
const = 0;
152 :
data{screenWidth, screenHeight} {}
170#if !defined(HEADLESS) && !defined(COMPUTE_DEBUG)
173 VkPipelineLayout pipelineLayout,
174 VkRenderPass renderPass,
175 const std::string& meshShaderFilename,
176 const std::string& fragmentShaderFilename,
177 const std::vector<VkVertexInputBindingDescription>& vertexInputBindingDescriptions,
178 const std::vector<VkVertexInputAttributeDescription>& vertexInputAttributeDescriptions,
180 std::optional<const MeshShaderSpecializationData*> meshShaderSpecialization = std::nullopt,
181 VkFormat colorFormat = VK_FORMAT_R8G8B8A8_UNORM
187 VkPipelineLayout pipelineLayout,
188 VkRenderPass renderPass,
189 const std::string& vertexShaderName,
190 const std::string& fragmentShaderName
195 void bind(VkCommandBuffer commandBuffer)
const;
232 std::string shaderFilename,
233 std::optional<const PipelineSpecializationData *> pSpecializationData
241 void bind(VkCommandBuffer commandBuffer);
257 VkPipelineLayout
layout = VK_NULL_HANDLE;
The application context is the core class which stores the basic openxr and vulkan objects.
const void * getData() const override
Gets a pointer for the data for the specialization data.
struct Engine::Rendering::ComputePipelineSpecializationData::Data data
std::vector< VkSpecializationMapEntry > getMapEntries() const override
Gets the specialization data which will be uploaded to a shader.
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.
size_t getDataSize() const override
Gets the size of the data stored in the result of getData()
VkPipeline get() const
Getter for the raw vulkan pipeline.
Core::ComputeShader * computeShader
void bind(VkCommandBuffer commandBuffer)
Binds this pipeline to an arbitrary command buffer.
ComputePipeline(VkDevice device, VkPipelineLayout layout, std::string shaderFilename, std::optional< const PipelineSpecializationData * > pSpecializationData)
void cleanup()
Cleans up all the resource handles of this object.
uint32_t getThreadCount() const
struct Engine::Rendering::DispatcherComputePipelineSpecializationData::Data data
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.
DispatcherComputePipelineSpecializationData(uint32_t threadCount, uint32_t nextStageThreadCount)
size_t getDataSize() const override
Getter for the size at the data pointer.
uint32_t getNextStageThreadCount() const
std::string fragShaderName
VkSampleCountFlagBits multisampling
const PipelineMaterialPayload & getPipelineMaterialData() const
std::string meshShaderName
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, VkFormat colorFormat=VK_FORMAT_R8G8B8A8_UNORM)
const Core::ApplicationContext * context
PipelineMaterialPayload pipelineData
bool isValid() const
Checks if the object is fully constructed.
const std::string getFragShaderName() const
const std::string getMeshShaderName() const
void bind(VkCommandBuffer commandBuffer) const
bool operator==(const GraphicsPipeline &other) const
struct Engine::Rendering::MeshShaderSpecializationData::Data data
const void * getData() const override
Getter for data pointer.
float getScreenHeight() const
float getScreenWidth() const
std::vector< VkSpecializationMapEntry > getMapEntries() const override
Creates the list of specialization map entries which are applied to a shader.
MeshShaderSpecializationData(float screenWidth, float screenHeight)
size_t getDataSize() const override
Getter for the size at the data pointer.
Base class which defines the interface for pipeline specialization data. This can be thread count....
virtual ~PipelineSpecializationData()=default
virtual size_t getDataSize() const =0
Getter for the size at the data pointer.
virtual const void * getData() const =0
Getter for data pointer.
virtual std::vector< VkSpecializationMapEntry > getMapEntries() const =0
Creates the list of specialization map entries which are applied to a shader.
Manages IBL (Image-Based Lighting) resources for specular reflections.
Raw specialization constant payload passed to Vulkan.
uint32_t localSizeX
Workgroup local size for the current dispatch stage.
uint32_t nextStageThreadCount
Thread count consumed by the next dispatch stage.
bool operator==(const PipelineMaterialPayload &other) const
VkBlendFactor srcAlphaBlendFactor
VkBlendFactor dstAlphaBlendFactor
VkCullModeFlagBits cullMode
VkBlendFactor dstColorBlendFactor
VkBlendFactor srcColorBlendFactor