| 1021 | } |
| 1022 | |
| 1023 | void BindlessDeferred::Render(const Timer& timer) |
| 1024 | { |
| 1025 | ID3D12GraphicsCommandList* cmdList = DX12::CmdList; |
| 1026 | |
| 1027 | CPUProfileBlock cpuProfileBlock("Render"); |
| 1028 | ProfileBlock gpuProfileBlock(cmdList, "Render Total"); |
| 1029 | |
| 1030 | RenderClusters(); |
| 1031 | |
| 1032 | if(AppSettings::EnableSun) |
| 1033 | meshRenderer.RenderSunShadowMap(cmdList, camera); |
| 1034 | |
| 1035 | if(AppSettings::RenderLights) |
| 1036 | meshRenderer.RenderSpotLightShadowMap(cmdList, camera); |
| 1037 | |
| 1038 | if(AppSettings::RenderMode == RenderModes::ClusteredForward) |
| 1039 | RenderForward(); |
| 1040 | else |
| 1041 | RenderDeferred(); |
| 1042 | |
| 1043 | RenderPicking(); |
| 1044 | RenderResolve(); |
| 1045 | |
| 1046 | RenderTexture& finalRT = mainTarget.MSAASamples > 1 ? resolveTarget : mainTarget; |
| 1047 | |
| 1048 | { |
| 1049 | ProfileBlock ppProfileBlock(cmdList, "Post Processing"); |
| 1050 | postProcessor.Render(cmdList, finalRT, swapChain.BackBuffer()); |
| 1051 | } |
| 1052 | |
| 1053 | D3D12_CPU_DESCRIPTOR_HANDLE rtvHandles[1] = { swapChain.BackBuffer().RTV.CPUHandle }; |
| 1054 | cmdList->OMSetRenderTargets(1, rtvHandles, false, nullptr); |
| 1055 | |
| 1056 | RenderClusterVisualizer(); |
| 1057 | |
| 1058 | DX12::SetViewport(cmdList, swapChain.Width(), swapChain.Height()); |
| 1059 | |
| 1060 | RenderHUD(timer); |
| 1061 | |
| 1062 | // Transition updatable resources back to copy dest state |
| 1063 | decalBuffer.Transition(DX12::CmdList, D3D12_RESOURCE_STATE_GENERIC_READ, D3D12_RESOURCE_STATE_COPY_DEST); |
| 1064 | } |
| 1065 | |
| 1066 | void BindlessDeferred::UpdateDecals(const Timer& timer) |
| 1067 | { |
nothing calls this directly
no test coverage detected