//============================================================================== void PipelineImpl::initGraphics(const PipelineInitInfo& init) { FilledGraphicsPipelineCreateInfo ci = FILLED; ci.pStages = &ci.m_stages[0]; initShaders(init, ci); // Init sub-states ci.pVertexInputState = initVertexStage(init.m_vertex, ci.m_vertex); ci.pInputAssemblyState = initInputAssemblyState(init.m_inputAssembler, ci.m_ia); ci.pTessellationState = initTessellationState(init.m_tessellation, ci.m_tess); ci.pViewportState = initViewportState(ci.m_vp); ci.pRasterizationState = initRasterizerState(init.m_rasterizer, ci.m_rast); ci.pMultisampleState = initMsState(ci.m_ms); ci.pDepthStencilState = initDsState(init.m_depthStencil, ci.m_ds); ci.pColorBlendState = initColorState(init.m_color, ci.m_color); ci.pDynamicState = nullptr; // No dynamic state as static at the moment // Finalize ci.layout = getGrManagerImpl().m_globalPipelineLayout; ci.renderPass = getGrManagerImpl().getOrCreateCompatibleRenderPass(init); ci.basePipelineHandle = VK_NULL_HANDLE; ANKI_VK_CHECK(vkCreateGraphicsPipelines( getDevice(), nullptr, 1, &ci, nullptr, &m_handle)); }
Error PipelineImpl::init(const PipelineInitInfo& init) { m_in = init; ANKI_CHECK(createGlPipeline()); if(!m_compute) { initVertexState(); initInputAssemblerState(); initTessellationState(); initRasterizerState(); initDepthStencilState(); initColorState(); } return ErrorCode::NONE; }