From 689f5b8365c70e06dafcce14f8fe54c84e5e67fe Mon Sep 17 00:00:00 2001 From: Eidolon Date: Mon, 18 Sep 2023 16:19:31 -0500 Subject: [PATCH] Tracy instrument software BSP traversal and render --- src/r_bsp.cpp | 6 ++++++ src/r_plane.cpp | 10 ++++++++++ src/r_segs.cpp | 4 ++++ 3 files changed, 20 insertions(+) diff --git a/src/r_bsp.cpp b/src/r_bsp.cpp index 794cb5f71..d89333bb7 100644 --- a/src/r_bsp.cpp +++ b/src/r_bsp.cpp @@ -13,6 +13,8 @@ #include +#include + #include "doomdef.h" #include "g_game.h" #include "r_local.h" @@ -905,6 +907,8 @@ static void R_Subsector(size_t num) fixed_t floorcenterz, ceilingcenterz; ffloor_t *rover; + ZoneScoped; + #ifdef RANGECHECK if (num >= numsubsectors) I_Error("R_Subsector: ss %s with numss = %s\n", sizeu1(num), sizeu2(numsubsectors)); @@ -1355,6 +1359,8 @@ void R_RenderBSPNode(INT32 bspnum) node_t *bsp; INT32 side; + ZoneScoped; + ps_numbspcalls++; while (!(bspnum & NF_SUBSECTOR)) // Found a subsector? diff --git a/src/r_plane.cpp b/src/r_plane.cpp index 4b7540a21..e5e29ea0a 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -13,6 +13,8 @@ /// while maintaining a per column clipping list only. /// Moreover, the sky areas have to be determined. +#include + #include "doomdef.h" #include "console.h" #include "g_game.h" @@ -143,6 +145,7 @@ static void R_UpdatePlaneRipple(void) static void R_MapPlane(INT32 y, INT32 x1, INT32 x2) { + ZoneScoped; angle_t angle, planecos, planesin; fixed_t distance = 0, span; size_t pindex; @@ -235,6 +238,7 @@ static void R_MapPlane(INT32 y, INT32 x1, INT32 x2) static void R_MapTiltedPlane(INT32 y, INT32 x1, INT32 x2) { + ZoneScoped; #ifdef RANGECHECK if (x2 < x1 || x1 < 0 || x2 >= viewwidth || y >= viewheight || y < 0) I_Error("R_MapTiltedPlane: %d, %d at %d", x1, x2, y); @@ -609,6 +613,8 @@ void R_DrawPlanes(void) visplane_t *pl; INT32 i; + ZoneScoped; + R_UpdatePlaneRipple(); for (i = 0; i < MAXVISPLANES; i++, pl++) @@ -633,6 +639,8 @@ static void R_DrawSkyPlane(visplane_t *pl) INT32 x; INT32 angle; + ZoneScoped; + R_CheckDebugHighlight(SW_HI_SKY); // Reset column drawer function (note: couldn't we just call walldrawerfunc directly?) @@ -860,6 +868,8 @@ void R_DrawSinglePlane(visplane_t *pl) if (!(pl->minx <= pl->maxx)) return; + ZoneScoped; + // sky flat if (pl->picnum == skyflatnum) { diff --git a/src/r_segs.cpp b/src/r_segs.cpp index 1f3023d60..6c79e5543 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -11,6 +11,8 @@ /// \file r_segs.c /// \brief All the clipping: columns, horizontal spans, sky columns +#include + #include "doomdef.h" #include "r_local.h" #include "r_sky.h" @@ -1737,6 +1739,8 @@ void R_StoreWallRange(INT32 start, INT32 stop) static size_t maxdrawsegs = 0; const INT32 twosidedmidtexture = R_GetTwoSidedMidTexture(curline); + ZoneScoped; + maskedtextureheight = NULL; //initialize segleft and segright memset(&segleft, 0x00, sizeof(segleft));