From 90e87cabb7580d2b0c3079791ed91089ff112d87 Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 26 Sep 2025 21:46:46 +0200 Subject: [PATCH] experiment: use batching for sprites renderbatches just needs to be moved, sprite drawers already used preparepolygon this seems to improve performance accross the board, no matter how many sprites there are, but the benefits becomes greater the more sprites there are in some cases gaining up to 200fps! (precip especially benefits from this) needs some testing to see if this may cause issues with sorting, etc --- src/hardware/hw_main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hardware/hw_main.cpp b/src/hardware/hw_main.cpp index c41ad5a3d..1478f34f7 100644 --- a/src/hardware/hw_main.cpp +++ b/src/hardware/hw_main.cpp @@ -5586,9 +5586,6 @@ void HWR_RenderViewpoint(gl_portal_t *rootportal, player_t *player, int stencil_ PS_STOP_TIMING(ps_bsptime); - if (LIKELY(cv_glbatching.value)) - HWR_RenderBatches(); - if constexpr (Type == RenderViewpointType::kPortal) { if (skyWallVertexArraySize) // if there are skywalls to draw using the alternate method @@ -5617,6 +5614,9 @@ void HWR_RenderViewpoint(gl_portal_t *rootportal, player_t *player, int stencil_ HWR_DrawSprites(); PS_STOP_TIMING(ps_hw_spritedrawtime); + if (LIKELY(cv_glbatching.value)) + HWR_RenderBatches(); + ps_numdrawnodes.value.i = 0; ps_hw_nodesorttime.value.p = 0; ps_hw_nodedrawtime.value.p = 0;