From 8fd7fd8180b020ea9263319da8f1e2e07defb625 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 17 May 2026 10:05:11 +0000 Subject: [PATCH] renderer: drop redundant compile-time PBR/VBO preprocessor gates USE_VK_PBR, VK_CUBEMAP, and cubemap size macros were unconditionally enabled via nested #ifdef blocks in vulkan tr_local.h. USE_VBO_GRID was nested under USE_VBO while USE_VBO is always defined for both renderers. Flatten to equivalent #defines so the active build path is unchanged and the obsolete toggle scaffolding is removed. Co-authored-by: Tim Fox --- src/renderers/opengl/tr_local.h | 4 +--- src/renderers/vulkan/tr_local.h | 18 +++++------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/renderers/opengl/tr_local.h b/src/renderers/opengl/tr_local.h index 62459d37ce..20385ae7a8 100644 --- a/src/renderers/opengl/tr_local.h +++ b/src/renderers/opengl/tr_local.h @@ -29,6 +29,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define MAX_TEXTURE_SIZE 32768 // max index texture size (was 2048) #define USE_VBO +#define USE_VBO_GRID /* put SF_GRID to VBO */ #define USE_TESS_NEEDS_NORMAL //#define USE_TESS_NEEDS_ST2 #define USE_FBO @@ -39,9 +40,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "../../qcommon/qfiles.h" #include "../../qcommon/qcommon.h" #include "../common/tr_public.h" -#ifdef USE_VBO -#define USE_VBO_GRID /* put SF_GRID to VBO */ -#endif #include "tr_common.h" #include "../vulkan/tr_model_gltf.h" #include "iqm.h" diff --git a/src/renderers/vulkan/tr_local.h b/src/renderers/vulkan/tr_local.h index 2a835767bc..a94f6386ca 100644 --- a/src/renderers/vulkan/tr_local.h +++ b/src/renderers/vulkan/tr_local.h @@ -24,17 +24,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define TR_LOCAL_H #define USE_VK_PBR -#ifdef USE_VK_PBR - #define VK_PBR_BRDFLUT // for inspecting codebase, does not toggle brdflut. - #define VK_CUBEMAP - - #ifdef VK_CUBEMAP - #define REF_CUBEMAP_IRRADIANCE_SIZE 64 - #define REF_CUBEMAP_SIZE 256 - #endif -#endif +#define VK_PBR_BRDFLUT // for inspecting codebase, does not toggle brdflut. +#define VK_CUBEMAP +#define REF_CUBEMAP_IRRADIANCE_SIZE 64 +#define REF_CUBEMAP_SIZE 256 #define USE_VBO // store static world geometry in VBO +#define USE_VBO_GRID /* put SF_GRID to VBO */ #define USE_FOG_COLLAPSE // not compatible with legacy dlights #define MAX_REAL_DLIGHTS (MAX_DLIGHTS*2) #define MAX_LITSURFS (MAX_DRAWSURFS) @@ -42,10 +38,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define MAX_TEXTURE_SIZE 32768 -#ifdef USE_VBO -#define USE_VBO_GRID /* put SF_GRID to VBO */ -#endif - //#define USE_TESS_NEEDS_NORMAL //#define USE_TESS_NEEDS_ST2