Skip to content

Commit cb14da4

Browse files
committed
Add "bind_descriptor_tables" event when D3D12 root signature is changed again
This reverts commit bc928d6, as applications may do things like "Set*RootSignature" -> "SetPipelineState" -> "Set*RootDescriptorTable" and without this event an add-on attempting to save and restore state in the "SetPipelineState" call would overwrite the root signature to a previous value
1 parent 5018887 commit cb14da4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

source/d3d12/d3d12_command_list.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,12 +477,30 @@ void STDMETHODCALLTYPE D3D12GraphicsCommandList::SetComputeRootSignature(ID3D12R
477477
_orig->SetComputeRootSignature(pRootSignature);
478478

479479
_current_root_signature[1] = pRootSignature;
480+
481+
#if RESHADE_ADDON >= 2
482+
reshade::invoke_addon_event<reshade::addon_event::bind_descriptor_tables>(
483+
this,
484+
reshade::api::shader_stage::all_compute,
485+
to_handle(_current_root_signature[1]),
486+
0,
487+
0, nullptr);
488+
#endif
480489
}
481490
void STDMETHODCALLTYPE D3D12GraphicsCommandList::SetGraphicsRootSignature(ID3D12RootSignature *pRootSignature)
482491
{
483492
_orig->SetGraphicsRootSignature(pRootSignature);
484493

485494
_current_root_signature[0] = pRootSignature;
495+
496+
#if RESHADE_ADDON >= 2
497+
reshade::invoke_addon_event<reshade::addon_event::bind_descriptor_tables>(
498+
this,
499+
reshade::api::shader_stage::all_graphics,
500+
to_handle(_current_root_signature[0]),
501+
0,
502+
0, nullptr);
503+
#endif
486504
}
487505
void STDMETHODCALLTYPE D3D12GraphicsCommandList::SetComputeRootDescriptorTable(UINT RootParameterIndex, D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor)
488506
{

0 commit comments

Comments
 (0)