4 inline GraphicsPipeline::InputBinding::InputBinding(
GraphicsPipeline& graphicPipelineBuilder, uint32_t idx) : _graphicPipelineBuilder(graphicPipelineBuilder), _idx(idx) {}
15 const VkVertexInputAttributeDescription inputAttribute{
189 for (uint8_t i = 0; i < 4; ++i) {
198 const VkPipelineShaderStageCreateInfo shaderStage{
199 VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
203 static_cast<VkShaderModule
>(shaderModule),
216 LUG_LOG.error(
"Builder::GraphicsPipeline: Create load from file {}", filename);
220 VkResult result{ VK_SUCCESS };
222 if (!shaderModuleBuilder.
build(shaderModule, &result)) {
223 LUG_LOG.error(
"Builder::GraphicsPipeline: Create create shader from file {}: {}", filename, result);
227 setShader(stage, entry, std::move(shaderModule));
236 VkResult result{VK_SUCCESS};
238 if (!shaderModuleBuilder.
build(shaderModule, &result)) {
239 LUG_LOG.error(
"Builder::GraphicsPipeline: Create create shader from content: {}", result);
243 setShader(stage, entry, std::move(shaderModule));
256 const VkVertexInputBindingDescription inputBinding{
VkPipelineCache _pipelineCache
bool loadFromFile(const std::string &filename)
RasterizationState(const RasterizationState &)=default
void enableDepthBias(float constantFactor, float clamp, float slopeFactor)
VkPipelineRasterizationStateCreateInfo _rasterizationState
void disableDepthBoundsTest()
void enableLogicOp(VkLogicOp logicOp)
ColorBlendState(const ColorBlendState &)=default
void setPipelineLayout(API::PipelineLayout pipelineLayout)
void disableStencilTest()
ViewportState getViewportState()
ViewportState(const ViewportState &)=default
GraphicsPipeline & _graphicPipelineBuilder
std::vector< VkRect2D > _scissors
void enableAlphaToCoverage()
void setMinSampleShading(float minSampleShading)
std::set< VkDynamicState > _dynamicStates
RasterizationState getRasterizationState()
void enableDepthBoundsTest(float minDepthBounds, float maxDepthBounds)
void disableAlphaToCoverage()
void disableSampleShading()
const API::Device & _device
void setRenderPass(API::RenderPass renderPass, uint32_t subpass)
void setFrontFace(VkFrontFace frontFace)
MultisampleState(const MultisampleState &)=default
std::vector< VkPipelineShaderStageCreateInfo > _shaderStages
std::vector< VkVertexInputAttributeDescription > _inputAttributes
void addAttachment(const VkPipelineColorBlendAttachmentState &attachment)
void enableDepthTest(VkCompareOp depthCompareOp)
std::vector< VkViewport > _viewports
GraphicsPipeline & _graphicPipelineBuilder
VkPipelineMultisampleStateCreateInfo _multisampleState
void setInputAssemblyInfo(VkPrimitiveTopology topology, bool primitiveRestartEnable)
bool _primitiveRestartEnable
API::RenderPass _renderPass
void setPolygonMode(VkPolygonMode polygonMode)
void addScissor(const VkRect2D &scissor)
void enableRasterizerDiscard()
void disableRasterizerDiscard()
bool setShaderFromFile(VkShaderStageFlagBits stage, const char *entry, const std::string &filename)
VkPipelineColorBlendStateCreateInfo _colorBlendState
GraphicsPipeline & _graphicPipelineBuilder
VkPrimitiveTopology _topology
GraphicsPipeline & _graphicPipelineBuilder
MultisampleState getMultisampleState()
void setRasterizationSamples(VkSampleCountFlagBits rasterizationSamples)
void enableStencilTest(const VkStencilOpState &front, const VkStencilOpState &back)
void setPipelineCache(VkPipelineCache pipelineCache)
void addViewport(const VkViewport &viewport)
std::vector< VkPipelineColorBlendAttachmentState > _colorBlendAttachments
void enableSampleShading()
std::vector< API::ShaderModule > _shaderModules
InputBinding addInputBinding(uint32_t stride, VkVertexInputRate inputRate=VK_VERTEX_INPUT_RATE_VERTEX)
void setCullMode(VkCullModeFlagBits cullMode)
bool build(API::ShaderModule &instance, VkResult *returnResult=nullptr)
void setLineWidth(float lineWidth)
std::vector< VkVertexInputBindingDescription > _inputBindings
DepthStencilState(const DepthStencilState &)=default
VkPipelineDepthStencilStateCreateInfo _depthStencilState
void setDynamicStates(const std::set< VkDynamicState > &dynamicStates)
API::PipelineLayout _pipelineLayout
void setBlendConstants(const float blendConstants[4])
ColorBlendState getColorBlendState()
GraphicsPipeline & _graphicPipelineBuilder
void setShader(VkShaderStageFlagBits stage, const char *entry, API::ShaderModule shaderModule)
bool setShaderFromData(VkShaderStageFlagBits stage, const char *entry, const std::vector< uint32_t > &data)
DepthStencilState getDepthStencilState()
void loadFromData(const std::vector< uint32_t > &data)