Skip to content

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

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

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

Conversation

@cursor

@cursor cursor Bot commented Jul 12, 2026

Copy link
Copy Markdown

Summary

Removes dead compile-time feature-flag branches in the Vulkan renderer that are permanently enabled (or permanently disabled) in tr_local.h. No runtime behavior change on shipping builds.

Flags removed / unwrapped

Flag Why safe
USE_VK_PBR #else #define USE_VK_PBR is unconditional in tr_local.h; non-PBR shader init/teardown and pipeline paths were unreachable dead code.
USE_VBO_GRID Always defined when USE_VBO is on (also unconditional); grid-VBO paths are the only active path.
USE_TESS_NEEDS_NORMAL / USE_TESS_NEEDS_ST2 Macros are commented out in tr_local.h; guarded tess plumbing never compiled.
VERTEXSIZE conditional Pinned to 11 (PBR vertex layout), matching the only active configuration.
VK_CUBEMAP / VK_PBR_BRDFLUT wrappers Flattened always-on header defines; IBL validate guard simplified.

Files touched

  • tr_local.h, tr_animation.c, tr_main.c, tr_shade.c, tr_surface.c
  • vk_shader_modules.c, vk_shutdown.c, vk_vbo.c, vk_pbr_ibl_validate.c
  • vk.h, vk_attachments.c, vk_create_pipeline.c, vk_draw_state.c, vk_forward_plus.c, tr_material_paint.c

Behavioral parity checks

  • ./tests/scripts/test_vulkan_regression_source_guards.sh — PASS
  • Cherry-pick applied cleanly onto current main (3 commits, ~660 lines removed)
  • Full ./scripts/compile_engine.sh vulkan core — blocked by pre-existing tr_image_exr.cpp include-path failure (unrelated to this diff)

Candidates deferred (low confidence)

  • One-sided #ifdef USE_VK_PBR blocks in tr_shader.c / tr_local.h (struct members and runtime vk.pbrActive gates — larger unwrap, separate PR)
  • Runtime cvars (r_forwardPlus, r_renderMode, r_pbr) — intentional toggles, not compile-time flags

Test plan

  • ./tests/scripts/test_vulkan_regression_source_guards.sh
  • ./scripts/smoke_test.sh ./build-vk-Release (blocked by unrelated EXR loader build issue in this environment)
  • Manual client render smoke when display available
Open in Web View Automation 

cursoragent and others added 3 commits July 12, 2026 10:02
…_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