Skip to content

Remove redundant renderer compile-time PBR/VBO preprocessor gates#216

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/obsolete-feature-flags-c481
Draft

Remove redundant renderer compile-time PBR/VBO preprocessor gates#216
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/obsolete-feature-flags-c481

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented May 17, 2026

Summary

Removes obsolete nested #ifdef scaffolding around macros that are always defined for the shipped Vulkan and OpenGL renderer configurations. No runtime cvars or gameplay behavior change.

Flags / gates removed

Item Location Why safe to delete
Nested #ifdef USE_VK_PBR / #ifdef VK_CUBEMAP src/renderers/vulkan/tr_local.h USE_VK_PBR is unconditionally #defined immediately before the block; inner macros (VK_PBR_BRDFLUT, VK_CUBEMAP, cubemap size constants) were always emitted. Same effective preprocessor state for all Vulkan renderer translation units.
#ifdef USE_VBO around USE_VBO_GRID src/renderers/vulkan/tr_local.h, src/renderers/opengl/tr_local.h USE_VBO is always defined in both headers; USE_VBO_GRID was always active. OpenGL: USE_VBO_GRID moved next to USE_VBO before includes so order stays valid.

Behavioral parity checks

  • ./scripts/compile_engine.sh vulkan (Release): succeeded.
  • ctest --output-on-failure in build-vk-Release: all 26 tests passed (smoke, renderer regression scripts, unit tests).

Notes / non-candidates

  • Runtime cvars and CMake USE_* options (e.g. USE_LUA, USE_VULKAN_RTX) were not touched; disabling those still has real product meaning.
  • Wider removal of #ifdef USE_VK_PBR / #ifdef USE_VBO_GRID across .c files was out of scope: those guards still document optional paths (e.g. vk_shader_modules.c non-PBR branch) and would be a large, higher-risk refactor.
Open in Web View Automation 

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 <timfox@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant