From c85ad330b345915dcab09fc14257bc15f9c1b84d Mon Sep 17 00:00:00 2001 From: myT <> Date: Thu, 5 Dec 2024 22:56:54 +0100 Subject: [PATCH] fixed CRP G-buffer visualizations broken by ca3d15282b75eb7035bad5ba31bc6ae6c2266d1e it drew the debug viz to the RT the tone mapper would later write to as well before actual GUI drawing... --- code/renderer/crp_gbuffer_viz.cpp | 4 +--- code/renderer/crp_local.h | 2 +- code/renderer/crp_main.cpp | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/code/renderer/crp_gbuffer_viz.cpp b/code/renderer/crp_gbuffer_viz.cpp index a953065..56fb29d 100644 --- a/code/renderer/crp_gbuffer_viz.cpp +++ b/code/renderer/crp_gbuffer_viz.cpp @@ -82,7 +82,7 @@ void GBufferViz::Init() } } -void GBufferViz::DrawGUI() +void GBufferViz::DrawVizAndGUI(HTexture renderTarget) { GUI_AddMainMenuItem(GUI_MainMenu::Tools, "Show G-Buffer", "", &windowActive); @@ -91,8 +91,6 @@ void GBufferViz::DrawGUI() return; } - const HTexture renderTarget = crp.GetReadRenderTarget(); - if(textureIndex == GBufferTexture::Depth) { srp.renderMode = RenderMode::None; diff --git a/code/renderer/crp_local.h b/code/renderer/crp_local.h index 2bf0041..bc91b21 100644 --- a/code/renderer/crp_local.h +++ b/code/renderer/crp_local.h @@ -291,7 +291,7 @@ private: struct GBufferViz { void Init(); - void DrawGUI(); + void DrawVizAndGUI(HTexture renderTarget); private: struct GBufferTexture diff --git a/code/renderer/crp_main.cpp b/code/renderer/crp_main.cpp index f164cbb..bea75cc 100644 --- a/code/renderer/crp_main.cpp +++ b/code/renderer/crp_main.cpp @@ -680,14 +680,14 @@ void CRP::EndFrame() return; } + toneMap.DrawToneMap(); srp.DrawGUI(); - gbufferViz.DrawGUI(); magnifier.DrawGUI(); + gbufferViz.DrawVizAndGUI(crp.GetReadRenderTarget()); sunlightEditor.DrawGUI(); volumetricLight.DrawGUI(); vdbManager.DrawGUI(); im3d.DrawGUI(); - toneMap.DrawToneMap(); imgui.Draw(renderTarget); magnifier.Draw(); BlitRenderTarget(GetSwapChainTexture(), "Blit to Swap Chain");