Skip to content

Remove stale Vulkan compile gates and legacy OpenGL cvar plumbing#266

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

Remove stale Vulkan compile gates and legacy OpenGL cvar plumbing#266
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/feature-flag-cleanup-6b95

Conversation

@cursor

@cursor cursor Bot commented Jun 16, 2026

Copy link
Copy Markdown

Flags removed

Flag / plumbing Why safe
USE_VBO_GRID Unconditionally defined whenever USE_VBO is on (always in Vulkan tr_local.h). Grid VBO path is the only path.
USE_TESS_NEEDS_NORMAL / USE_TESS_NEEDS_ST2 Never defined (commented out). #ifdef branches were dead; tessellation always gathers normals and lightmap ST2.
shader.needsNormal / shader.needsST2 + DetectNeeds() Write-only metadata only consumed by the removed tess gates.
USE_VK_PBR #else in vk_shader_modules.c USE_VK_PBR is always #defined; non-PBR shader module init was unreachable.
r_allowSoftwareGL / r_glDriver registration OpenGL renderer removed; cvars only needed when USE_OPENGL_API is defined (legacy GLimp paths).

Behavioral parity

  • Active path unchanged: grid surfaces still use VBO, tess still emits normals/ST2, PBR shader binding via vk_bind_generated_shaders() unchanged.
  • Vulkan-only builds no longer register ignored legacy GL cvars at startup.

Validation

  • ./scripts/compile_engine.sh vulkan — success
  • tests/scripts/test_vulkan_regression_source_guards.sh — PASS
  • ./scripts/smoke_test.sh — PASS

Not removed (low confidence)

Runtime toggles still in use: r_forwardPlus, r_renderMode, r_vbo, r_pbr, r_volumetricFog, RTX cvars. Broader USE_VK_PBR / USE_VBO #ifdef unwrapping in headers deferred.

Open in Web View Automation 

cursoragent and others added 3 commits June 16, 2026 10:02
- Unwrap USE_VBO_GRID (always enabled with USE_VBO) in Vulkan renderer
- Remove dead USE_TESS_NEEDS_NORMAL/ST2 conditional branches (never defined)
- Gate r_allowSoftwareGL/r_glDriver behind USE_OPENGL_API (Vulkan-only builds)

Co-authored-by: Tim Fox <timfox@outlook.com>
These shader metadata fields were only consumed by the removed
USE_TESS_NEEDS_NORMAL/ST2 tess gating path. Tessellation now always
gathers normals and lightmap ST2 coordinates.

Co-authored-by: Tim Fox <timfox@outlook.com>
USE_VK_PBR is unconditionally defined in tr_local.h; drop the #else
branch that loaded legacy non-PBR vertex/fragment modules.

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