Skip to content

Remove stale USE_TESS_NEEDS_* compile gates and dead shader needs* paths#210

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

Remove stale USE_TESS_NEEDS_* compile gates and dead shader needs* paths#210
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/obsolete-feature-flags-79c1

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented May 14, 2026

Summary

Removes compile-time USE_TESS_NEEDS_NORMAL / USE_TESS_NEEDS_ST2 scaffolding that no longer toggled real behavior: Vulkan never defined these macros (guarded code was dead), and OpenGL never defined USE_TESS_NEEDS_ST2 (lightmap secondary coords were already effectively always-on at compile time).

Flags / toggles removed

Item Why safe to delete
USE_TESS_NEEDS_NORMAL / USE_TESS_NEEDS_ST2 (Vulkan tr_local.h) Macros were commented out; all #ifdef branches resolved to the unconditional “always gather normals / ST2” path.
shader.needsST2 + tess.needsST2 (OpenGL) USE_TESS_NEEDS_ST2 was never defined; DetectNeeds still set needsST2 but tessellation never consulted it.
DetectNeeds() (Vulkan) shader.needsNormal / needsST2 were unused after tess fields were compile-gated off; removing avoids dead writes.
OpenGL DetectNeeds lightmap branch Replaced by the same multi-bundle scan already used for normals (covers TCGEN_LIGHTMAP on either bundle).

Behavioral parity

  • Vulkan / OpenGL: ./scripts/compile_engine.sh opengl and ./scripts/compile_engine.sh vulkan (Release) completed successfully.
  • Tests: ctest in build-vk-Release26/26 passed (smoke, renderer regression scripts, unit tests).

Files touched (high level)

  • Vulkan: tr_local.h, tr_shader.c, tr_surface.c, tr_shade.c, tr_main.c, tr_animation.c, vk_vbo.c
  • OpenGL: tr_local.h, tr_shader.c, tr_surface.c, tr_vbo.c, tr_shade.c
Open in Web View Automation 

… Vulkan

Vulkan never defined USE_TESS_NEEDS_NORMAL or USE_TESS_NEEDS_ST2, so all
guarded branches behaved as always-on. OpenGL never defined USE_TESS_NEEDS_ST2
(lightmap texcoord path was unconditional at compile time).

- Vulkan: drop tess/shader needs* fields, RB_BeginSurface propagation,
  DetectNeeds(), and redundant #ifdef/if wrappers.
- OpenGL: drop needsST2 from shader/tess, ST2-only DetectNeeds branch, and
  matching surface/VBO/shade wrappers; keep USE_TESS_NEEDS_NORMAL path.

Build: compile_engine.sh opengl + vulkan; ctest in build-vk-Release (26/26).

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