MCPcopy Create free account
hub / github.com/NVIDIA-RTX/RTXPT / PostProcessPostToneMapping

Method PostProcessPostToneMapping

Rtxpt/Sample.cpp:1864–1889  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1862}
1863
1864void Sample::PostProcessPostToneMapping(nvrhi::ICommandList* commandList, const donut::engine::ICompositeView& compositeView)
1865{ // a.k.a. LDR post-process (e.g. colour filters go here)
1866 if (m_ui.PostProcessEdgeDetection)
1867 {
1868 m_commandList->beginMarker("PPEdgeDetection");
1869
1870 m_commandList->copyTexture(m_renderTargets->LdrColorScratch, nvrhi::TextureSlice(), m_renderTargets->LdrColor, nvrhi::TextureSlice());
1871
1872 nvrhi::rt::DispatchRaysArguments args;
1873 args.width = m_displaySize.x;
1874 args.height = m_displaySize.y;
1875
1876 nvrhi::rt::State state;
1877 state.shaderTable = m_ptPipelineEdgeDetection->GetShaderTable();
1878 state.bindings = { m_bindingSet, m_DescriptorTable->GetDescriptorTable() };
1879 m_commandList->setRayTracingState(state);
1880
1881 SampleMiniConstants miniConstants = { uint4( *reinterpret_cast<uint*>(&m_ui.PostProcessEdgeDetectionThreshold), 0, 0, 0) };
1882 m_commandList->setPushConstants(&miniConstants, sizeof(miniConstants));
1883 m_commandList->dispatchRays(args);
1884
1885 m_commandList->setTextureState(m_renderTargets->LdrColor, nvrhi::AllSubresources, nvrhi::ResourceStates::UnorderedAccess);
1886
1887 m_commandList->endMarker();
1888 }
1889}
1890
1891void Sample::Render(nvrhi::IFramebuffer* framebuffer)
1892{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected