| 1862 | } |
| 1863 | |
| 1864 | void 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 | |
| 1891 | void Sample::Render(nvrhi::IFramebuffer* framebuffer) |
| 1892 | { |
nothing calls this directly
no outgoing calls
no test coverage detected