Skip to content

Vulkan: remove stale USE_VK_PBR, USE_VBO_GRID, and USE_TESS_NEEDS flags#267

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

Vulkan: remove stale USE_VK_PBR, USE_VBO_GRID, and USE_TESS_NEEDS flags#267
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/feature-flag-cleanup-b2d7

Conversation

@cursor

@cursor cursor Bot commented Jun 17, 2026

Copy link
Copy Markdown

Flags removed

Flag Why safe
USE_VK_PBR #else branch (vk_shader_modules.c) USE_VK_PBR is unconditionally #defined in tr_local.h; the non-PBR shader module init path was dead code (~120 lines).
USE_VBO_GRID ifdefs Always defined alongside USE_VBO in tr_local.h; grid surfaces always take the VBO path in production builds. Unwrapped in vk_vbo.c, tr_surface.c, and tr_local.h.
USE_TESS_NEEDS_NORMAL / USE_TESS_NEEDS_ST2 Both were commented out (never enabled). Removed compile gates and the write-only DetectNeeds() / shader.needsNormal / shader.needsST2 metadata they fed. Active behavior preserved: tessellation still gathers normals and lightmap ST2 unconditionally (matching prior undefined-flag builds).

Behavioral parity

  • USE_VK_PBR: PBR shader binding via vk_bind_generated_shaders() unchanged.
  • USE_VBO_GRID: Grid mesh VBO estimate, queue, and validation paths unchanged.
  • USE_TESS_NEEDS: Tessellation always copies normals/ST2 (same as when flags were undefined).

Validation

  • ./scripts/compile_engine.sh vulkan — pass
  • ./tests/scripts/test_vulkan_regression_source_guards.sh — pass
  • ./scripts/smoke_test.sh — pass

Candidates not touched (low confidence)

r_renderMode, r_forwardPlus, r_vbo, r_pbr, r_volumetricFog, RTX cvars, broader USE_VK_PBR/USE_VBO ifdef unwrapping, SKIP_IDPAK_CHECK.

Open in Web View Automation 

cursoragent and others added 2 commits June 17, 2026 10:05
- Drop dead non-PBR shader module init path in vk_shader_modules.c
  (USE_VK_PBR is unconditionally defined in tr_local.h).
- Unwrap USE_VBO_GRID ifdefs; grid surfaces always use the VBO path
  when USE_VBO is enabled.
- Remove disabled USE_TESS_NEEDS_NORMAL/ST2 compile gates and the
  write-only DetectNeeds() shader metadata they fed.
- Preserve active-path behavior: tessellation still gathers normals and
  lightmap ST2 unconditionally, matching the prior undefined-flag builds.

Co-authored-by: Tim Fox <timfox@outlook.com>
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