Skip to content

Commit 3e3b033

Browse files
Updates to match API version 240056
1 parent d8ee7b9 commit 3e3b033

25 files changed

Lines changed: 154 additions & 97 deletions

File tree

Samples/Atmosphere/src/Terrain/EarthHemisphere.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,8 @@ void EarthHemsiphere::RenderNormalMap(IRenderDevice* pDevice,
576576
RefCntAutoPtr<IShader> pGenerateNormalMapPS;
577577
pDevice->CreateShader(ShaderCI, &pGenerateNormalMapPS);
578578

579-
PipelineStateDesc PSODesc;
579+
PipelineStateCreateInfo PSOCreateInfo;
580+
PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
580581

581582
PSODesc.ResourceLayout.DefaultVariableType = SHADER_RESOURCE_VARIABLE_TYPE_STATIC;
582583
// clang-format off
@@ -604,7 +605,7 @@ void EarthHemsiphere::RenderNormalMap(IRenderDevice* pDevice,
604605
GraphicsPipeline.RTVFormats[0] = TEX_FORMAT_RG8_UNORM;
605606
GraphicsPipeline.PrimitiveTopology = PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
606607
RefCntAutoPtr<IPipelineState> pRenderNormalMapPSO;
607-
pDevice->CreatePipelineState(PSODesc, &pRenderNormalMapPSO);
608+
pDevice->CreatePipelineState(PSOCreateInfo, &pRenderNormalMapPSO);
608609
pRenderNormalMapPSO->BindStaticResources(SHADER_TYPE_VERTEX | SHADER_TYPE_PIXEL, m_pResMapping, BIND_SHADER_RESOURCES_VERIFY_ALL_RESOLVED);
609610

610611
RefCntAutoPtr<IShaderResourceBinding> pRenderNormalMapSRB;
@@ -753,7 +754,9 @@ void EarthHemsiphere::Create(class ElevationDataSource* pDataSource,
753754
RefCntAutoPtr<IShader> pHemisphereZOnlyVS;
754755
pDevice->CreateShader(ShaderCI, &pHemisphereZOnlyVS);
755756

756-
PipelineStateDesc PSODesc;
757+
PipelineStateCreateInfo PSOCreateInfo;
758+
PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
759+
757760
PSODesc.Name = "Render Hemisphere Z Only";
758761
PSODesc.ResourceLayout.DefaultVariableType = SHADER_RESOURCE_VARIABLE_TYPE_STATIC;
759762
auto& GraphicsPipeline = PSODesc.GraphicsPipeline;
@@ -773,7 +776,7 @@ void EarthHemsiphere::Create(class ElevationDataSource* pDataSource,
773776
GraphicsPipeline.DSVFormat = m_Params.ShadowMapFormat;
774777
GraphicsPipeline.PrimitiveTopology = PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
775778
GraphicsPipeline.pVS = pHemisphereZOnlyVS;
776-
pDevice->CreatePipelineState(PSODesc, &m_pHemisphereZOnlyPSO);
779+
pDevice->CreatePipelineState(PSOCreateInfo, &m_pHemisphereZOnlyPSO);
777780
m_pHemisphereZOnlyPSO->BindStaticResources(SHADER_TYPE_VERTEX | SHADER_TYPE_PIXEL, m_pResMapping, BIND_SHADER_RESOURCES_VERIFY_ALL_RESOLVED);
778781
m_pHemisphereZOnlyPSO->CreateShaderResourceBinding(&m_pHemisphereZOnlySRB, true);
779782
}
@@ -880,7 +883,9 @@ void EarthHemsiphere::Render(IDeviceContext* pContext,
880883
{0, 0, 3, VT_FLOAT32},
881884
{1, 0, 2, VT_FLOAT32}};
882885

883-
PipelineStateDesc PSODesc;
886+
PipelineStateCreateInfo PSOCreateInfo;
887+
PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
888+
884889
PSODesc.Name = "RenderHemisphere";
885890

886891
// clang-format off
@@ -913,7 +918,7 @@ void EarthHemsiphere::Render(IDeviceContext* pContext,
913918
GraphicsPipeline.NumRenderTargets = 1;
914919
GraphicsPipeline.DSVFormat = TEX_FORMAT_D32_FLOAT;
915920
GraphicsPipeline.PrimitiveTopology = PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
916-
m_pDevice->CreatePipelineState(PSODesc, &m_pHemispherePSO);
921+
m_pDevice->CreatePipelineState(PSOCreateInfo, &m_pHemispherePSO);
917922
m_pHemispherePSO->BindStaticResources(SHADER_TYPE_VERTEX | SHADER_TYPE_PIXEL, m_pResMapping, BIND_SHADER_RESOURCES_VERIFY_ALL_RESOLVED);
918923
m_pHemispherePSO->CreateShaderResourceBinding(&m_pHemisphereSRB, true);
919924
m_pHemisphereSRB->BindResources(SHADER_TYPE_VERTEX, m_pResMapping, BIND_SHADER_RESOURCES_KEEP_EXISTING);

Samples/GLTFViewer/src/GLTFViewer.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,9 @@ void GLTFViewer::CreateEnvMapPSO()
299299
RefCntAutoPtr<IShader> pPS;
300300
m_pDevice->CreateShader(ShaderCI, &pPS);
301301

302-
PipelineStateDesc PSODesc;
302+
PipelineStateCreateInfo PSOCreateInfo;
303+
PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
304+
303305
PSODesc.ResourceLayout.DefaultVariableType = SHADER_RESOURCE_VARIABLE_TYPE_MUTABLE;
304306

305307
// clang-format off
@@ -331,7 +333,7 @@ void GLTFViewer::CreateEnvMapPSO()
331333
PSODesc.GraphicsPipeline.PrimitiveTopology = PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
332334
PSODesc.GraphicsPipeline.DepthStencilDesc.DepthFunc = COMPARISON_FUNC_LESS_EQUAL;
333335

334-
m_pDevice->CreatePipelineState(PSODesc, &m_EnvMapPSO);
336+
m_pDevice->CreatePipelineState(PSOCreateInfo, &m_EnvMapPSO);
335337
m_EnvMapPSO->GetStaticVariableByName(SHADER_TYPE_PIXEL, "cbCameraAttribs")->Set(m_CameraAttribsCB);
336338
m_EnvMapPSO->GetStaticVariableByName(SHADER_TYPE_PIXEL, "cbEnvMapRenderAttribs")->Set(m_EnvMapRenderAttribsCB);
337339
CreateEnvMapSRB();

Samples/NuklearDemo/src/NkDiligent.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,10 @@ NK_API struct nk_diligent_context* nk_diligent_init(IRenderDevice* device,
183183

184184
nk_buffer_init_default(&nk_dlg_ctx->cmds);
185185

186-
PipelineStateDesc PSODesc;
187-
auto& GraphicsPipeline = PSODesc.GraphicsPipeline;
186+
PipelineStateCreateInfo PSOCreateInfo;
187+
PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
188+
GraphicsPipelineDesc& GraphicsPipeline = PSODesc.GraphicsPipeline;
189+
188190
GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_NONE;
189191
GraphicsPipeline.RasterizerDesc.ScissorEnable = True;
190192
GraphicsPipeline.DepthStencilDesc.DepthEnable = False;
@@ -270,7 +272,7 @@ NK_API struct nk_diligent_context* nk_diligent_init(IRenderDevice* device,
270272
GraphicsPipeline.pVS = pVS;
271273
GraphicsPipeline.pPS = pPS;
272274

273-
device->CreatePipelineState(PSODesc, &nk_dlg_ctx->pso);
275+
device->CreatePipelineState(PSOCreateInfo, &nk_dlg_ctx->pso);
274276
nk_dlg_ctx->pso->GetStaticVariableByName(SHADER_TYPE_VERTEX, "buffer0")->Set(nk_dlg_ctx->const_buffer);
275277

276278
{

Samples/Shadows/src/ShadowsSample.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,9 @@ void ShadowsSample::CreatePipelineStates()
350350
m_RenderMeshShadowPSO.clear();
351351
for (Uint32 vb = 0; vb < m_Mesh.GetNumVBs(); ++vb)
352352
{
353-
PipelineStateDesc PSODesc;
353+
PipelineStateCreateInfo PSOCreateInfo;
354+
PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
355+
354356
std::vector<LayoutElement> Elements;
355357
auto& InputLayout = PSODesc.GraphicsPipeline.InputLayout;
356358
DXSDKMESH_VERTEX_ELEMENTtoInputLayoutDesc(m_Mesh.VBElements(vb), m_Mesh.GetVertexStride(vb), InputLayout, Elements);
@@ -403,7 +405,7 @@ void ShadowsSample::CreatePipelineStates()
403405
PSODesc.GraphicsPipeline.DepthStencilDesc.DepthFunc = COMPARISON_FUNC_LESS_EQUAL;
404406

405407
RefCntAutoPtr<IPipelineState> pRenderMeshPSO;
406-
m_pDevice->CreatePipelineState(PSODesc, &pRenderMeshPSO);
408+
m_pDevice->CreatePipelineState(PSOCreateInfo, &pRenderMeshPSO);
407409
// clang-format off
408410
pRenderMeshPSO->GetStaticVariableByName(SHADER_TYPE_VERTEX, "cbCameraAttribs")->Set(m_CameraAttribsCB);
409411
pRenderMeshPSO->GetStaticVariableByName(SHADER_TYPE_PIXEL, "cbLightAttribs")->Set(m_LightAttribsCB);
@@ -427,7 +429,7 @@ void ShadowsSample::CreatePipelineStates()
427429
PSODesc.ResourceLayout.Variables = nullptr;
428430
PSODesc.ResourceLayout.NumVariables = 0;
429431
RefCntAutoPtr<IPipelineState> pRenderMeshShadowPSO;
430-
m_pDevice->CreatePipelineState(PSODesc, &pRenderMeshShadowPSO);
432+
m_pDevice->CreatePipelineState(PSOCreateInfo, &pRenderMeshShadowPSO);
431433
pRenderMeshShadowPSO->GetStaticVariableByName(SHADER_TYPE_VERTEX, "cbCameraAttribs")->Set(m_CameraAttribsCB);
432434

433435
m_RenderMeshPSO.emplace_back(std::move(pRenderMeshPSO));

Tutorials/Common/src/TexturedCube.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ RefCntAutoPtr<IPipelineState> CreatePipelineState(IRenderDevice*
158158
Uint32 NumLayoutElements /*= 0*/,
159159
Uint8 SampleCount /*= 1*/)
160160
{
161-
PipelineStateDesc PSODesc;
161+
PipelineStateCreateInfo PSOCreateInfo;
162+
PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
162163

163164
// This is a graphics pipeline
164165
PSODesc.IsComputePipeline = false;
@@ -261,7 +262,7 @@ RefCntAutoPtr<IPipelineState> CreatePipelineState(IRenderDevice*
261262
PSODesc.ResourceLayout.NumStaticSamplers = _countof(StaticSamplers);
262263

263264
RefCntAutoPtr<IPipelineState> pPSO;
264-
pDevice->CreatePipelineState(PSODesc, &pPSO);
265+
pDevice->CreatePipelineState(PSOCreateInfo, &pPSO);
265266
return pPSO;
266267
}
267268

Tutorials/Tutorial00_HelloLinux/src/Tutorial00_HelloLinux.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,9 @@ class Tutorial00App
224224
{
225225
// Pipeline state object encompasses configuration of all GPU stages
226226

227-
PipelineStateDesc PSODesc;
227+
PipelineStateCreateInfo PSOCreateInfo;
228+
PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
229+
228230
// Pipeline state name is used by the engine to report issues
229231
// It is always a good idea to give objects descriptive names
230232
PSODesc.Name = "Simple triangle PSO";
@@ -273,7 +275,7 @@ class Tutorial00App
273275
// Finally, create the pipeline state
274276
PSODesc.GraphicsPipeline.pVS = pVS;
275277
PSODesc.GraphicsPipeline.pPS = pPS;
276-
m_pDevice->CreatePipelineState(PSODesc, &m_pPSO);
278+
m_pDevice->CreatePipelineState(PSOCreateInfo, &m_pPSO);
277279
}
278280

279281
void Render()

Tutorials/Tutorial00_HelloWin32/src/Tutorial00_HelloWin32.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,9 @@ class Tutorial00App
303303
{
304304
// Pipeline state object encompasses configuration of all GPU stages
305305

306-
PipelineStateDesc PSODesc;
306+
PipelineStateCreateInfo PSOCreateInfo;
307+
PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
308+
307309
// Pipeline state name is used by the engine to report issues.
308310
// It is always a good idea to give objects descriptive names.
309311
PSODesc.Name = "Simple triangle PSO";
@@ -355,7 +357,7 @@ class Tutorial00App
355357
// Finally, create the pipeline state
356358
PSODesc.GraphicsPipeline.pVS = pVS;
357359
PSODesc.GraphicsPipeline.pPS = pPS;
358-
m_pDevice->CreatePipelineState(PSODesc, &m_pPSO);
360+
m_pDevice->CreatePipelineState(PSOCreateInfo, &m_pPSO);
359361
}
360362

361363
void Render()

Tutorials/Tutorial01_HelloTriangle/readme.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,12 @@ void main(in PSInput PSIn,
6262
## Initializing the Pipeline State
6363

6464
Pipeline state is the object that encompasses the configuration of all GPU stages. To create a pipeline state,
65-
populate `PipelineStateDesc` structure:
65+
populate `PipelineStateCreateInfo` structure. The most important member of the structure that we will need to
66+
initialize is `PSODesc`:
6667

6768
```cpp
68-
PipelineStateDesc PSODesc;
69+
PipelineStateCreateInfo PSOCreateInfo;
70+
PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
6971
```
7072

7173
Start by giving the PSO a name. It is always a good idea to give all objects descriptive names as
@@ -161,7 +163,7 @@ Finally, we set the shaders in the `PSODesc` and create the pipeline state:
161163
```cpp
162164
PSODesc.GraphicsPipeline.pVS = pVS;
163165
PSODesc.GraphicsPipeline.pPS = pPS;
164-
pDevice->CreatePipelineState(PSODesc, &m_pPSO);
166+
pDevice->CreatePipelineState(PSOCreateInfo, &m_pPSO);
165167
```
166168
167169
The pipeline state keeps references to the shader objects, so the app does not need to keep the references

Tutorials/Tutorial01_HelloTriangle/src/Tutorial01_HelloTriangle.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ void Tutorial01_HelloTriangle::Initialize(const SampleInitInfo& InitInfo)
9393

9494
// Pipeline state object encompasses configuration of all GPU stages
9595

96-
PipelineStateDesc PSODesc;
96+
PipelineStateCreateInfo PSOCreateInfo;
97+
PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
98+
9799
// Pipeline state name is used by the engine to report issues.
98100
// It is always a good idea to give objects descriptive names.
99101
PSODesc.Name = "Simple triangle PSO";
@@ -145,7 +147,7 @@ void Tutorial01_HelloTriangle::Initialize(const SampleInitInfo& InitInfo)
145147
// Finally, create the pipeline state
146148
PSODesc.GraphicsPipeline.pVS = pVS;
147149
PSODesc.GraphicsPipeline.pPS = pPS;
148-
m_pDevice->CreatePipelineState(PSODesc, &m_pPSO);
150+
m_pDevice->CreatePipelineState(PSOCreateInfo, &m_pPSO);
149151
}
150152

151153
// Render a frame

Tutorials/Tutorial02_Cube/src/Tutorial02_Cube.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ void Tutorial02_Cube::CreatePipelineState()
4141
{
4242
// Pipeline state object encompasses configuration of all GPU stages
4343

44-
PipelineStateDesc PSODesc;
44+
PipelineStateCreateInfo PSOCreateInfo;
45+
PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
46+
4547
// Pipeline state name is used by the engine to report issues.
4648
// It is always a good idea to give objects descriptive names.
4749
PSODesc.Name = "Cube PSO";
@@ -125,7 +127,7 @@ void Tutorial02_Cube::CreatePipelineState()
125127
// Define variable type that will be used by default
126128
PSODesc.ResourceLayout.DefaultVariableType = SHADER_RESOURCE_VARIABLE_TYPE_STATIC;
127129

128-
m_pDevice->CreatePipelineState(PSODesc, &m_pPSO);
130+
m_pDevice->CreatePipelineState(PSOCreateInfo, &m_pPSO);
129131

130132
// Since we did not explcitly specify the type for 'Constants' variable, default
131133
// type (SHADER_RESOURCE_VARIABLE_TYPE_STATIC) will be used. Static variables never

0 commit comments

Comments
 (0)