From 3fd38e16fe2bbdd0f40e63b8a025e71346b079a0 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 6 May 2026 10:05:05 +0000 Subject: [PATCH] Remove stale renderer compile toggles PATCH_STITCHING and USE_FOG_COLLAPSE Both macros were unconditionally defined for shipped builds; guarded code was dead alternate paths. Unfold to the active behavior only. Co-authored-by: Tim Fox --- src/renderers/opengl/tr_bsp.c | 4 ---- src/renderers/opengl/tr_curve.c | 11 ----------- src/renderers/opengl/tr_local.h | 2 -- src/renderers/vulkan/tr_bsp.c | 4 ---- src/renderers/vulkan/tr_curve.c | 11 ----------- src/renderers/vulkan/tr_local.h | 3 --- src/renderers/vulkan/tr_shade.c | 4 ---- src/renderers/vulkan/tr_shader.c | 4 ---- 8 files changed, 43 deletions(-) diff --git a/src/renderers/opengl/tr_bsp.c b/src/renderers/opengl/tr_bsp.c index 34a097de74..83d8cd4c7e 100644 --- a/src/renderers/opengl/tr_bsp.c +++ b/src/renderers/opengl/tr_bsp.c @@ -1567,15 +1567,11 @@ static void R_LoadSurfaces( const lump_t *surfs, const lump_t *verts, const lump } } -#ifdef PATCH_STITCHING R_StitchAllPatches(); -#endif R_FixSharedVertexLodError(); -#ifdef PATCH_STITCHING R_MovePatchSurfacesToHunk(); -#endif ri.Printf( PRINT_ALL, "...loaded %d faces, %i meshes, %i trisurfs, %i flares\n", numFaces, numMeshes, numTriSurfs, numFlares ); diff --git a/src/renderers/opengl/tr_curve.c b/src/renderers/opengl/tr_curve.c index 249acf6f48..ee00209506 100644 --- a/src/renderers/opengl/tr_curve.c +++ b/src/renderers/opengl/tr_curve.c @@ -292,7 +292,6 @@ static srfGridMesh_t *R_CreateSurfaceGridMesh(int width, int height, // copy the results out to a grid size = (width * height - 1) * sizeof( drawVert_t ) + sizeof( *grid ); -#ifdef PATCH_STITCHING grid = /*ri.Hunk_Alloc*/ ri.Malloc( size ); Com_Memset(grid, 0, size); @@ -301,16 +300,6 @@ static srfGridMesh_t *R_CreateSurfaceGridMesh(int width, int height, grid->heightLodError = /*ri.Hunk_Alloc*/ ri.Malloc( height * 4 ); Com_Memcpy( grid->heightLodError, errorTable[1], height * 4 ); -#else - grid = ri.Hunk_Alloc( size ); - Com_Memset(grid, 0, size); - - grid->widthLodError = ri.Hunk_Alloc( width * 4 ); - Com_Memcpy( grid->widthLodError, errorTable[0], width * 4 ); - - grid->heightLodError = ri.Hunk_Alloc( height * 4 ); - Com_Memcpy( grid->heightLodError, errorTable[1], height * 4 ); -#endif grid->width = width; grid->height = height; diff --git a/src/renderers/opengl/tr_local.h b/src/renderers/opengl/tr_local.h index c2fd5aea2f..915dbc35f6 100644 --- a/src/renderers/opengl/tr_local.h +++ b/src/renderers/opengl/tr_local.h @@ -1674,8 +1674,6 @@ CURVE TESSELATION ============================================================ */ -#define PATCH_STITCHING - srfGridMesh_t *R_SubdividePatchToGrid( int width, int height, drawVert_t points[MAX_PATCH_SIZE*MAX_PATCH_SIZE] ); srfGridMesh_t *R_GridInsertColumn( srfGridMesh_t *grid, int column, int row, vec3_t point, float loderror ); diff --git a/src/renderers/vulkan/tr_bsp.c b/src/renderers/vulkan/tr_bsp.c index 1b1cd01d30..f82dd485aa 100644 --- a/src/renderers/vulkan/tr_bsp.c +++ b/src/renderers/vulkan/tr_bsp.c @@ -1771,15 +1771,11 @@ static void R_LoadSurfaces( const lump_t *surfs, const lump_t *verts, const lump } } -#ifdef PATCH_STITCHING R_StitchAllPatches(); -#endif R_FixSharedVertexLodError(); -#ifdef PATCH_STITCHING R_MovePatchSurfacesToHunk(); -#endif ri.Printf( PRINT_ALL, "...loaded %d faces, %i meshes, %i trisurfs, %i flares\n", numFaces, numMeshes, numTriSurfs, numFlares ); diff --git a/src/renderers/vulkan/tr_curve.c b/src/renderers/vulkan/tr_curve.c index 8df21d61d5..ea00e33d4c 100644 --- a/src/renderers/vulkan/tr_curve.c +++ b/src/renderers/vulkan/tr_curve.c @@ -425,7 +425,6 @@ static srfGridMesh_t *R_CreateSurfaceGridMesh(int width, int height, // copy the results out to a grid size = (width * height - 1) * sizeof( srfVert_t ) + sizeof( *grid ); -#ifdef PATCH_STITCHING grid = /*ri.Hunk_Alloc*/ ri.Malloc( size ); Com_Memset(grid, 0, size); @@ -434,16 +433,6 @@ static srfGridMesh_t *R_CreateSurfaceGridMesh(int width, int height, grid->heightLodError = /*ri.Hunk_Alloc*/ ri.Malloc( height * 4 ); Com_Memcpy( grid->heightLodError, errorTable[1], height * 4 ); -#else - grid = ri.Hunk_Alloc( size ); - Com_Memset(grid, 0, size); - - grid->widthLodError = ri.Hunk_Alloc( width * 4 ); - Com_Memcpy( grid->widthLodError, errorTable[0], width * 4 ); - - grid->heightLodError = ri.Hunk_Alloc( height * 4 ); - Com_Memcpy( grid->heightLodError, errorTable[1], height * 4 ); -#endif grid->width = width; grid->height = height; diff --git a/src/renderers/vulkan/tr_local.h b/src/renderers/vulkan/tr_local.h index a5879df5c8..add6ddbcfe 100644 --- a/src/renderers/vulkan/tr_local.h +++ b/src/renderers/vulkan/tr_local.h @@ -35,7 +35,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #endif #define USE_VBO // store static world geometry in VBO -#define USE_FOG_COLLAPSE // not compatible with legacy dlights #define MAX_REAL_DLIGHTS (MAX_DLIGHTS*2) #define MAX_LITSURFS (MAX_DRAWSURFS) #define MAX_FLARES 256 @@ -2136,8 +2135,6 @@ CURVE TESSELATION ============================================================ */ -#define PATCH_STITCHING - srfGridMesh_t *R_SubdividePatchToGrid( int width, int height, srfVert_t points[MAX_PATCH_SIZE*MAX_PATCH_SIZE] ); srfGridMesh_t *R_GridInsertColumn( srfGridMesh_t *grid, int column, int row, vec3_t point, float loderror ); diff --git a/src/renderers/vulkan/tr_shade.c b/src/renderers/vulkan/tr_shade.c index e33e5fb980..5e087927be 100644 --- a/src/renderers/vulkan/tr_shade.c +++ b/src/renderers/vulkan/tr_shade.c @@ -1275,14 +1275,12 @@ static void RB_IterateStagesGeneric( const shaderCommands_t *input ) is_pbr_surface = qfalse; -#ifdef USE_FOG_COLLAPSE if ( fogCollapse ) { VK_SetFogParams( &uniform, &fog_stage ); VectorCopy( backEnd.or.viewOrigin, uniform.eyePos ); vk_update_descriptor( VK_DESC_FOG_COLLAPSE, tr.fogImage->descriptor ); pushUniform = qtrue; } else -#endif { fog_stage = 0; if ( tess_flags & TESS_VPOS ) { @@ -1943,9 +1941,7 @@ void RB_StageIteratorGeneric( void ) return; } -#ifdef USE_FOG_COLLAPSE fogCollapse = tess.fogNum && tess.shader->fogPass && tess.shader->fogCollapse; -#endif worldShOverride = ( r_shDebugView && r_shDebugView->integer == 3 ); // call shader function diff --git a/src/renderers/vulkan/tr_shader.c b/src/renderers/vulkan/tr_shader.c index 4662679c3a..b02620e6be 100644 --- a/src/renderers/vulkan/tr_shader.c +++ b/src/renderers/vulkan/tr_shader.c @@ -4191,7 +4191,6 @@ static shader_t *FinishShader( void ) { #ifdef USE_VULKAN -#ifdef USE_FOG_COLLAPSE if ( vk.maxBoundDescriptorSets >= 6 && !(shader.contentFlags & CONTENTS_FOG) && shader.fogPass != FP_NONE ) { fogCollapse = qtrue; if ( stage == 1 ) { @@ -4243,7 +4242,6 @@ static shader_t *FinishShader( void ) { // if there is no fogs - assume that we can apply all color optimizations without any restrictions fogCollapse = qtrue; } -#endif shader.tessFlags = TESS_XYZ; @@ -4521,7 +4519,6 @@ static shader_t *FinishShader( void ) { } -#ifdef USE_FOG_COLLAPSE if ( fogCollapse && tr.numFogs > 0 ) { Vk_Pipeline_Def fog_def; Vk_Pipeline_Def fog_def_mirror; @@ -4552,7 +4549,6 @@ static shader_t *FinishShader( void ) { shader.fogCollapse = qtrue; } -#endif } } #endif // USE_VULKAN