Skip to content

Feature-flag cleanup: remove stale Vulkan compile-time flags#283

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

Feature-flag cleanup: remove stale Vulkan compile-time flags#283
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/feature-flag-cleanup-e683

Conversation

@cursor

@cursor cursor Bot commented Jul 11, 2026

Copy link
Copy Markdown

Summary

Removes stale compile-time feature flags and dead non-PBR fallback branches in the Vulkan renderer. USE_VK_PBR is unconditionally defined in tr_local.h; the removed #else paths could not be built and only added maintenance burden.

Branch: cursor/feature-flag-cleanup-e683main

Flags removed / unwrapped

Flag / guard Why safe
USE_VK_PBR #else in vk_shader_modules.c, vk_shutdown.c Non-PBR shader module init and teardown paths; Vulkan shipping build always defines USE_VK_PBR
USE_VBO_GRID Always enabled when USE_VBO is on; grid surfaces always use VBO path
USE_TESS_NEEDS_NORMAL / USE_TESS_NEEDS_ST2 Macros were commented out (disabled); dead tess attribute plumbing removed
VERTEXSIZE 8 #else PBR vertex layout (11 floats) is the only supported layout
USE_VK_PBR header nesting Flattened always-on VK_PBR_BRDFLUT / VK_CUBEMAP defines
USE_VK_PBR #else in vk_draw_state.c, vk_create_pipeline.c, vk.h, vk_attachments.c, vk_forward_plus.c, tr_material_paint.c Dead non-PBR vertex binding counts (8 vs 10), descriptor set count (5 vs 20), shader module table sizes, pipeline factory switch, and material-paint color offsets (index 7 vs 10)
vk_pbr_ibl_validate.c compile guard File only meaningful when PBR is compiled; runtime vk.pbrActive / r_pbr gating preserved

Behavioral parity

  • Active PBR/VBO code paths unchanged; only unreachable #else branches and guards removed.
  • Runtime toggles preserved: r_pbr, vk.pbrActive, Forward+, deferred, material blend, etc.

Test plan

  • ./tests/scripts/test_vulkan_regression_source_guards.sh
  • ./scripts/compile_engine.sh vulkan core
  • ./scripts/smoke_test.sh ./build-vk-Release (headless VM; not run this iteration)
  • Manual client with game data

Remaining candidates (not changed — low confidence)

  • One-sided #ifdef USE_VK_PBR guards in tr_local.h / tr_shader.c (struct fields; no #else)
  • Legacy cvars: r_allowSoftwareGL, r_glDriver
  • Runtime feature cvars: r_forwardPlus, r_renderMode, SKIP_IDPAK_CHECK
Open in Web View Automation 

cursoragent and others added 3 commits July 11, 2026 10:01
…_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>
Remove non-PBR fallback code paths that cannot compile: USE_VK_PBR is
unconditionally defined in tr_local.h. Keeps PBR vertex bindings (10),
descriptor set count (20), shader module tables, pipeline factory switch,
and material paint vertex color offsets (VERTEXSIZE 11 layout).

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