Skip to content

Remove stale Vulkan renderer compile-time feature flags#274

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

Remove stale Vulkan renderer compile-time feature flags#274
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/feature-flag-cleanup-03ad

Conversation

@cursor

@cursor cursor Bot commented Jun 25, 2026

Copy link
Copy Markdown

Summary

Removes three classes of stale compile-time flags in the Vulkan renderer where the active path has been fully rolled out for years. No runtime cvar behavior changes.

Branch: cursor/feature-flag-cleanup-03admain

Flags removed

Flag Why safe to delete
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 (~120 lines) was dead code; PBR generated shaders via vk_bind_generated_shaders() is the only live path.
USE_VBO_GRID ifdefs (vk_vbo.c, tr_surface.c, tr_local.h) Always enabled whenever USE_VBO is on (also unconditional). Unwrapped #ifdef gates; grid VBO estimate/build path is the only compiled behavior.
USE_TESS_NEEDS_NORMAL / USE_TESS_NEEDS_ST2 (renderer tessellation) Macros were commented out in tr_local.h, so optimization gates were disabled. Removed dead DetectNeeds(), shader.needsNormal/needsST2, tess fields, and conditional copy guards. Parity: with flags off, normals/ST2 were always copied; that behavior is preserved.

Behavioral parity checks

  • ./scripts/compile_engine.sh vulkan core — full build succeeds; idtech3_vulkan.so links cleanly
  • ./tests/scripts/test_vulkan_regression_source_guards.sh — PASS
  • Renderer sources compile with no new errors (warnings unchanged)
  • ./scripts/smoke_test.sh — pre-existing q3_openarena_compat_check.sh failure (r_forwardPlusDepthCull default); unrelated to this diff

Files touched

  • renderers/vulkan/vk_shader_modules.c
  • renderers/vulkan/vk_vbo.c
  • renderers/vulkan/tr_surface.c
  • renderers/vulkan/tr_local.h
  • renderers/vulkan/tr_shader.c
  • renderers/vulkan/tr_shade.c
  • renderers/vulkan/tr_main.c
  • renderers/vulkan/tr_animation.c

Candidates not changed (low confidence)

  • Runtime cvars: r_renderMode, r_forwardPlus, r_vbo, r_pbr, r_volumetricFog, RTX toggles
  • Broader USE_VK_PBR ifdef unwrapping across vk.h / pipeline code (still used for optional PBR fields)
  • Legacy no-op cvars r_allowSoftwareGL / r_glDriver (mod cfg compatibility)
Open in Web View Automation 

- Drop dead non-PBR shader module init path (USE_VK_PBR #else)
- Unwrap USE_VBO_GRID (always enabled with USE_VBO)
- Remove disabled USE_TESS_NEEDS_* optimization plumbing

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