Opengl: enable stencil testing only when portals are used

maybe a bit of perf on non portal maps, prob neglible but why not
This commit is contained in:
alufolie91 committed 2026-05-07 16:26:42 +02:00
1 parent 50c1263e7d
commit 2344552ba8
1 file changed
+8 -3
+8 -3
View File
@@ -5691,7 +5691,11 @@ extern "C" {
// ==========================================================================
static void HWR_RenderFrame(boolean skybox, boolean drawsky)
{
GL_EnableStencilTest();
// NetUpdate below may cause this to be false midrender if toggled
const boolean useportals = HWR_UsePortals();
if (useportals)
GL_EnableStencilTest();
// Clear view, set viewport (glViewport), set perspective...
HWR_ClearView();
@@ -5718,12 +5722,13 @@ static void HWR_RenderFrame(boolean skybox, boolean drawsky)
NetUpdate();
portalclipline = NULL;
if (UNLIKELY(HWR_UsePortals()))
if (useportals)
HWR_RenderViewpoint<RenderViewpointType::kPortal>(NULL, 0, !skybox);
else
HWR_RenderViewpoint<RenderViewpointType::kNormal>(NULL, 0, !skybox);
GL_DisableStencilTest();
if (useportals)
GL_DisableStencilTest();
// Check for new console commands.
NetUpdate();