Skip to content

Feature-flag cleanup: remove stale Vulkan compile-time gates#290

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

Feature-flag cleanup: remove stale Vulkan compile-time gates#290
cursor[bot] wants to merge 6 commits into
mainfrom
cursor/feature-flag-cleanup-6b50

Conversation

@cursor

@cursor cursor Bot commented Jul 20, 2026

Copy link
Copy Markdown

Summary

Removes stale Vulkan compile-time feature flags and dead #else branches that can no longer execute. USE_VK_PBR is unconditionally defined in tr_local.h; the non-PBR fallback paths were unreachable dead code.

Branch: cursor/feature-flag-cleanup-6b50main

Flags removed

Flag / gate Why safe to delete
USE_VBO_GRID Defined only when USE_VBO is on (always); grid VBO path is the only compiled path
USE_TESS_NEEDS_NORMAL / USE_TESS_NEEDS_ST2 Commented out in tr_local.h; #ifdef blocks were never active
USE_VK_PBR dead #else branches USE_VK_PBR is #defined unconditionally; all #else fallbacks were unreachable
Nested VK_CUBEMAP / VK_PBR_BRDFLUT under USE_VK_PBR Flattened to top-level defines (always on with PBR)
Reactive-mask (void)0 #else No-op stub when PBR off; PBR is always on
vk_shader_modules.c #ifndef USE_VK_PBR table Non-PBR shader module table never compiled

Files touched (20)

Primarily renderers/vulkan/: tr_local.h, vk_vbo.c, vk_shader_modules.c, vk_shutdown.c, vk_create_pipeline.c, vk_draw_state.c, vk.h, vk_attachments.c, vk_forward_plus.c, vk_reactive_mask.c, tr_surface.c, tr_shade.c, tr_bsp.c, tr_bsp_stream.c, tr_shader_load.inc, tr_material_paint.c, tr_animation.c, tr_main.c, vk_pbr_ibl_validate.c, extensions/rtx/vk_rtx_world.c

Stats: 20 files, ~716 lines removed

Behavioral parity checks performed

  • tests/scripts/test_vulkan_regression_source_guards.sh — PASS
  • Verified zero remaining USE_VBO_GRID, USE_TESS_NEEDS_*, #ifndef USE_VK_PBR in renderers/vulkan/
  • Active PBR path preserved: vertex bindings (10), descriptor set count (20), VERTEXSIZE 11 layout, Forward+ reactive-mask descriptors

Not in scope (low confidence)

One-sided #ifdef USE_VK_PBR wrappers without #else (e.g. vk_attachments.c cube view-type path) remain — they are always-on but harmless; unwrapping them is a larger cosmetic diff.

Test plan

  • tests/scripts/test_vulkan_regression_source_guards.sh
  • ./scripts/smoke_test.sh ./build-vk-Release (headless VM: server/binary checks only)
  • Manifest update not required (no CMake gate changes)
Open in Web View Automation 

cursoragent and others added 6 commits July 20, 2026 10:18
…_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>
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