Skip to content

Remove stale tessellation compile flags (USE_TESS_NEEDS_*)#208

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

Remove stale tessellation compile flags (USE_TESS_NEEDS_*)#208
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/obsolete-feature-flags-ce79

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented May 13, 2026

Summary

Removes compile-time tessellation “feature flags” that were never enabled on Vulkan and partially dead on OpenGL, along with Vulkan-only dead shader metadata and DetectNeeds() that only populated removed fields.

Flags removed

Flag / plumbing Renderer Why safe to delete
USE_TESS_NEEDS_NORMAL / USE_TESS_NEEDS_ST2 (commented-out #defines and all #ifdef / if (tess.needs*) wrappers) Vulkan Both macros were never defined in tr_local.h. The preprocessor already behaved as always copy normals and second texcoord set; tess.needsNormal / tess.needsST2 were not struct members.
shader.needsNormal, shader.needsST2, DetectNeeds(), and RB_BeginSurface assignments to removed tess fields Vulkan Those shader fields were never read after tess propagation was compiled out; DetectNeeds() only set fields that nothing consumed.
USE_TESS_NEEDS_ST2 (comment + tess.needsST2, shader.needsST2, DetectNeeds lightmap branch, surface/VBO/shade wrappers) OpenGL Macro was never defined; behavior was already unconditional second texcoord (lightmap) fill.
Stale commented blocks in R_FindShader paths Both Dead comments referencing removed shader.needs* toggles.

Preserved: OpenGL USE_TESS_NEEDS_NORMAL path (macro remains defined); guarded if (tess.needsNormal) behavior unchanged.

Behavioral parity

  • Vulkan / OpenGL Release builds: ./scripts/compile_engine.sh vulkan and ./scripts/compile_engine.sh opengl (both succeeded).
  • Automated tests: ctest --output-on-failure in build-vk-Release26/26 passed (smoke, renderer regression check, artifact checks, script tests, unit tests).

Files touched

Vulkan: tr_local.h, tr_shade.c, tr_surface.c, tr_main.c, tr_animation.c, vk_vbo.c, tr_shader.c
OpenGL: tr_local.h, tr_shade.c, tr_surface.c, tr_vbo.c, tr_shader.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