Constructor Function. Create VkPipeline.
Receive PipelineLayout from parameter.
Instance VkPipelineShaderStageCreateInfo.
Instance a VkGraphicsPipelineCreateInfo.
Create Pipeline.
Receive PipelineLayout from parameter.
Instance VkPipelineShaderStageCreateInfo.
Instance a VkGraphicsPipelineCreateInfo.
Create Pipeline.
400 {
402
407
411 std::vector<std::shared_ptr<VulkanShaderModule>> shaderModules;
412 {
414
415 for (auto& pair : shaders)
416 {
417 if (pair.first == "rchit") continue;
418
419 for (size_t i = 0; i < pair.second.size(); i++)
420 {
421 std::stringstream ss;
422 ss << pair.first << "." << pair.second[i];
423
424 shaderModules.push_back(ResourcePool<Shader>::Load<Shader>(ss.str(), pair.second[i], pair.first)->GetShaderModule());
425 }
426 }
427 }
428
432 std::vector<VkPipelineShaderStageCreateInfo> shaderStages;
433 for (size_t i = 0; i < shaderModules.size(); i++)
434 {
435 shaderStages.push_back(shaderModules[i]->GetShaderStageCreateInfo());
436 }
437
441 VkGraphicsPipelineCreateInfo pipelineInfo{};
442 pipelineInfo.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
443 pipelineInfo.flags = VK_PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV;
444 pipelineInfo.stageCount = static_cast<uint32_t>(shaderStages.size());
445 pipelineInfo.pStages = shaderStages.data();
446 pipelineInfo.pVertexInputState = nullptr;
447 pipelineInfo.pInputAssemblyState = nullptr;
448 pipelineInfo.pViewportState = &config.viewportInfo;
449 pipelineInfo.pRasterizationState = &config.rasterizationInfo;
450 pipelineInfo.pMultisampleState = &config.multisampleInfo;
451 pipelineInfo.pColorBlendState = &config.colorBlendInfo;
452 pipelineInfo.pDepthStencilState = &config.depthStencilInfo;
453 pipelineInfo.pDynamicState = &config.dynamicStateInfo;
454
456 pipelineInfo.renderPass = config.renderPass->Get();
457 pipelineInfo.subpass = config.subpass;
458
459 pipelineInfo.basePipelineIndex = -1;
460 pipelineInfo.basePipelineHandle = VK_NULL_HANDLE;
461
467 }
#define SPICES_PROFILE_ZONEN(...)
#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.