git.s-ol.nu ~forks/DiligentFX / 0fe2f25
Fixed compilation after PSO refactoring azhirnov 1 year, 7 days ago
3 changed file(s) with 95 addition(s) and 93 deletion(s). Raw diff Collapse all Expand all
418418
419419 if (Tech.PSO)
420420 {
421 if (Tech.PSO->GetDesc().GraphicsPipeline.RTVFormats[0] != FilterableShadowMapFmt)
421 if (Tech.PSO->GetGraphicsPipelineDesc().RTVFormats[0] != FilterableShadowMapFmt)
422422 Tech = ShadowConversionTechnique();
423423 else
424424 continue; // Already up to date
437437 m_pDevice->CreateShader(VertShaderCI, &pScreenSizeTriVS);
438438 }
439439
440 PipelineStateCreateInfo PSOCreateInfo;
441 PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
440 GraphicsPipelineStateCreateInfo PSOCreateInfo;
441 PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
442442
443443 ShaderCreateInfo ShaderCI;
444444 ShaderCI.Desc.ShaderType = SHADER_TYPE_PIXEL;
485485 PSODesc.ResourceLayout.Variables = Variables;
486486 PSODesc.ResourceLayout.NumVariables = _countof(Variables);
487487
488 auto& GraphicsPipeline = PSODesc.GraphicsPipeline;
488 auto& GraphicsPipeline = PSOCreateInfo.GraphicsPipeline;
489489
490490 GraphicsPipeline.RasterizerDesc.FillMode = FILL_MODE_SOLID;
491491 GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_NONE;
492492 GraphicsPipeline.DepthStencilDesc.DepthEnable = False;
493 GraphicsPipeline.pVS = pScreenSizeTriVS;
494 GraphicsPipeline.pPS = pVSMHorzPS;
493 PSOCreateInfo.pVS = pScreenSizeTriVS;
494 PSOCreateInfo.pPS = pVSMHorzPS;
495495 GraphicsPipeline.PrimitiveTopology = PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
496496 GraphicsPipeline.NumRenderTargets = 1;
497497 GraphicsPipeline.RTVFormats[0] = FilterableShadowMapFmt;
498498
499 m_pDevice->CreatePipelineState(PSOCreateInfo, &Tech.PSO);
499 m_pDevice->CreateGraphicsPipelineState(PSOCreateInfo, &Tech.PSO);
500500 Tech.PSO->GetStaticVariableByName(SHADER_TYPE_PIXEL, "cbConversionAttribs")->Set(m_pConversionAttribsBuffer);
501501
502 if (m_BlurVertTech.PSO && m_BlurVertTech.PSO->GetDesc().GraphicsPipeline.RTVFormats[0] != FilterableShadowMapFmt)
502 if (m_BlurVertTech.PSO && m_BlurVertTech.PSO->GetGraphicsPipelineDesc().RTVFormats[0] != FilterableShadowMapFmt)
503503 m_BlurVertTech.PSO.Release();
504504
505505 if (!m_BlurVertTech.PSO)
509509 PSODesc.Name = "Vertical blur pass PSO";
510510 RefCntAutoPtr<IShader> pVertBlurPS;
511511 m_pDevice->CreateShader(ShaderCI, &pVertBlurPS);
512 GraphicsPipeline.pPS = pVertBlurPS;
513 m_pDevice->CreatePipelineState(PSOCreateInfo, &m_BlurVertTech.PSO);
512 PSOCreateInfo.pPS = pVertBlurPS;
513 m_pDevice->CreateGraphicsPipelineState(PSOCreateInfo, &m_BlurVertTech.PSO);
514514 m_BlurVertTech.PSO->GetStaticVariableByName(SHADER_TYPE_PIXEL, "cbConversionAttribs")->Set(m_pConversionAttribsBuffer);
515515 }
516516 }
159159
160160 RefCntAutoPtr<IPipelineState> PrecomputeBRDF_PSO;
161161 {
162 PipelineStateCreateInfo PSOCreateInfo;
163 PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
162 GraphicsPipelineStateCreateInfo PSOCreateInfo;
163 PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
164164
165165 PSODesc.Name = "Precompute GLTF BRDF LUT PSO";
166166
167 PSODesc.PipelineType = PIPELINE_TYPE_GRAPHICS;
168 PSODesc.GraphicsPipeline.NumRenderTargets = 1;
169 PSODesc.GraphicsPipeline.RTVFormats[0] = TexDesc.Format;
170 PSODesc.GraphicsPipeline.PrimitiveTopology = PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
171 PSODesc.GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_NONE;
172 PSODesc.GraphicsPipeline.DepthStencilDesc.DepthEnable = False;
167 PSODesc.PipelineType = PIPELINE_TYPE_GRAPHICS;
168 PSOCreateInfo.GraphicsPipeline.NumRenderTargets = 1;
169 PSOCreateInfo.GraphicsPipeline.RTVFormats[0] = TexDesc.Format;
170 PSOCreateInfo.GraphicsPipeline.PrimitiveTopology = PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
171 PSOCreateInfo.GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_NONE;
172 PSOCreateInfo.GraphicsPipeline.DepthStencilDesc.DepthEnable = False;
173173
174174 ShaderCreateInfo ShaderCI;
175175 ShaderCI.SourceLanguage = SHADER_SOURCE_LANGUAGE_HLSL;
195195 }
196196
197197 // Finally, create the pipeline state
198 PSODesc.GraphicsPipeline.pVS = pVS;
199 PSODesc.GraphicsPipeline.pPS = pPS;
200 pDevice->CreatePipelineState(PSOCreateInfo, &PrecomputeBRDF_PSO);
198 PSOCreateInfo.pVS = pVS;
199 PSOCreateInfo.pPS = pPS;
200 pDevice->CreateGraphicsPipelineState(PSOCreateInfo, &PrecomputeBRDF_PSO);
201201 }
202202 pCtx->SetPipelineState(PrecomputeBRDF_PSO);
203203
217217
218218 void GLTF_PBR_Renderer::CreatePSO(IRenderDevice* pDevice)
219219 {
220 PipelineStateCreateInfo PSOCreateInfo;
221 PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
220 GraphicsPipelineStateCreateInfo PSOCreateInfo;
221 PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
222222
223223 PSODesc.Name = "Render GLTF PBR PSO";
224224
225 PSODesc.PipelineType = PIPELINE_TYPE_GRAPHICS;
226 PSODesc.GraphicsPipeline.NumRenderTargets = 1;
227 PSODesc.GraphicsPipeline.RTVFormats[0] = m_Settings.RTVFmt;
228 PSODesc.GraphicsPipeline.DSVFormat = m_Settings.DSVFmt;
229 PSODesc.GraphicsPipeline.PrimitiveTopology = PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
230 PSODesc.GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_BACK;
231 PSODesc.GraphicsPipeline.RasterizerDesc.FrontCounterClockwise = m_Settings.FrontCCW;
225 PSODesc.PipelineType = PIPELINE_TYPE_GRAPHICS;
226 PSOCreateInfo.GraphicsPipeline.NumRenderTargets = 1;
227 PSOCreateInfo.GraphicsPipeline.RTVFormats[0] = m_Settings.RTVFmt;
228 PSOCreateInfo.GraphicsPipeline.DSVFormat = m_Settings.DSVFmt;
229 PSOCreateInfo.GraphicsPipeline.PrimitiveTopology = PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
230 PSOCreateInfo.GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_BACK;
231 PSOCreateInfo.GraphicsPipeline.RasterizerDesc.FrontCounterClockwise = m_Settings.FrontCCW;
232232
233233 ShaderCreateInfo ShaderCI;
234234 ShaderCI.SourceLanguage = SHADER_SOURCE_LANGUAGE_HLSL;
273273 {5, 1, 4, VT_FLOAT32} //float4 Weight0 : ATTRIB5;
274274 };
275275 // clang-format on
276 PSODesc.GraphicsPipeline.InputLayout.LayoutElements = Inputs;
277 PSODesc.GraphicsPipeline.InputLayout.NumElements = _countof(Inputs);
276 PSOCreateInfo.GraphicsPipeline.InputLayout.LayoutElements = Inputs;
277 PSOCreateInfo.GraphicsPipeline.InputLayout.NumElements = _countof(Inputs);
278278
279279 PSODesc.ResourceLayout.DefaultVariableType = SHADER_RESOURCE_VARIABLE_TYPE_MUTABLE;
280280 // clang-format off
321321 PSODesc.ResourceLayout.NumStaticSamplers = static_cast<Uint32>(StaticSamplers.size());
322322 PSODesc.ResourceLayout.StaticSamplers = !StaticSamplers.empty() ? StaticSamplers.data() : nullptr;
323323
324 PSODesc.GraphicsPipeline.pVS = pVS;
325 PSODesc.GraphicsPipeline.pPS = pPS;
324 PSOCreateInfo.pVS = pVS;
325 PSOCreateInfo.pPS = pPS;
326326
327327 {
328328 PSOKey Key{GLTF::Material::ALPHAMODE_OPAQUE, false};
329329
330330 RefCntAutoPtr<IPipelineState> pSingleSidedOpaquePSO;
331 pDevice->CreatePipelineState(PSOCreateInfo, &pSingleSidedOpaquePSO);
331 pDevice->CreateGraphicsPipelineState(PSOCreateInfo, &pSingleSidedOpaquePSO);
332332 AddPSO(Key, std::move(pSingleSidedOpaquePSO));
333333
334 PSODesc.GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_NONE;
334 PSOCreateInfo.GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_NONE;
335335
336336 Key.DoubleSided = true;
337337
338338 RefCntAutoPtr<IPipelineState> pDobleSidedOpaquePSO;
339 pDevice->CreatePipelineState(PSOCreateInfo, &pDobleSidedOpaquePSO);
339 pDevice->CreateGraphicsPipelineState(PSOCreateInfo, &pDobleSidedOpaquePSO);
340340 AddPSO(Key, std::move(pDobleSidedOpaquePSO));
341341 }
342342
343 PSODesc.GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_BACK;
344
345 auto& RT0 = PSODesc.GraphicsPipeline.BlendDesc.RenderTargets[0];
343 PSOCreateInfo.GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_BACK;
344
345 auto& RT0 = PSOCreateInfo.GraphicsPipeline.BlendDesc.RenderTargets[0];
346346 RT0.BlendEnable = true;
347347 RT0.SrcBlend = BLEND_FACTOR_SRC_ALPHA;
348348 RT0.DestBlend = BLEND_FACTOR_INV_SRC_ALPHA;
355355 PSOKey Key{GLTF::Material::ALPHAMODE_BLEND, false};
356356
357357 RefCntAutoPtr<IPipelineState> pSingleSidedBlendPSO;
358 pDevice->CreatePipelineState(PSOCreateInfo, &pSingleSidedBlendPSO);
358 pDevice->CreateGraphicsPipelineState(PSOCreateInfo, &pSingleSidedBlendPSO);
359359 AddPSO(Key, std::move(pSingleSidedBlendPSO));
360360
361 PSODesc.GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_NONE;
361 PSOCreateInfo.GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_NONE;
362362
363363 Key.DoubleSided = true;
364364
365365 RefCntAutoPtr<IPipelineState> pDoubleSidedBlendPSO;
366 pDevice->CreatePipelineState(PSOCreateInfo, &pDoubleSidedBlendPSO);
366 pDevice->CreateGraphicsPipelineState(PSOCreateInfo, &pDoubleSidedBlendPSO);
367367 AddPSO(Key, std::move(pDoubleSidedBlendPSO));
368368 }
369369
522522 pDevice->CreateShader(ShaderCI, &pPS);
523523 }
524524
525 PipelineStateCreateInfo PSOCreateInfo;
526 PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
525 GraphicsPipelineStateCreateInfo PSOCreateInfo;
526 PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
527527
528528 PSODesc.Name = "Precompute irradiance cube PSO";
529529 PSODesc.PipelineType = PIPELINE_TYPE_GRAPHICS;
530530
531 PSODesc.GraphicsPipeline.NumRenderTargets = 1;
532 PSODesc.GraphicsPipeline.RTVFormats[0] = IrradianceCubeFmt;
533 PSODesc.GraphicsPipeline.PrimitiveTopology = PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
534 PSODesc.GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_NONE;
535 PSODesc.GraphicsPipeline.DepthStencilDesc.DepthEnable = False;
536 PSODesc.GraphicsPipeline.pVS = pVS;
537 PSODesc.GraphicsPipeline.pPS = pPS;
531 PSOCreateInfo.GraphicsPipeline.NumRenderTargets = 1;
532 PSOCreateInfo.GraphicsPipeline.RTVFormats[0] = IrradianceCubeFmt;
533 PSOCreateInfo.GraphicsPipeline.PrimitiveTopology = PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
534 PSOCreateInfo.GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_NONE;
535 PSOCreateInfo.GraphicsPipeline.DepthStencilDesc.DepthEnable = False;
536
537 PSOCreateInfo.pVS = pVS;
538 PSOCreateInfo.pPS = pPS;
538539
539540 PSODesc.ResourceLayout.DefaultVariableType = SHADER_RESOURCE_VARIABLE_TYPE_STATIC;
540541 // clang-format off
555556 PSODesc.ResourceLayout.NumStaticSamplers = _countof(StaticSamplers);
556557 PSODesc.ResourceLayout.StaticSamplers = StaticSamplers;
557558
558 pDevice->CreatePipelineState(PSOCreateInfo, &m_pPrecomputeIrradianceCubePSO);
559 pDevice->CreateGraphicsPipelineState(PSOCreateInfo, &m_pPrecomputeIrradianceCubePSO);
559560 m_pPrecomputeIrradianceCubePSO->GetStaticVariableByName(SHADER_TYPE_VERTEX, "cbTransform")->Set(m_PrecomputeEnvMapAttribsCB);
560561 m_pPrecomputeIrradianceCubePSO->CreateShaderResourceBinding(&m_pPrecomputeIrradianceCubeSRB, true);
561562 }
590591 pDevice->CreateShader(ShaderCI, &pPS);
591592 }
592593
593 PipelineStateCreateInfo PSOCreateInfo;
594 PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
594 GraphicsPipelineStateCreateInfo PSOCreateInfo;
595 PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
595596
596597 PSODesc.Name = "Prefilter environment map PSO";
597598 PSODesc.PipelineType = PIPELINE_TYPE_GRAPHICS;
598599
599 PSODesc.GraphicsPipeline.NumRenderTargets = 1;
600 PSODesc.GraphicsPipeline.RTVFormats[0] = PrefilteredEnvMapFmt;
601 PSODesc.GraphicsPipeline.PrimitiveTopology = PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
602 PSODesc.GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_NONE;
603 PSODesc.GraphicsPipeline.DepthStencilDesc.DepthEnable = False;
604 PSODesc.GraphicsPipeline.pVS = pVS;
605 PSODesc.GraphicsPipeline.pPS = pPS;
600 PSOCreateInfo.GraphicsPipeline.NumRenderTargets = 1;
601 PSOCreateInfo.GraphicsPipeline.RTVFormats[0] = PrefilteredEnvMapFmt;
602 PSOCreateInfo.GraphicsPipeline.PrimitiveTopology = PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
603 PSOCreateInfo.GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_NONE;
604 PSOCreateInfo.GraphicsPipeline.DepthStencilDesc.DepthEnable = False;
605
606 PSOCreateInfo.pVS = pVS;
607 PSOCreateInfo.pPS = pPS;
606608
607609 PSODesc.ResourceLayout.DefaultVariableType = SHADER_RESOURCE_VARIABLE_TYPE_STATIC;
608610 // clang-format off
623625 PSODesc.ResourceLayout.NumStaticSamplers = _countof(StaticSamplers);
624626 PSODesc.ResourceLayout.StaticSamplers = StaticSamplers;
625627
626 pDevice->CreatePipelineState(PSOCreateInfo, &m_pPrefilterEnvMapPSO);
628 pDevice->CreateGraphicsPipelineState(PSOCreateInfo, &m_pPrefilterEnvMapPSO);
627629 m_pPrefilterEnvMapPSO->GetStaticVariableByName(SHADER_TYPE_VERTEX, "cbTransform")->Set(m_PrecomputeEnvMapAttribsCB);
628630 m_pPrefilterEnvMapPSO->GetStaticVariableByName(SHADER_TYPE_PIXEL, "FilterAttribs")->Set(m_PrecomputeEnvMapAttribsCB);
629631 m_pPrefilterEnvMapPSO->CreateShaderResourceBinding(&m_pPrefilterEnvMapSRB, true);
187187 const DepthStencilStateDesc& DSSDesc = DSS_Default,
188188 const BlendStateDesc& BSDesc = BS_Default)
189189 {
190 PipelineStateCreateInfo PSOCreateInfo;
191 PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
190 GraphicsPipelineStateCreateInfo PSOCreateInfo;
191 PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
192192
193193 PSODesc.Name = PSOName;
194194 PSODesc.ResourceLayout = ResourceLayout;
195195
196 auto& GraphicsPipeline = PSODesc.GraphicsPipeline;
196 auto& GraphicsPipeline = PSOCreateInfo.GraphicsPipeline;
197197
198198 GraphicsPipeline.RasterizerDesc.FillMode = FILL_MODE_SOLID;
199199 GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_NONE;
200200 GraphicsPipeline.RasterizerDesc.FrontCounterClockwise = true;
201201 GraphicsPipeline.DepthStencilDesc = DSSDesc;
202202 GraphicsPipeline.BlendDesc = BSDesc;
203 GraphicsPipeline.pVS = VertexShader;
204 GraphicsPipeline.pPS = PixelShader;
203 PSOCreateInfo.pVS = VertexShader;
204 PSOCreateInfo.pPS = PixelShader;
205205 GraphicsPipeline.PrimitiveTopology = PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
206206 GraphicsPipeline.NumRenderTargets = NumRTVs;
207207 GraphicsPipeline.DSVFormat = DSVFmt;
210210
211211 PSO.Release();
212212 SRB.Release();
213 pDevice->CreatePipelineState(PSOCreateInfo, &PSO);
213 pDevice->CreateGraphicsPipelineState(PSOCreateInfo, &PSO);
214214 }
215215
216216 void EpipolarLightScattering::RenderTechnique::InitializeFullScreenTriangleTechnique(
232232 IShader* ComputeShader,
233233 const PipelineResourceLayoutDesc& ResourceLayout)
234234 {
235 PipelineStateCreateInfo PSOCreateInfo;
236 PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
237
238 PSODesc.Name = PSOName;
239 PSODesc.ResourceLayout = ResourceLayout;
240 PSODesc.PipelineType = PIPELINE_TYPE_COMPUTE;
241 PSODesc.ComputePipeline.pCS = ComputeShader;
235 ComputePipelineStateCreateInfo PSOCreateInfo;
236 PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
237
238 PSODesc.Name = PSOName;
239 PSODesc.ResourceLayout = ResourceLayout;
240 PSODesc.PipelineType = PIPELINE_TYPE_COMPUTE;
241 PSOCreateInfo.pCS = ComputeShader;
242242 PSO.Release();
243243 SRB.Release();
244 pDevice->CreatePipelineState(PSOCreateInfo, &PSO);
244 pDevice->CreateComputePipelineState(PSOCreateInfo, &PSO);
245245 }
246246
247247 void EpipolarLightScattering::RenderTechnique::PrepareSRB(IRenderDevice* pDevice, IResourceMapping* pResMapping, Uint32 Flags = BIND_SHADER_RESOURCES_KEEP_EXISTING | BIND_SHADER_RESOURCES_VERIFY_ALL_RESOLVED)
19661966 auto pRenderSampleLocationsPS = CreateShader(m_FrameAttribs.pDevice, "RenderSampling.fx", "RenderSampleLocationsPS",
19671967 SHADER_TYPE_PIXEL, Macros);
19681968
1969 PipelineStateCreateInfo PSOCreateInfo;
1970 PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
1969 GraphicsPipelineStateCreateInfo PSOCreateInfo;
1970 PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
19711971
19721972 PSODesc.ResourceLayout.DefaultVariableType = SHADER_RESOURCE_VARIABLE_TYPE_MUTABLE;
19731973 // clang-format off
19811981 PSODesc.ResourceLayout.NumVariables = _countof(Vars);
19821982
19831983 PSODesc.Name = "Render sample locations PSO";
1984 auto& GraphicsPipeline = PSODesc.GraphicsPipeline;
1984 auto& GraphicsPipeline = PSOCreateInfo.GraphicsPipeline;
19851985 GraphicsPipeline.RasterizerDesc.FillMode = FILL_MODE_SOLID;
19861986 GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_NONE;
19871987 GraphicsPipeline.RasterizerDesc.FrontCounterClockwise = true;
19881988 GraphicsPipeline.DepthStencilDesc = DSS_DisableDepth;
19891989 GraphicsPipeline.BlendDesc = BS_AlphaBlend;
1990 GraphicsPipeline.pVS = pRenderSampleLocationsVS;
1991 GraphicsPipeline.pPS = pRenderSampleLocationsPS;
1990 PSOCreateInfo.pVS = pRenderSampleLocationsVS;
1991 PSOCreateInfo.pPS = pRenderSampleLocationsPS;
19921992 GraphicsPipeline.NumRenderTargets = 1;
19931993 GraphicsPipeline.RTVFormats[0] = m_BackBufferFmt;
19941994 GraphicsPipeline.DSVFormat = m_DepthBufferFmt;
19951995 GraphicsPipeline.PrimitiveTopology = PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
1996 m_FrameAttribs.pDevice->CreatePipelineState(PSOCreateInfo, &RenderSampleLocationsTech.PSO);
1996 m_FrameAttribs.pDevice->CreateGraphicsPipelineState(PSOCreateInfo, &RenderSampleLocationsTech.PSO);
19971997 RenderSampleLocationsTech.PSO->BindStaticResources(SHADER_TYPE_VERTEX | SHADER_TYPE_PIXEL, m_pResMapping, BIND_SHADER_RESOURCES_VERIFY_ALL_RESOLVED);
19981998
19991999 RenderSampleLocationsTech.SRB.Release();
27502750 auto& RenderSunTech = m_RenderTech[RENDER_TECH_RENDER_SUN];
27512751 if (RenderSunTech.PSO)
27522752 {
2753 const auto& PSODesc = RenderSunTech.PSO->GetDesc();
2754 if (PSODesc.GraphicsPipeline.RTVFormats[0] != RTVFormat ||
2755 PSODesc.GraphicsPipeline.DSVFormat != DSVFormat ||
2756 PSODesc.GraphicsPipeline.SmplDesc.Count != SampleCount)
2753 const auto& GraphicsPipeline = RenderSunTech.PSO->GetGraphicsPipelineDesc();
2754 if (GraphicsPipeline.RTVFormats[0] != RTVFormat ||
2755 GraphicsPipeline.DSVFormat != DSVFormat ||
2756 GraphicsPipeline.SmplDesc.Count != SampleCount)
27572757 {
27582758 RenderSunTech.PSO.Release();
27592759 RenderSunTech.SRB.Release();
27652765 RefCntAutoPtr<IShader> pSunVS = CreateShader(m_FrameAttribs.pDevice, "Sun.fx", "SunVS", SHADER_TYPE_VERTEX);
27662766 RefCntAutoPtr<IShader> pSunPS = CreateShader(m_FrameAttribs.pDevice, "Sun.fx", "SunPS", SHADER_TYPE_PIXEL);
27672767
2768 PipelineStateCreateInfo PSOCreateInfo;
2769 PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
2768 GraphicsPipelineStateCreateInfo PSOCreateInfo;
2769 PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
27702770
27712771 PSODesc.ResourceLayout.DefaultVariableType = SHADER_RESOURCE_VARIABLE_TYPE_MUTABLE;
27722772 // clang-format off
27792779 PSODesc.ResourceLayout.NumVariables = _countof(Vars);
27802780
27812781 PSODesc.Name = "Render Sun";
2782 auto& GraphicsPipeline = PSODesc.GraphicsPipeline;
2782 auto& GraphicsPipeline = PSOCreateInfo.GraphicsPipeline;
27832783 GraphicsPipeline.RasterizerDesc.FillMode = FILL_MODE_SOLID;
27842784 GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_NONE;
27852785 GraphicsPipeline.RasterizerDesc.FrontCounterClockwise = true;
27862786 GraphicsPipeline.DepthStencilDesc = DSS_CmpEqNoWrites;
2787 GraphicsPipeline.pVS = pSunVS;
2788 GraphicsPipeline.pPS = pSunPS;
2787 PSOCreateInfo.pVS = pSunVS;
2788 PSOCreateInfo.pPS = pSunPS;
27892789 GraphicsPipeline.NumRenderTargets = 1;
27902790 GraphicsPipeline.RTVFormats[0] = RTVFormat;
27912791 GraphicsPipeline.DSVFormat = DSVFormat;
27922792 GraphicsPipeline.SmplDesc.Count = SampleCount;
27932793 GraphicsPipeline.PrimitiveTopology = PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
2794 m_FrameAttribs.pDevice->CreatePipelineState(PSOCreateInfo, &RenderSunTech.PSO);
2794 m_FrameAttribs.pDevice->CreateGraphicsPipelineState(PSOCreateInfo, &RenderSunTech.PSO);
27952795 RenderSunTech.PSO->BindStaticResources(SHADER_TYPE_VERTEX | SHADER_TYPE_PIXEL, m_pResMapping, BIND_SHADER_RESOURCES_VERIFY_ALL_RESOLVED);
27962796
27972797 RenderSunTech.SRBDependencyFlags = SRB_DEPENDENCY_CAMERA_ATTRIBS;