Skip to content

Vulkan: remove stale compile-time feature flags and dead branches - #294

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/feature-flag-cleanup-546c
Draft

Vulkan: remove stale compile-time feature flags and dead branches#294
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/feature-flag-cleanup-546c

Conversation

@cursor

@cursor cursor Bot commented Aug 5, 2026

Copy link
Copy Markdown

Summary

Removes compile-time feature flags and dead #else branches in the Vulkan renderer where rollout is complete and only one path could ever compile.

Flags removed

Flag Why safe
USE_VBO_GRID Never defined; tr_local.h documents SF_GRID is deliberately off the static VBO path. Removed dead grid estimate/queue/pack code in vk_vbo.c and tr_surface.c.
USE_TESS_NEEDS_NORMAL / USE_TESS_NEEDS_ST2 Commented-out defines with no tess struct fields. Guards only wrapped always-on normal/ST2 copy paths.
USE_VK_PBR dead #else USE_VK_PBR is unconditionally #defined in tr_local.h. Removed non-PBR shader module init/destroy fallbacks in vk_shader_modules.c and vk_shutdown.c; flattened VK_CUBEMAP/VK_PBR_BRDFLUT header nesting; unwrapped reactive/object-id (void)0 else stubs.
USE_DEDICATED_ALLOCATION dead #ifndef Always defined in vk.h; removed redundant force-off override in vk_instance.c.

Stats: 11 files, 479 lines removed.

One-sided #ifdef USE_VK_PBR guards (runtime vk.pbrActive gating) are intentionally retained.

Test plan

  • tests/scripts/test_vulkan_regression_source_guards.sh PASS
  • Grep: zero USE_VBO_GRID / USE_TESS_NEEDS / #ifndef USE_VK_PBR / #ifndef USE_DEDICATED_ALLOCATION in renderers/
  • ./scripts/smoke_test.sh ./build-vk-Release (CI)
  • Manifest unchanged (no CMake gate edits)
Open in Web View Automation 

- USE_VBO_GRID: never defined (SF_GRID deliberately off VBO path per tr_local.h);
  remove dead grid VBO estimate/queue/pack paths in vk_vbo.c and tr_surface.c.
- USE_TESS_NEEDS_NORMAL / USE_TESS_NEEDS_ST2: commented-out defines with no
  struct fields; remove preprocessor guards that only wrapped always-on paths.
- USE_VK_PBR dead #else: unwrap non-PBR shader module init/destroy fallbacks in
  vk_shader_modules.c and vk_shutdown.c; flatten VK_CUBEMAP/VK_PBR_BRDFLUT nesting
  in tr_local.h; unwrap reactive/object-id storage descriptor (void)0 else stubs.
- USE_DEDICATED_ALLOCATION: always defined in vk.h; drop redundant #ifndef override
  in vk_instance.c.

Behavior unchanged on the active PBR/VBO/dedicated-allocation paths.

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