Skip to content

Commit 713a0b1

Browse files
committed
Filter out missing shader subobjects in D3D12 pipeline creation events
1 parent 1510e6a commit 713a0b1

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

source/d3d12/d3d12_device.cpp

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2402,32 +2402,38 @@ bool D3D12Device::invoke_create_and_init_pipeline_event(const D3D12_PIPELINE_STA
24022402
continue;
24032403
case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VS:
24042404
vs_desc = reshade::d3d12::convert_shader_desc(reinterpret_cast<const D3D12_PIPELINE_STATE_STREAM_VS *>(p)->data);
2405-
subobjects.push_back({ reshade::api::pipeline_subobject_type::vertex_shader, 1, &vs_desc });
2405+
if (vs_desc.code != nullptr)
2406+
subobjects.push_back({ reshade::api::pipeline_subobject_type::vertex_shader, 1, &vs_desc });
24062407
p += sizeof(D3D12_PIPELINE_STATE_STREAM_VS);
24072408
continue;
24082409
case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PS:
24092410
ps_desc = reshade::d3d12::convert_shader_desc(reinterpret_cast<const D3D12_PIPELINE_STATE_STREAM_PS *>(p)->data);
2410-
subobjects.push_back({ reshade::api::pipeline_subobject_type::pixel_shader, 1, &ps_desc });
2411+
if (ps_desc.code != nullptr)
2412+
subobjects.push_back({ reshade::api::pipeline_subobject_type::pixel_shader, 1, &ps_desc });
24112413
p += sizeof(D3D12_PIPELINE_STATE_STREAM_PS);
24122414
continue;
24132415
case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DS:
24142416
ds_desc = reshade::d3d12::convert_shader_desc(reinterpret_cast<const D3D12_PIPELINE_STATE_STREAM_DS *>(p)->data);
2415-
subobjects.push_back({ reshade::api::pipeline_subobject_type::domain_shader, 1, &ds_desc });
2417+
if (ds_desc.code != nullptr)
2418+
subobjects.push_back({ reshade::api::pipeline_subobject_type::domain_shader, 1, &ds_desc });
24162419
p += sizeof(D3D12_PIPELINE_STATE_STREAM_DS);
24172420
continue;
24182421
case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_HS:
24192422
hs_desc = reshade::d3d12::convert_shader_desc(reinterpret_cast<const D3D12_PIPELINE_STATE_STREAM_HS *>(p)->data);
2420-
subobjects.push_back({ reshade::api::pipeline_subobject_type::hull_shader, 1, &hs_desc });
2423+
if (hs_desc.code != nullptr)
2424+
subobjects.push_back({ reshade::api::pipeline_subobject_type::hull_shader, 1, &hs_desc });
24212425
p += sizeof(D3D12_PIPELINE_STATE_STREAM_HS);
24222426
continue;
24232427
case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_GS:
24242428
gs_desc = reshade::d3d12::convert_shader_desc(reinterpret_cast<const D3D12_PIPELINE_STATE_STREAM_GS *>(p)->data);
2425-
subobjects.push_back({ reshade::api::pipeline_subobject_type::geometry_shader, 1, &gs_desc });
2429+
if (gs_desc.code != nullptr)
2430+
subobjects.push_back({ reshade::api::pipeline_subobject_type::geometry_shader, 1, &gs_desc });
24262431
p += sizeof(D3D12_PIPELINE_STATE_STREAM_GS);
24272432
continue;
24282433
case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CS:
24292434
cs_desc = reshade::d3d12::convert_shader_desc(reinterpret_cast<const D3D12_PIPELINE_STATE_STREAM_CS *>(p)->data);
2430-
subobjects.push_back({ reshade::api::pipeline_subobject_type::compute_shader, 1, &cs_desc });
2435+
if (cs_desc.code != nullptr)
2436+
subobjects.push_back({ reshade::api::pipeline_subobject_type::compute_shader, 1, &cs_desc });
24312437
p += sizeof(D3D12_PIPELINE_STATE_STREAM_CS);
24322438
continue;
24332439
case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_STREAM_OUTPUT:
@@ -2514,12 +2520,14 @@ bool D3D12Device::invoke_create_and_init_pipeline_event(const D3D12_PIPELINE_STA
25142520
continue;
25152521
case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_AS:
25162522
as_desc = reshade::d3d12::convert_shader_desc(reinterpret_cast<const D3D12_PIPELINE_STATE_STREAM_AS *>(p)->data);
2517-
subobjects.push_back({ reshade::api::pipeline_subobject_type::amplification_shader, 1, &as_desc });
2523+
if (as_desc.code != nullptr)
2524+
subobjects.push_back({ reshade::api::pipeline_subobject_type::amplification_shader, 1, &as_desc });
25182525
p += sizeof(D3D12_PIPELINE_STATE_STREAM_AS);
25192526
continue;
25202527
case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MS:
25212528
ms_desc = reshade::d3d12::convert_shader_desc(reinterpret_cast<const D3D12_PIPELINE_STATE_STREAM_MS *>(p)->data);
2522-
subobjects.push_back({ reshade::api::pipeline_subobject_type::mesh_shader, 1, &ms_desc });
2529+
if (ms_desc.code != nullptr)
2530+
subobjects.push_back({ reshade::api::pipeline_subobject_type::mesh_shader, 1, &ms_desc });
25232531
p += sizeof(D3D12_PIPELINE_STATE_STREAM_MS);
25242532
continue;
25252533
case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2:

0 commit comments

Comments
 (0)