Skip to content

chore: remove stale Vulkan compile-time feature flags#276

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

chore: remove stale Vulkan compile-time feature flags#276
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/feature-flag-cleanup-9aa2

Conversation

@cursor

@cursor cursor Bot commented Jul 9, 2026

Copy link
Copy Markdown

Summary

Removes dead compile-time feature-flag branches in the Vulkan renderer where rollout is complete (USE_VK_PBR always on, USE_VBO_GRID always on, USE_TESS_NEEDS_* permanently disabled). Net −337 LOC; active rendering paths unchanged.

Flags removed

Flag Why safe
USE_VK_PBR #else paths #define USE_VK_PBR is unconditional in tr_local.h; non-PBR shader init/teardown was unreachable dead code
USE_VBO_GRID Always enabled with USE_VBO; grid surfaces always use the VBO path — guards were no-ops
USE_TESS_NEEDS_NORMAL / USE_TESS_NEEDS_ST2 Macros commented out in tr_local.h; guarded blocks were compiled out; tess needsNormal/needsST2 plumbing removed
VERTEXSIZE 8 fallback PBR 11-float vertex layout is the only live path when USE_VK_PBR is on

Runtime toggles preserved: vk.pbrActive, r_pbr, etc.

Files touched

  • renderers/vulkan/vk_shader_modules.c — drop legacy manual shader table
  • renderers/vulkan/vk_shutdown.c — drop legacy module destroy loops
  • renderers/vulkan/vk_vbo.c, tr_surface.c — unwrap grid VBO + tess guards
  • renderers/vulkan/tr_shade.c, tr_animation.c, tr_main.c, tr_local.h — tess flag cleanup

Test plan

  • ./tests/scripts/test_vulkan_regression_source_guards.sh
  • ./scripts/compile_engine.sh vulkan core
  • ./scripts/smoke_test.sh ./build-vk-Release (CI)
  • Manual client with mod data (GPU/display required)

Behavioral parity checks

  • PBR shader binding still via vk_bind_generated_shaders() (only live init path)
  • Grid BSP surfaces still routed through RB_SurfaceGridEstimate / VBO bake
  • World face tessellation uses 11-component VERTEXSIZE layout
  • vk.pbrActive runtime checks unchanged (compile guards removed only)

Not in scope (low confidence)

  • Broader #ifdef USE_VK_PBR unwrap across remaining vk_*.c / tr_*.c
  • Legacy client cvars r_allowSoftwareGL / r_glDriver (config compat)
  • Runtime latched cvars: r_forwardPlus, r_renderMode, r_pbr, RTX toggles
Open in Web View Automation 

…_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>
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