From df0d49f89a149bb68db989377994221858a8ea97 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 | 11 ++++++++--- src/r_segs.cpp | 4 +++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/r_bsp.cpp b/src/r_bsp.cpp index 49725201a..8b69acae1 100644 --- a/src/r_bsp.cpp +++ b/src/r_bsp.cpp @@ -14,7 +14,7 @@ #include #include -//#include +#include #include "command.h" #include "doomdef.h" @@ -963,6 +963,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)); @@ -1449,6 +1451,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 38dd9905c..b73850a28 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -13,7 +13,7 @@ /// while maintaining a per column clipping list only. /// Moreover, the sky areas have to be determined. -//#include +#include #include "command.h" #include "doomdef.h" @@ -142,6 +142,7 @@ static bool R_CheckMapPlane(const char* funcname, INT32 y, INT32 x1, INT32 x2) static void R_MapPlane(drawspandata_t *ds, spandrawfunc_t *spanfunc, INT32 y, INT32 x1, INT32 x2, boolean allow_parallel) { + ZoneScoped; angle_t angle, planecos, planesin; fixed_t distance = 0, span; size_t pindex; @@ -223,7 +224,7 @@ static void R_MapPlane(drawspandata_t *ds, spandrawfunc_t *spanfunc, INT32 y, IN static void R_MapTiltedPlane(drawspandata_t *ds, void(*spanfunc)(drawspandata_t*), INT32 y, INT32 x1, INT32 x2, boolean allow_parallel) { - //ZoneScoped; + ZoneScoped; if (!R_CheckMapPlane(__func__, y, x1, x2)) return; @@ -655,7 +656,7 @@ void R_DrawPlanes(void) INT32 i; drawspandata_t ds {0}; - //ZoneScoped; + ZoneScoped; R_UpdatePlaneRipple(&ds); @@ -681,6 +682,8 @@ static void R_DrawSkyPlane(visplane_t *pl, void(*colfunc)(drawcolumndata_t*), bo INT32 x; drawcolumndata_t dc {0}; + ZoneScoped; + R_CheckDebugHighlight(SW_HI_SKY); // Reset column drawer function (note: couldn't we just call walldrawerfunc directly?) @@ -944,6 +947,8 @@ void R_DrawSinglePlane(drawspandata_t *ds, visplane_t *pl, boolean allow_paralle 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 86ca6623b..80fa31bb9 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -11,7 +11,7 @@ /// \file r_segs.c /// \brief All the clipping: columns, horizontal spans, sky columns -//#include +#include #include "command.h" #include "doomdef.h" @@ -1805,6 +1805,8 @@ void R_StoreWallRange(INT32 start, INT32 stop) //ZoneScoped; + ZoneScoped; + maskedtextureheight = NULL; //initialize segleft and segright memset(&segleft, 0x00, sizeof(segleft));