diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2020-10-19 01:50:01 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2020-10-19 01:50:01 +0000 |
| commit | 170f13b9c2a2ca17d13e848b037d273abd9efcf5 (patch) | |
| tree | bcf49568f1aa732044516e6c295ef4fd44e2bb7d /unityplugin/GhostCubeScene/src | |
| parent | Updated core (diff) | |
| download | DiligentEngine-170f13b9c2a2ca17d13e848b037d273abd9efcf5.tar.gz DiligentEngine-170f13b9c2a2ca17d13e848b037d273abd9efcf5.zip | |
PSO creation refactoring (API240075)
Diffstat (limited to 'unityplugin/GhostCubeScene/src')
| -rw-r--r-- | unityplugin/GhostCubeScene/src/GhostCubeScene.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/unityplugin/GhostCubeScene/src/GhostCubeScene.cpp b/unityplugin/GhostCubeScene/src/GhostCubeScene.cpp index 3b63cdf..8586090 100644 --- a/unityplugin/GhostCubeScene/src/GhostCubeScene.cpp +++ b/unityplugin/GhostCubeScene/src/GhostCubeScene.cpp @@ -86,18 +86,19 @@ void GhostCubeScene::OnGraphicsInitialized() const auto &SCDesc = m_DiligentGraphics->GetSwapChain()->GetDesc(); auto UseReverseZ = m_DiligentGraphics->UsesReverseZ(); - PipelineStateCreateInfo PSOCreateInfo; - PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc; + GraphicsPipelineStateCreateInfo PSOCreateInfo; + PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc; + GraphicsPipelineDesc& GraphicsPipeline = PSOCreateInfo.GraphicsPipeline; PSODesc.PipelineType = PIPELINE_TYPE_GRAPHICS; PSODesc.Name = "Mirror PSO"; - PSODesc.GraphicsPipeline.NumRenderTargets = 1; + GraphicsPipeline.NumRenderTargets = 1; - PSODesc.GraphicsPipeline.RTVFormats[0] = SCDesc.ColorBufferFormat; - PSODesc.GraphicsPipeline.DSVFormat = SCDesc.DepthBufferFormat; - PSODesc.GraphicsPipeline.PrimitiveTopology = PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP; - PSODesc.GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_BACK; - PSODesc.GraphicsPipeline.DepthStencilDesc.DepthFunc = UseReverseZ ? COMPARISON_FUNC_GREATER_EQUAL : COMPARISON_FUNC_LESS_EQUAL; + GraphicsPipeline.RTVFormats[0] = SCDesc.ColorBufferFormat; + GraphicsPipeline.DSVFormat = SCDesc.DepthBufferFormat; + GraphicsPipeline.PrimitiveTopology = PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP; + GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_BACK; + GraphicsPipeline.DepthStencilDesc.DepthFunc = UseReverseZ ? COMPARISON_FUNC_GREATER_EQUAL : COMPARISON_FUNC_LESS_EQUAL; ShaderCreateInfo ShaderCI; RefCntAutoPtr<IShaderSourceInputStreamFactory> pShaderSourceFactory; @@ -135,9 +136,9 @@ void GhostCubeScene::OnGraphicsInitialized() PSODesc.ResourceLayout.StaticSamplers = StaticSamplers; PSODesc.ResourceLayout.NumStaticSamplers = _countof(StaticSamplers); - PSODesc.GraphicsPipeline.pVS = pVS; - PSODesc.GraphicsPipeline.pPS = pPS; - pDevice->CreatePipelineState(PSOCreateInfo, &m_pMirrorPSO); + PSOCreateInfo.pVS = pVS; + PSOCreateInfo.pPS = pPS; + pDevice->CreateGraphicsPipelineState(PSOCreateInfo, &m_pMirrorPSO); m_pMirrorPSO->GetStaticVariableByName(SHADER_TYPE_VERTEX, "Constants")->Set(m_pMirrorVSConstants); m_pMirrorPSO->GetStaticVariableByName(SHADER_TYPE_PIXEL, "g_tex2Reflection")->Set(m_pRenderTarget->GetDefaultView(TEXTURE_VIEW_SHADER_RESOURCE)); m_pMirrorPSO->CreateShaderResourceBinding(&m_pMirrorSRB, true); |
