MCPcopy Create free account
hub / github.com/crosire/reshade / SetComputeRootShaderResourceView

Method SetComputeRootShaderResourceView

source/d3d12/d3d12_command_list.cpp:675–697  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

673#endif
674}
675void STDMETHODCALLTYPE D3D12GraphicsCommandList::SetComputeRootShaderResourceView(UINT RootParameterIndex, D3D12_GPU_VIRTUAL_ADDRESS BufferLocation)
676{
677 _orig->SetComputeRootShaderResourceView(RootParameterIndex, BufferLocation);
678
679#if RESHADE_ADDON >= 2
680 if (!reshade::has_addon_event<reshade::addon_event::push_descriptors>())
681 return;
682
683 reshade::api::buffer_range buffer_range;
684 bool acceleration_structure;
685 if (!_device_impl->resolve_gpu_address(BufferLocation, &buffer_range.buffer, &buffer_range.offset, &acceleration_structure))
686 return;
687 buffer_range.size = UINT64_MAX;
688
689 // TODO: Get a working 'resource_view' handle for the SRV that can be passed as descriptor update, when it is not an acceleration structure
690 reshade::invoke_addon_event<reshade::addon_event::push_descriptors>(
691 this,
692 reshade::api::shader_stage::all_compute | reshade::api::shader_stage::all_ray_tracing,
693 to_handle(_current_root_signature[1]),
694 RootParameterIndex,
695 reshade::api::descriptor_table_update { {}, 0, 0, 1, acceleration_structure ? reshade::api::descriptor_type::acceleration_structure : reshade::api::descriptor_type::buffer_shader_resource_view, &BufferLocation });
696#endif
697}
698void STDMETHODCALLTYPE D3D12GraphicsCommandList::SetGraphicsRootShaderResourceView(UINT RootParameterIndex, D3D12_GPU_VIRTUAL_ADDRESS BufferLocation)
699{
700 _orig->SetGraphicsRootShaderResourceView(RootParameterIndex, BufferLocation);

Callers 1

push_descriptorsMethod · 0.80

Calls 2

resolve_gpu_addressMethod · 0.80
to_handleFunction · 0.70

Tested by

no test coverage detected