Skip to content

Feature-flag cleanup: stale Vulkan compile gates and legacy OpenGL cvars#254

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

Feature-flag cleanup: stale Vulkan compile gates and legacy OpenGL cvars#254
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/feature-flag-cleanup-a796

Conversation

@cursor

@cursor cursor Bot commented Jun 11, 2026

Copy link
Copy Markdown

Flags removed / flattened

Flag / gate Why safe
USE_TESS_NEEDS_NORMAL, USE_TESS_NEEDS_ST2 Never defined in tr_local.h (commented out); only dead #ifdef branches remained
USE_VBO_GRID Always defined when USE_VBO is on; grid VBO path is the only path
Non-PBR #else in vk_shader_modules.c USE_VK_PBR is unconditionally defined for the Vulkan renderer
Ungated r_allowSoftwareGL / r_glDriver Legacy OpenGL cvars; Vulkan-only client builds no longer register them unless USE_OPENGL_API
Nested #ifdef USE_VK_PBR in tr_local.h USE_VK_PBR / VK_CUBEMAP are always on; flattened to unconditional defines

Behavioral parity

  • Build: ./scripts/compile_engine.sh vulkan (Release) — success
  • Scripts: tests/scripts/test_vulkan_regression_source_guards.sh — pass
  • Compat: scripts/q3_openarena_compat_check.sh — pass (14/14 with built binaries)

Not in scope (left as candidates)

  • r_renderMode — actively used for deferred G-buffer / Forward+ latch (unlike older cleanup branches that treated it as a placeholder)
  • Runtime toggles with real off-paths: r_forwardPlus, r_pbr, r_vbo, RTX/volumetric cvars
  • Bulk removal of remaining #ifdef USE_VK_PBR / #ifdef USE_VBO wrappers across renderer sources

Regression guards added

  • PBR shader init must call vk_bind_generated_shaders() with no non-PBR fallback
  • tr_local.h must not reintroduce USE_VBO_GRID or USE_TESS_NEEDS_*
  • r_allowSoftwareGL registration gated behind USE_OPENGL_API in cl_main.c
Open in Web View Automation 

cursoragent and others added 2 commits June 11, 2026 10:04
- Drop dead non-PBR shader init fallback in vk_shader_modules.c (USE_VK_PBR
  is always defined for the Vulkan renderer).
- Remove unused USE_TESS_NEEDS_* and USE_VBO_GRID compile gates; grid VBO
  path and unconditional normal/ST2 tessellation are now the only path.
- Gate r_allowSoftwareGL/r_glDriver registration behind USE_OPENGL_API on
  Vulkan-only client builds; SDL GLimp only references them when OpenGL is
  compiled in.
- Extend regression/compat guards to prevent reintroducing removed flags.

Co-authored-by: Tim Fox <timfox@outlook.com>
tr_local.h unconditionally defines USE_VK_PBR for the Vulkan renderer;
remove dead #ifdef nesting around VK_PBR_BRDFLUT, VK_CUBEMAP, and cubemap
size constants. Behavior unchanged; complements stale gate removal.

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