Skip to content

Remove stale Vulkan compile gates (USE_VK_PBR, RENDERER_OPENGL, USE_TESS_NEEDS_*)#250

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

Remove stale Vulkan compile gates (USE_VK_PBR, RENDERER_OPENGL, USE_TESS_NEEDS_*)#250
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/feature-flag-cleanup-bca1

Conversation

@cursor

@cursor cursor Bot commented Jun 9, 2026

Copy link
Copy Markdown

Flags removed

Flag / gate Why safe to delete
USE_VK_PBR #else branch (vk_shader_modules.c) USE_VK_PBR is unconditionally #defined in tr_local.h for all Vulkan builds; the non-PBR shader registration path was unreachable dead code (~120 lines).
RENDERER_OPENGL glTF path (tr_model_gltf.c) OpenGL renderer was removed in #66735f16; only the Vulkan base-color shader registration path remains active.
USE_TESS_NEEDS_NORMAL / USE_TESS_NEEDS_ST2 (Vulkan tessellation) Macros were never defined on Vulkan (commented out in tr_local.h), so all #ifdef branches compiled as always-on. Removed needsNormal/needsST2 fields, DetectNeeds(), and redundant wrappers in tr_surface.c, tr_shade.c, tr_animation.c, vk_vbo.c, tr_shader.c, tr_main.c.
Duplicate r_imgui cvar declaration (tr_init.c) Second declaration block (with r_studio_tools) is the canonical one; first block was redundant.
Stale r_fastsky portal comment (tr_main.c) Commented-out condition removed; behavior unchanged.

Behavioral parity

  • Build: ./scripts/compile_engine.sh vulkan — success (Release).
  • CTest: 69/71 passed; the 2 failures (test_openworld, test_openworld_runtime — zip packaging) reproduce on main unchanged.
  • Guards: tests/scripts/test_vulkan_regression_source_guards.sh — PASS.
  • Compat: scripts/q3_openarena_compat_check.sh — 13/13 PASS.

Candidates not removed (low confidence)

  • Runtime cvars with real off-paths: r_forwardPlus, r_renderMode, r_vbo, RTX/VDB toggles.
  • USE_VBO_GRID / USE_VBO compile wrappers — always on but large #ifdef surface; needs dedicated pass.
  • r_allowSoftwareGL / r_glDriver — legacy cvars still referenced in platform sdl_glimp.c OpenGL attribute path.
Open in Web View Automation 

cursoragent and others added 3 commits June 9, 2026 10:04
- Drop non-PBR shader module registration branch (USE_VK_PBR is always defined)
- Remove RENDERER_OPENGL glTF shader path; Vulkan-only loader remains
- Remove stale r_fastsky portal comment and duplicate r_imgui cvar declarations

Co-authored-by: Tim Fox <timfox@outlook.com>
… Vulkan

Vulkan never defined USE_TESS_NEEDS_NORMAL or USE_TESS_NEEDS_ST2, so all
guarded branches behaved as always-on. OpenGL never defined USE_TESS_NEEDS_ST2
(lightmap texcoord path was unconditional at compile time).

- Vulkan: drop tess/shader needs* fields, RB_BeginSurface propagation,
  DetectNeeds(), and redundant #ifdef/if wrappers.
- OpenGL: drop needsST2 from shader/tess, ST2-only DetectNeeds branch, and
  matching surface/VBO/shade wrappers; keep USE_TESS_NEEDS_NORMAL path.

Build: compile_engine.sh opengl + vulkan; ctest in build-vk-Release (26/26).

Co-authored-by: Tim Fox <timfox@outlook.com>
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