Skip to content

Vulkan: remove dead USE_VK_PBR non-PBR shader module path#213

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/obsolete-feature-flags-a592
Draft

Vulkan: remove dead USE_VK_PBR non-PBR shader module path#213
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/obsolete-feature-flags-a592

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented May 16, 2026

Summary

Removes compile-time branches in vk_create_shader_modules() that could never run for the Vulkan renderer.

Flags / compile toggles removed (as dead code)

  • USE_VK_PBR guarded #else in vk_shader_modules.c — The non-PBR legacy shader module creation path. In src/renderers/vulkan/tr_local.h, USE_VK_PBR is always #defined for this renderer, and CMake does not expose a way to turn it off, so the #else block never compiled.
  • #ifndef USE_VK_PBR / int l — Only existed for the unused #else loop; removing it avoids a misleading “optional PBR” signal in this file.

VK_PBR_BRDFLUT and other USE_VK_* / USE_VBO preprocessor gates elsewhere are unchanged.

Why this is safe

Behavior matches the only path that could ever execute before: vk_bind_generated_shaders() after the shared fragment setup. No runtime cvars or gameplay paths were touched.

Behavioral parity checks performed

  • ./scripts/compile_engine.sh vulkan (Release) — succeeded.
  • ctest --output-on-failure in build-vk-Release — all 26 tests passed (smoke, renderer regression scripts, unit tests).
Open in Web View Automation 

USE_VK_PBR is unconditionally defined in tr_local.h for the Vulkan
renderer and is not a CMake toggle, so the #else path in
vk_create_shader_modules never compiled. Remove the unused legacy
module wiring and the redundant #ifndef int l guard.

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