Skip to content

Feature-flag cleanup: remove stale Vulkan compile-time guards#293

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

Feature-flag cleanup: remove stale Vulkan compile-time guards#293
cursor[bot] wants to merge 7 commits into
mainfrom
cursor/feature-flag-cleanup-2957

Conversation

@cursor

@cursor cursor Bot commented Jul 23, 2026

Copy link
Copy Markdown

Summary

Cherry-picked and rebased the established Vulkan compile-time feature-flag cleanup onto current main. Removes dead #else branches and always-on guards that no longer toggle behavior.

Branch: cursor/feature-flag-cleanup-2957main

Flags removed

Flag / guard Why safe to delete
USE_VBO_GRID Grid-mesh VBO path is unconditional in Vulkan builds; guards only wrapped already-active code with no alternate branch.
USE_TESS_NEEDS_NORMAL / USE_TESS_NEEDS_ST2 Tessellation attribute flags are always set during static VBO bake; no non-PBR fallback path remains.
USE_VK_PBR dead #else branches Non-PBR shader module tables and stub draw paths were unreachable — Vulkan renderer always defines USE_VK_PBR and uses generated PBR shaders.
Nested VK_CUBEMAP / VK_PBR_BRDFLUT under USE_VK_PBR Flattened to top-level defines in tr_local.h (both are unconditionally #defined for codebase inspection).
Reactive mask / pipeline no-op #else Removed (void)0 stubs and empty fallback blocks that compiled to no-ops.

Preserved (not removed)

  • One-sided #ifdef USE_VK_PBR blocks still used for shader variant selection and specialization constants.
  • Optional CMake gates (USE_VULKAN_RTX, USE_EXPERIMENTAL_RENDERERS, USE_VK_VALIDATION) — still meaningful build-time toggles.
  • Runtime cvars (r_forwardPlus, r_pbr, etc.) — user-facing controls, not compile-time rollout flags.

Stats

  • 20 files changed, 742 lines removed, 27 insertions
  • Zero remaining USE_VBO_GRID, USE_TESS_NEEDS_*, or #ifndef USE_VK_PBR in renderers/

Test plan

  • ./tests/scripts/test_vulkan_regression_source_guards.sh — PASS
  • Verified zero matches for removed flags in renderers/
  • Cherry-pick conflict in vk_create_pipeline.c resolved (kept updated 45-entry PBR specialization map from main)
  • ./scripts/bootstrap.sh engine (CI)
  • ./scripts/smoke_test.sh ./build-vk-Release (CI)

Behavioral parity checks

  • Active PBR/VBO/grid code paths unchanged — only conditional wrappers and dead fallbacks removed.
  • vk_add_attachment_desc_soft soft-fail API and Forward+ descriptor-pool invalidation guards preserved per regression test.
  • Runtime cubemap convolution remains disabled (vk.cubemapActive never set qtrue) per existing guardrail.
Open in Web View Automation 

cursoragent and others added 7 commits July 23, 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>
Unwrap the non-PBR shader file path fallback now that USE_VK_PBR is
always defined for the Vulkan renderer.

Co-authored-by: Tim Fox <timfox@outlook.com>
…aths

Unwrap always-on Forward+ reactive-mask descriptor updates and the
deferred-export use_pbr guard now that USE_VK_PBR is unconditionally defined.

Co-authored-by: Tim Fox <timfox@outlook.com>
USE_VBO_GRID is no longer defined anywhere; grid VBO reset is always-on.

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