Skip to content

Feature-flag cleanup: stale compile gates and OpenGL cvars#240

Draft
cursor[bot] wants to merge 4 commits into
mainfrom
cursor/feature-flag-cleanup-c3ef
Draft

Feature-flag cleanup: stale compile gates and OpenGL cvars#240
cursor[bot] wants to merge 4 commits into
mainfrom
cursor/feature-flag-cleanup-c3ef

Conversation

@cursor

@cursor cursor Bot commented Jun 4, 2026

Copy link
Copy Markdown

Flags / gates removed

Item Why safe
USE_VBO_GRID / USE_TESS_NEEDS_* #ifdef branches Grid VBO path always active when USE_VBO is defined; tess normal/ST2 macros were commented out and never enabled
Nested #ifdef USE_VK_PBR / USE_VBO in tr_local.h Macros were unconditionally enabled; flattened to equivalent #defines
r_allowSoftwareGL / r_glDriver client registration Vulkan-only client (USE_OPENGL_API undefined); cvars only registered when OpenGL API is compiled in
#else non-PBR path in vk_shader_modules.c USE_VK_PBR is always defined for Vulkan renderer
RENDERER_OPENGL glTF shader registration OpenGL renderer removed from fork; only Vulkan tr_model_gltf.c remains

Not removed (reviewed, kept)

  • r_renderMode — actively used by deferred G-buffer / Forward+ latch (tr_render_mode_vk.c, vk_deferred_gbuffer.c). Prior automation commit that removed it predates deferred work on this branch.
  • Runtime toggles with real off-paths: r_forwardPlus, r_vbo, r_pbr, volumetric/RTX cvars, engine sprite cvars.

Behavioral parity checks

  • ./scripts/compile_engine.sh vulkan — clean build
  • ctest in build-vk-Release — 32/32 passed
  • ./scripts/q3_openarena_compat_check.sh — passed

Commits

Cherry-picked proven cleanups (cf792697, 92119e5e, 18b7f37f) plus local removal of dead non-PBR shader init and OpenGL glTF path.

Open in Web View Automation 

cursoragent and others added 4 commits June 4, 2026 10:06
Remove USE_VBO_GRID and USE_TESS_NEEDS_* preprocessor branches from the
Vulkan renderer. These macros were either unconditionally enabled (grid
in VBO whenever USE_VBO) or never enabled (tess normal/ST2 commented out in
tr_local.h), so the active code path matches the previous build.

Co-authored-by: Tim Fox <timfox@outlook.com>
Vulkan tr_local.h always defined USE_VK_PBR and nested VK_CUBEMAP;
flatten to unconditional defines. Same for USE_VBO -> USE_VBO_GRID.
OpenGL always defined USE_VBO; define USE_VBO_GRID unconditionally.
Behavior and compile-time symbols are unchanged; only dead #if nesting removed.

Co-authored-by: Tim Fox <timfox@outlook.com>
Vulkan-only clients no longer register r_allowSoftwareGL or r_glDriver
(USE_OPENGL_API). SDL GLimp only touches those cvars when OpenGL is
compiled in. Replace obsolete "+set cl_renderer opengl" help text with
Vulkan/SDL guidance and update the demo features cfg comment.

Co-authored-by: Tim Fox <timfox@outlook.com>
USE_VK_PBR is unconditional in tr_local.h; drop the unreachable #else
legacy shader module wiring in vk_shader_modules.c. Remove RENDERER_OPENGL
gltf shader registration (OpenGL renderer removed from this fork).

Behavior unchanged on Vulkan builds.

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