Skip to content

Vulkan: remove dead non-PBR shader module init path#200

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/stale-feature-flag-cleanup-83f3
Draft

Vulkan: remove dead non-PBR shader module init path#200
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/stale-feature-flag-cleanup-83f3

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented May 8, 2026

Summary

Removes unreachable initialization code in vk_create_shader_modules() that assumed the Vulkan renderer could be built without USE_VK_PBR.

Flags / compile gates

  • Stale path removed: #ifdef USE_VK_PBR / #else branch in src/renderers/vulkan/vk_shader_modules.c (the #else legacy SPIR-V module wiring).
  • Why it is safe to delete: USE_VK_PBR is unconditionally #defined in src/renderers/vulkan/tr_local.h for this renderer, so the #else never compiled. Runtime behavior matches the previous active (PBR) path: vk_bind_generated_shaders() followed by the shared post-processing and utility modules.

Behavioral parity

  • No change to the executed PBR initialization sequence; only deleted dead code.
  • Build: ./scripts/compile_engine.sh vulkan (Release) — succeeded.
  • Tests: ctest --output-on-failure in build-vk-Release — 26/26 passed (smoke, renderer checks, unit tests).

Notes

The USE_VK_PBR macro remains in the tree for shader templates and the rest of the Vulkan sources; this change only removes the obsolete non-PBR module setup that could not be selected with the current headers.

Open in Web View Automation 

USE_VK_PBR is unconditionally defined in tr_local.h for the Vulkan
renderer, so the #else branch in vk_create_shader_modules() never
compiled. Remove the stale conditional and legacy SPIR-V wiring to
keep a single PBR initialization path.

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