Skip to content

Remove stale Vulkan compile flags and legacy OpenGL cvar wiring#257

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/feature-flag-cleanup-bcf2
Draft

Remove stale Vulkan compile flags and legacy OpenGL cvar wiring#257
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/feature-flag-cleanup-bcf2

Conversation

@cursor

@cursor cursor Bot commented Jun 12, 2026

Copy link
Copy Markdown

Flags removed

Flag / plumbing Why safe Parity check
USE_VK_PBR #else branch in vk_shader_modules.c USE_VK_PBR is unconditionally #defined in tr_local.h; non-PBR shader module path was dead code Release build + ctest -R smoke_test
USE_VBO_GRID compile gate Always enabled whenever USE_VBO is on (also unconditional); grid VBO path is the only active path Release build + smoke test
USE_TESS_NEEDS_NORMAL / USE_TESS_NEEDS_ST2 Macros were commented out (never defined); cleanup keeps the prior off-path behavior (unconditional normal/ST2 copies) Release build + smoke test
r_allowSoftwareGL / r_glDriver registration on Vulkan-only builds CMake client target defines USE_VULKAN_API only (no USE_OPENGL_API); cvars were documented as ignored legacy stubs test_vulkan_regression_source_guards.sh + Q3/OA compat check

Changes

  • Delete ~120 lines of unreachable non-PBR shader module loading.
  • Inline SF_GRID VBO handling (remove USE_VBO_GRID ifdef wrappers).
  • Strip disabled tessellation need guards while preserving current runtime behavior.
  • Register legacy OpenGL cvars only under USE_OPENGL_API; gate SDL GLimp usage similarly.
  • Add regression guards in tests/scripts/test_vulkan_regression_source_guards.sh.

Candidates not removed (low confidence)

  • Runtime toggles with real off-paths: r_forwardPlus, r_vbo, r_pbr, r_renderMode, r_volumetricFog, RTX cvars
  • USE_VBO / USE_VK_PBR outer #ifdef wrappers (large refactor)
  • SKIP_IDPAK_CHECK (still used in files.c and build scripts)

Validation

  • ./scripts/compile_engine.sh vulkan (Release) — pass
  • ctest -R "smoke_test|test_vulkan_regression_source_guards" — pass
  • ./scripts/q3_openarena_compat_check.sh release — pass
Open in Web View Automation 

- Drop dead non-PBR shader module fallback (USE_VK_PBR always on)
- Inline USE_VBO_GRID path (always enabled with USE_VBO)
- Remove disabled USE_TESS_NEEDS_* conditional wrappers
- Register r_allowSoftwareGL/r_glDriver only when USE_OPENGL_API
- Add regression guards for removed flag plumbing

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