From 8281374551c2d192dfac4f893ac25eafba7f3352 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 14 Jan 2022 00:49:57 +0100 Subject: [PATCH] - do not use floor sprites for splitting geometry. This is way too expensive on maps with lots of sprites. Instead, run them through the case for slope sprites which should be sufficient here Also let rendered_* count the actual draw calls, not processed objects, because that is the most relevant metric for checking performance issues. --- source/core/rendering/scene/hw_drawlist.cpp | 1 - source/core/rendering/scene/hw_drawlistadd.cpp | 2 +- source/core/rendering/scene/hw_flats.cpp | 2 +- source/core/rendering/scene/hw_walls.cpp | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/source/core/rendering/scene/hw_drawlist.cpp b/source/core/rendering/scene/hw_drawlist.cpp index 168debfea4c..e5280301cff 100644 --- a/source/core/rendering/scene/hw_drawlist.cpp +++ b/source/core/rendering/scene/hw_drawlist.cpp @@ -1169,7 +1169,6 @@ void HWDrawList::DrawSorted(HWDrawInfo *di, FRenderState &state, SortNode * head void HWDrawList::DrawSorted(HWDrawInfo *di, FRenderState &state) { if (drawitems.Size() == 0) return; - if (!sorted) { screen->mVertexData->Map(); diff --git a/source/core/rendering/scene/hw_drawlistadd.cpp b/source/core/rendering/scene/hw_drawlistadd.cpp index 720aafa9c83..c050920b447 100644 --- a/source/core/rendering/scene/hw_drawlistadd.cpp +++ b/source/core/rendering/scene/hw_drawlistadd.cpp @@ -100,7 +100,7 @@ void HWDrawInfo::AddFlat(HWFlat *flat) { // translucent portals go into the translucent border list. list = flat->Sprite? GLDL_TRANSLUCENT : GLDL_TRANSLUCENTBORDER; - slopespr = (flat->Sprite && flat->Sprite->clipdist & TSPR_SLOPESPRITE); + slopespr = !!(flat->Sprite);//&& flat->Sprite->clipdist& TSPR_SLOPESPRITE); } else { diff --git a/source/core/rendering/scene/hw_flats.cpp b/source/core/rendering/scene/hw_flats.cpp index 8c0a7b668c4..52200837b29 100644 --- a/source/core/rendering/scene/hw_flats.cpp +++ b/source/core/rendering/scene/hw_flats.cpp @@ -218,6 +218,7 @@ void HWFlat::MakeVertices(HWDrawInfo* di) //========================================================================== void HWFlat::DrawFlat(HWDrawInfo *di, FRenderState &state, bool translucent) { + rendered_flats++; if (screen->BuffersArePersistent() && !Sprite) { MakeVertices(di); @@ -291,7 +292,6 @@ void HWFlat::PutFlat(HWDrawInfo *di, int whichplane) MakeVertices(di); } di->AddFlat(this); - rendered_flats++; } //========================================================================== diff --git a/source/core/rendering/scene/hw_walls.cpp b/source/core/rendering/scene/hw_walls.cpp index 99b27cc9c2e..0ef3b74f27d 100644 --- a/source/core/rendering/scene/hw_walls.cpp +++ b/source/core/rendering/scene/hw_walls.cpp @@ -253,6 +253,7 @@ void HWWall::RenderTranslucentWall(HWDrawInfo *di, FRenderState &state) //========================================================================== void HWWall::DrawWall(HWDrawInfo *di, FRenderState &state, bool translucent) { + rendered_lines++; if (screen->BuffersArePersistent()) { /* @@ -397,7 +398,6 @@ void HWWall::SetupLights(HWDrawInfo *di, FDynLightData &lightdata) //========================================================================== void HWWall::PutWall(HWDrawInfo *di, bool translucent) { - rendered_lines++; if (translucent || (texture && texture->GetTranslucency() && type == RENDERWALL_M2S)) { flags |= HWF_TRANSLUCENT;