From 9db87fc6365ee76f3281ca2474f92ec4f155920d Mon Sep 17 00:00:00 2001 From: aap Date: Thu, 18 Feb 2021 12:21:47 +0100 Subject: add debug render groups --- src/core/main.cpp | 16 ++++++++++++++++ src/core/main.h | 6 ++++++ 2 files changed, 22 insertions(+) (limited to 'src/core') diff --git a/src/core/main.cpp b/src/core/main.cpp index b47f5d37..5eccf759 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -1313,6 +1313,7 @@ if(gbRenderEverythingBarRoads) void RenderScene_new(void) { + PUSH_RENDERGROUP("RenderScene_new"); CClouds::Render(); DoRWRenderHorizon(); @@ -1320,6 +1321,7 @@ RenderScene_new(void) DefinedState(); // CMattRenderer::ResetRenderStates // moved CRenderer::RenderBoats to before transparent water + POP_RENDERGROUP(); } // TODO @@ -1327,6 +1329,7 @@ bool FredIsInFirstPersonCam(void) { return false; } void RenderEffects_new(void) { + PUSH_RENDERGROUP("RenderEffects_new"); CShadows::RenderStaticShadows(); // CRenderer::GenerateEnvironmentMap CShadows::RenderStoredShadows(); @@ -1369,6 +1372,7 @@ if(gbRenderFadingInEntities) CPointLights::RenderFogEffect(); CMovingThings::Render(); CRenderer::RenderFirstPersonVehicle(); + POP_RENDERGROUP(); } #endif @@ -1381,6 +1385,7 @@ RenderScene(void) return; } #endif + PUSH_RENDERGROUP("RenderScene"); CClouds::Render(); DoRWRenderHorizon(); CRenderer::RenderRoads(); @@ -1395,11 +1400,13 @@ RenderScene(void) CRenderer::RenderVehiclesButNotBoats(); #endif CWeather::RenderRainStreaks(); + POP_RENDERGROUP(); } void RenderDebugShit(void) { + PUSH_RENDERGROUP("RenderDebugShit"); CTheScripts::RenderTheScriptDebugLines(); #ifndef FINAL if(gbShowCollisionLines) @@ -1408,6 +1415,7 @@ RenderDebugShit(void) CDebug::DrawLines(); DefinedState(); #endif + POP_RENDERGROUP(); } void @@ -1419,6 +1427,7 @@ RenderEffects(void) return; } #endif + PUSH_RENDERGROUP("RenderEffects"); CGlass::Render(); CWaterCannons::Render(); CSpecialFX::Render(); @@ -1434,11 +1443,13 @@ RenderEffects(void) CPointLights::RenderFogEffect(); CMovingThings::Render(); CRenderer::RenderFirstPersonVehicle(); + POP_RENDERGROUP(); } void Render2dStuff(void) { + PUSH_RENDERGROUP("Render2dStuff"); RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); @@ -1504,6 +1515,7 @@ Render2dStuff(void) #ifdef DEBUGMENU DebugMenuRender(); #endif + POP_RENDERGROUP(); } void @@ -1511,21 +1523,25 @@ RenderMenus(void) { if (FrontEndMenuManager.m_bMenuActive) { + PUSH_RENDERGROUP("RenderMenus"); PUSH_MEMID(MEMID_FRONTEND); FrontEndMenuManager.DrawFrontEnd(); POP_MEMID(); + POP_RENDERGROUP(); } } void Render2dStuffAfterFade(void) { + PUSH_RENDERGROUP("Render2dStuffAfterFade"); #ifndef MASTER DisplayGameDebugText(); #endif CHud::DrawAfterFade(); CFont::DrawFonts(); + POP_RENDERGROUP(); } void diff --git a/src/core/main.h b/src/core/main.h index 9f181101..787d4f52 100644 --- a/src/core/main.h +++ b/src/core/main.h @@ -1,5 +1,11 @@ #pragma once +#if defined(RW_OPENGL) +#define PUSH_RENDERGROUP(str) glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, -1, str) +#define POP_RENDERGROUP() glPopDebugGroup() +#else +#endif + struct GlobalScene { RpWorld *world; -- cgit v1.2.3