Vulkan: remove stale compile-time feature flags and dead branches - #300
Draft
cursor[bot] wants to merge 4 commits into
Draft
Vulkan: remove stale compile-time feature flags and dead branches#300cursor[bot] wants to merge 4 commits into
cursor[bot] wants to merge 4 commits into
Conversation
- USE_VBO_GRID: never defined (SF_GRID deliberately off VBO path per tr_local.h); remove dead grid VBO estimate/queue/pack paths in vk_vbo.c and tr_surface.c. - USE_TESS_NEEDS_NORMAL / USE_TESS_NEEDS_ST2: commented-out defines with no struct fields; remove preprocessor guards that only wrapped always-on paths. - USE_VK_PBR dead #else: unwrap non-PBR shader module init/destroy fallbacks in vk_shader_modules.c and vk_shutdown.c; flatten VK_CUBEMAP/VK_PBR_BRDFLUT nesting in tr_local.h; unwrap reactive/object-id storage descriptor (void)0 else stubs. - USE_DEDICATED_ALLOCATION: always defined in vk.h; drop redundant #ifndef override in vk_instance.c. Behavior unchanged on the active PBR/VBO/dedicated-allocation paths. Co-authored-by: Tim Fox <timfox@outlook.com>
USE_VK_PBR is unconditionally defined in tr_local.h for the Vulkan renderer. Remove non-PBR #else fallbacks in pipeline creation, vertex layout, descriptor counts, and BSP/surface helpers while keeping shader templates and runtime vk.pbrActive gating intact. Adds scripts/tools/unwrap_use_vk_pbr.py for future cleanups. Co-authored-by: Tim Fox <timfox@outlook.com>
Extend feature-flag cleanup beyond dead branches (USE_VBO_GRID, USE_TESS_NEEDS_*) by unwrapping compile-time guards for macros that are permanently defined in the Vulkan renderer: - USE_VBO, USE_FOG_COLLAPSE, USE_VK_PBR, USE_VULKAN - VK_CUBEMAP, VK_PBR_BRDFLUT Adds scripts/tools/unwrap_compile_flags.py for repeatable unwrapping and tests/scripts/test_stale_compile_flags.sh to block reintroduction of removed guards and orphan #endif regressions. Fixes stray preprocessor artifacts in vk_object_id.c and tr_shade.c left after guard removal. Co-authored-by: Tim Fox <timfox@outlook.com>
- USE_PMLIGHT was never defined; shadow paths always used lightDir - Unwrap always-on #if 1 tessellation/stage optimization blocks - Extend test_stale_compile_flags.sh to block reintroduced always-on guards - Wire stale compile-flag test into smoke_test.sh Co-authored-by: Tim Fox <timfox@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Scheduled feature-flag cleanup: removes compile-time guards and dead branches that are permanently on (or never defined) in the Vulkan renderer, preserving the active code path with no behavior change.
Flags removed
USE_VBO_GRIDtr_local.h; grid surfaces intentionally stay off the static VBO pathUSE_TESS_NEEDS_NORMAL/USE_TESS_NEEDS_ST2USE_PMLIGHTlightDirUSE_VBO,USE_FOG_COLLAPSE,USE_VK_PBR,USE_VULKAN#defined for the Vulkan renderer (tr_local.h/ CMake)VK_CUBEMAP,VK_PBR_BRDFLUTUSE_VK_PBR#elsebranches forUSE_VK_PBR#ifndef USE_VULKANstubs intr_backend.c#if 1intr_shader.c/tr_curve.cTooling / regression guards
scripts/tools/unwrap_compile_flags.py— repeatable unwrap for always-on macrosscripts/tools/unwrap_use_vk_pbr.py— targeted PBR else-branch removaltests/scripts/test_stale_compile_flags.sh— blocks reintroduction of removed guards + orphan#endifscantest_stale_compile_flags.shintoscripts/smoke_test.shBehavioral parity checks
tests/scripts/test_stale_compile_flags.shtests/scripts/test_vulkan_regression_source_guards.shtests/scripts/test_cpp20_sources.shDeferred (low confidence — not touched)
r_forwardPlus, experimentalr_*toggles) — still user-facingUSE_VULKAN_RTX,USE_EXPERIMENTAL_RENDERERS— optional CMake gates with real OFF paths-DUSE_VK_PBRshader variants — build-time shader matrix, not deadTest plan
tests/scripts/test_stale_compile_flags.shtests/scripts/test_vulkan_regression_source_guards.shtests/scripts/test_cpp20_sources.sh./scripts/compile_engine.sh vulkan(full build — recommended before merge)./scripts/smoke_test.sh ./releaseafter build