MCPcopy Create free account
hub / github.com/Apress/Ray-Tracing-Gems-II / ReloadShaders

Function ReloadShaders

Chapter_14/src/Graphics.cpp:1562–1575  ·  view source on GitHub ↗

* Release the shaders and RTPSO. Reload and compile the shaders, recreate the RTPSO, and rewrite the shader table entries. */

Source from the content-addressed store, hash-verified

1560* Release the shaders and RTPSO. Reload and compile the shaders, recreate the RTPSO, and rewrite the shader table entries.
1561*/
1562void ReloadShaders(D3D12Global& d3d, DXRGlobal& dxr, D3D12Resources& resources, D3D12ShaderCompilerInfo& shaderCompiler)
1563{
1564 SAFE_RELEASE(dxr.rtProgram.blob);
1565 SAFE_RELEASE(dxr.rtpso);
1566 SAFE_RELEASE(dxr.rtpsoInfo);
1567 SAFE_RELEASE(dxr.globalRootSignature);
1568 SAFE_RELEASE(dxr.shaderTable);
1569
1570 DXR::CreateRTProgram(d3d, dxr, shaderCompiler);
1571 DXR::CreatePipelineStateObject(d3d, dxr);
1572 DXR::CreateShaderTable(d3d, dxr, resources);
1573
1574 dxr.forceAccumulationReset = true;
1575}
1576
1577/**
1578* Create the DXR descriptor heap for CBVs, SRVs, and the output UAV.

Callers 1

UpdateMethod · 0.85

Calls 3

CreateRTProgramFunction · 0.85
CreateShaderTableFunction · 0.85

Tested by

no test coverage detected