Constructor Function. Create VkPipeline.
Receive PipelineLayout from parameter.
Instance a VkGraphicsPipelineShaderGroupsCreateInfoNV.
Instance a VkGraphicsPipelineCreateInfo. Only pRasterizationState must be setted in pipeline reference.
Create Pipeline.
Receive PipelineLayout from parameter.
Instance a VkGraphicsPipelineShaderGroupsCreateInfoNV.
Instance a VkGraphicsPipelineCreateInfo. Only pRasterizationState must be setted in pipeline reference.
Create Pipeline.
566 {
568
573
579 const auto material = ResourcePool<Material>::Load<Material>(materialName, materialName);
580
581 std::stringstream ss;
582 ss << "mesh" << "." << material->GetShaderPath("mesh")[0];
583
584 VkPipelineShaderStageCreateInfo stage = ResourcePool<Shader>::Load<Shader>(ss.str(), material->GetShaderPath(
"mesh")[0],
ShaderStage::vert)->GetShaderModule()->GetShaderStageCreateInfo();
585
586
587 VkGraphicsShaderGroupCreateInfoNV group{};
588 group.sType = VK_STRUCTURE_TYPE_GRAPHICS_SHADER_GROUP_CREATE_INFO_NV;
589 group.stageCount = 1;
590 group.pStages = &stage;
591
595 VkGraphicsPipelineShaderGroupsCreateInfoNV groupsCreateInfo{};
596 groupsCreateInfo.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV;
597 groupsCreateInfo.pipelineCount = static_cast<uint32_t>(pipelineRef.size());
598 groupsCreateInfo.pPipelines = pipelineRef.data();
599 groupsCreateInfo.groupCount = 1;
600 groupsCreateInfo.pGroups = &group;
601
606 VkGraphicsPipelineCreateInfo pipelineInfo{};
607 pipelineInfo.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
608 pipelineInfo.flags = VK_PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV;
609 pipelineInfo.stageCount = 1;
610 pipelineInfo.pStages = &stage;
611 pipelineInfo.pVertexInputState = nullptr;
612 pipelineInfo.pInputAssemblyState = nullptr;
613 pipelineInfo.pViewportState = &config.viewportInfo;
614 pipelineInfo.pRasterizationState = &config.rasterizationInfo;
615 pipelineInfo.pMultisampleState = &config.multisampleInfo;
616 pipelineInfo.pColorBlendState = &config.colorBlendInfo;
617 pipelineInfo.pDepthStencilState = &config.depthStencilInfo;
618 pipelineInfo.pDynamicState = &config.dynamicStateInfo;
619
621 pipelineInfo.renderPass = config.renderPass->Get();
622 pipelineInfo.subpass = config.subpass;
623
624 pipelineInfo.basePipelineIndex = -1;
625 pipelineInfo.basePipelineHandle = VK_NULL_HANDLE;
626 pipelineInfo.pNext = &groupsCreateInfo;
627
633 }
#define SPICES_PROFILE_ZONE
#define VK_CHECK(expr)
Vulkan Check macro. Verify Vulkan API Effectiveness.
VulkanState & m_VulkanState
The global VulkanState Referenced from VulkanRenderBackend.
VulkanPipeline(VulkanState &vulkanState)
Constructor Function.
VkPipeline m_Pipeline
The VkPipeline.
VkPipelineLayout m_PipelineLayout
The VkPipelineLayout.