Skip to content

Remove dead renderer feature gates (r_drawSun, disabled branches)#159

Merged
timfox merged 1 commit intomainfrom
cursor/feature-flag-cleanup-9524
May 4, 2026
Merged

Remove dead renderer feature gates (r_drawSun, disabled branches)#159
timfox merged 1 commit intomainfrom
cursor/feature-flag-cleanup-9524

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented Apr 28, 2026

Flags / toggles removed

  • r_drawSun (cvar): Registration and cvar_t / extern declarations were removed. The only call path was under if ( 0 && r_drawSun->integer ), so the cvar had no effect on any build.

Why this is safe

  • Compile-time dead code: The lightmap “intensity visualization” path, fastsky extra color clear (OpenGL only), and sun quad draw were all guarded by if ( 0 && … ), so the compiler never executed them; behavior was already that of the else / fall-through path.
  • r_drawSun was orphaned: After removing the dead call site, there were no remaining references; removing the cvar matches actual engine behavior (sun quad was never drawn).
  • OpenGL and Vulkan were updated in parallel so both renderers stay aligned.

Behavioral parity

  • Vulkan and OpenGL: Full ./scripts/compile_engine.sh vulkan and opengl builds succeeded; ctest in build-vk-Release (19 tests including smoke and renderer checks) passed.
  • No change to live code paths for lightmap processing, view clears, or the main draw loop except deleting unreachable blocks and unused RB_DrawSun.
Open in Web View Automation 

- Drop if(0) gated lightmap dev path, fastsky color clear, and sun draw
- Remove unused RB_DrawSun and r_drawSun (no remaining references)
- Mirror changes in OpenGL and Vulkan for parity

Co-authored-by: Tim Fox <timfox@outlook.com>
@timfox timfox marked this pull request as ready for review May 4, 2026 23:04
@timfox timfox merged commit a89b16f into main May 4, 2026
45 of 53 checks passed
Copy link
Copy Markdown
Author

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security review complete: no high-confidence medium, high, or critical vulnerabilities found in this PR.

I validated that the modified code only removes dead renderer gates/disabled sun drawing paths and simplifies the existing lightmap processing branch; I did not find any new attacker-controlled input reaching an unsafe sink. No inline findings are being reported.

Open in Web View Automation 

Sent by Cursor Automation: Find vulnerabilities

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.

2 participants