Skip to content

Remove stale Vulkan compile-time feature flags (USE_VBO_GRID, USE_TESS_NEEDS, USE_VK_PBR #else)#277

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

Remove stale Vulkan compile-time feature flags (USE_VBO_GRID, USE_TESS_NEEDS, USE_VK_PBR #else)#277
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/feature-flag-cleanup-9284

Conversation

@cursor

@cursor cursor Bot commented Jul 10, 2026

Copy link
Copy Markdown

Summary

Removes stale compile-time feature flags in renderers/vulkan/ that are permanently enabled and whose disabled branches are dead code. Preserves runtime toggles (vk.pbrActive, r_pbr, etc.).

Flags removed

Flag Why safe to delete
USE_VBO_GRID Always defined when USE_VBO is on (always). Grid VBO path is the only implementation; #ifdef guards were no-ops.
USE_TESS_NEEDS_NORMAL / USE_TESS_NEEDS_ST2 Macros were commented out in tr_local.h; guards always evaluated false, so tess needsNormal/needsST2 plumbing was dead.
VERTEXSIZE 8 #else USE_VK_PBR is unconditionally defined; PBR vertex layout (11 floats) is the only path.
USE_VK_PBR #else in vk_shader_modules.c / vk_shutdown.c Non-PBR shader init/teardown paths unreachable; Vulkan renderer is PBR-only at compile time.
USE_VK_PBR header nesting Flattened always-on VK_PBR_BRDFLUT / VK_CUBEMAP defines in tr_local.h.
USE_VK_PBR guard in vk_pbr_ibl_validate.c Compile-time guard removed; runtime vk.pbrActive check retained.

Files touched

  • renderers/vulkan/tr_local.h, tr_surface.c, tr_shade.c, tr_main.c, tr_animation.c
  • renderers/vulkan/vk_shader_modules.c, vk_shutdown.c, vk_vbo.c
  • renderers/vulkan/vk_pbr_ibl_validate.c

Behavioral parity

  • Active paths unchanged: PBR vertex layout, grid VBO tessellation, generated PBR shaders, PBR IBL validation when vk.pbrActive.
  • Runtime cvars (r_pbr, r_forwardPlus, etc.) untouched.

Candidates not removed (low confidence)

  • Broader #ifdef USE_VK_PBR unwrapping across vk_*.c / tr_*.c (large diff, struct members still gated)
  • Legacy ignored cvars r_allowSoftwareGL / r_glDriver (kept for mod cfg compatibility)
  • Build-profile flags (USE_VULKAN_RTX, USE_EXPERIMENTAL_RENDERERS, etc.)

Test plan

  • ./tests/scripts/test_vulkan_regression_source_guards.sh — PASS
  • ./scripts/compile_engine.sh vulkan core — PASS
  • ./scripts/smoke_test.sh ./build-vk-Release (headless VM: server/binary checks only)
  • Manual client with mod data (not run in cloud agent)
  • Manifest updated — N/A (no CMake gate changes)
  • ./scripts/ci/audit_unconditional_sources.sh — N/A
Open in Web View Automation 

cursoragent and others added 2 commits July 10, 2026 10:03
…_VBO_GRID, USE_TESS_NEEDS)

- Delete dead non-PBR shader init and teardown paths (USE_VK_PBR always on)
- Unwrap USE_VBO_GRID grid-VBO paths; drop orphaned macro
- Remove disabled USE_TESS_NEEDS_NORMAL/ST2 guards and tess plumbing
- Pin VERTEXSIZE to 11 (PBR vertex layout)

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