From ca5095b4a2b84895f1d0c72a1fc9bf8531acbc11 Mon Sep 17 00:00:00 2001 From: slipher Date: Tue, 12 Nov 2024 00:04:29 -0600 Subject: [PATCH] Fix instant quad 'stageIteratorFunc == NULL' error This happens when I load plat23 with the dummy gamelogic. The surface rendering function calls Tess_CheckVBOAndIBO, which calls Tess_EndBegin, which is unhappy that there is no stage iterator set. --- src/engine/renderer/tr_shade.cpp | 1 + src/engine/renderer/tr_surface.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/engine/renderer/tr_shade.cpp b/src/engine/renderer/tr_shade.cpp index 7fde9688d7..fd6b01de69 100644 --- a/src/engine/renderer/tr_shade.cpp +++ b/src/engine/renderer/tr_shade.cpp @@ -2695,6 +2695,7 @@ void Tess_ComputeTexMatrices( shaderStage_t *pStage ) } // Used for things which are never intended to be rendered +// (or in the case of Tess_InstantQuad, they're rendered but not via Tess_End) void Tess_StageIteratorDummy() { Log::Warn( "non-drawing tessellation overflow" ); diff --git a/src/engine/renderer/tr_surface.cpp b/src/engine/renderer/tr_surface.cpp index 703c349484..0c5b524947 100644 --- a/src/engine/renderer/tr_surface.cpp +++ b/src/engine/renderer/tr_surface.cpp @@ -544,7 +544,7 @@ void Tess_InstantQuad( u_ModelViewProjectionMatrix &shader, const float x, const { GLimp_LogComment( "--- Tess_InstantQuad ---\n" ); - Tess_Clear(); + Tess_Begin( Tess_StageIteratorDummy, nullptr, nullptr, true, -1, 0 ); matrix_t modelViewMatrix; MatrixCopy( matrixIdentity, modelViewMatrix );