Skip to content

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

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

chore: remove stale Vulkan compile-time feature flags#292
cursor[bot] wants to merge 7 commits into
mainfrom
cursor/feature-flag-cleanup-89f2

Conversation

@cursor

@cursor cursor Bot commented Jul 22, 2026

Copy link
Copy Markdown

Summary

Removes stale compile-time feature flags in the Vulkan renderer that are permanently on or off and no longer gate alternate code paths.

Flags removed

Flag Safe to delete because
USE_VBO_GRID Always defined when USE_VBO is on (tr_local.h); grid surfaces always use the VBO path
USE_TESS_NEEDS_NORMAL / USE_TESS_NEEDS_ST2 Permanently commented out; dead tessellation plumbing removed
USE_VK_PBR #else branches USE_VK_PBR is unconditionally #defined; non-PBR fallback paths were unreachable dead code
Nested VK_CUBEMAP / VK_PBR_BRDFLUT under USE_VK_PBR Flattened to always-on defines in tr_local.h (shader compile still uses -DUSE_VK_PBR)

~742 lines removed across 20 renderer files (shader init/teardown, draw/pipeline, BSP/RTX, reactive mask, VBO grid paths).

Behavioral parity

  • Active path unchanged: PBR vertex layout (VERTEXSIZE 11), VBO grid upload, cubemap/BRDF-LUT IBL scaffolding, and shader module tables remain as before.
  • No CMake gates or runtime cvars modified.

Candidates not touched (low confidence)

  • One-sided #ifdef USE_VK_PBR blocks still used for shader variant selection
  • Runtime latched cvars (r_forwardPlus, r_rtx, etc.)
  • Optional CMake gates (USE_VULKAN_RTX, USE_EXPERIMENTAL_RENDERERS)

Test plan

  • ./tests/scripts/test_vulkan_regression_source_guards.sh — PASS
  • Verified zero remaining USE_VBO_GRID, USE_TESS_NEEDS_*, or #ifndef USE_VK_PBR in renderers/
  • ./scripts/bootstrap.sh engine
  • ./scripts/smoke_test.sh ./build-vk-Release
  • Manual: client/server with mod data if applicable
  • Manifest updated if sources moved or CMake gates changed (docs/ENGINE_MODULE_MANIFEST.md)
  • ./scripts/ci/audit_unconditional_sources.sh (when touching CMake source lists)
Open in Web View Automation 

cursoragent and others added 7 commits July 22, 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