Skip to content

Renderer cleanup: remove dead if(0) gates and unused r_drawSun#165

Draft
cursor[bot] wants to merge 1 commit intomainfrom
cursor/stale-feature-flag-cleanup-212b
Draft

Renderer cleanup: remove dead if(0) gates and unused r_drawSun#165
cursor[bot] wants to merge 1 commit intomainfrom
cursor/stale-feature-flag-cleanup-212b

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented May 1, 2026

Summary

Removes permanently unreachable renderer branches and unused cvar/shader wiring so behavior matches what actually shipped.

Flags / knobs removed

Removed Why safe
r_drawSun Sun drawing was gated by if (0 && r_drawSun->integer) in both Vulkan and OpenGL backends — the cvar had no effect at runtime. Default was already 0.
Implicit r_lightmap == 2 HSV visualization Same pattern: if (0 && r_lightmap->integer == 2) meant that debug path never ran; r_lightmap remains for other uses.
Unused fastsky color-clear branch if (0 && r_fastsky->integer && ...) never executed; r_fastsky remains for sky rendering paths in tr_sky.c / tr_main.c.

Also removed dead plumbing only referenced by the removed paths: tr.sunShader, RB_DrawSun, and the "sun" shader lookup in CreateExternalShaders.

Behavioral parity

  • Vulkan and OpenGL Release builds (./scripts/compile_engine.sh vulkan / opengl).
  • ctest from build-vk-Release — all 19 tests passed (smoke, renderer regression check, units).

Notes

Saved configs that set r_drawSun will ignore that key (harmless). No gameplay or networking impact.

Open in Web View Automation 

- Drop permanently disabled r_lightmap==2 HSV debug branch and helper.
- Remove unused color-clear experiment gated by if(0&&r_fastsky).
- Remove r_drawSun cvar, sun shader lookup, and RB_DrawSun (never reachable).

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