Skip to content

Vulkan: remove dead USE_UPLOAD_QUEUE; simplify reversed-depth branches#148

Merged
timfox merged 2 commits intomainfrom
cursor/stale-feature-flag-cleanup-163e
May 4, 2026
Merged

Vulkan: remove dead USE_UPLOAD_QUEUE; simplify reversed-depth branches#148
timfox merged 2 commits intomainfrom
cursor/stale-feature-flag-cleanup-163e

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented Apr 26, 2026

Flags / compile toggles removed

  1. USE_UPLOAD_QUEUE (implicit dead feature)

    • Why safe: The macro was never defined by CMake or any header in-tree. The #ifdef blocks could only ever compile the #else path. The #ifdef branch also referenced symbols (vk.image_uploaded, vk.rendering_finished, vk.cmd->rendering_finished2, vk.staging_command_buffer) that do not exist on Vk_Instance / vk_tess_t, so enabling the macro would not have been a viable configuration.
  2. Non-reversed branches behind USE_REVERSED_DEPTH

    • Why safe: USE_REVERSED_DEPTH is unconditionally #defined in src/renderers/vulkan/vk.h for the Vulkan renderer. The removed #else paths were never selected in any supported build. USE_REVERSED_DEPTH remains defined for GLSL (compile_shaders.sh still passes -DUSE_REVERSED_DEPTH for the listed shaders).

Behavioral parity

  • Active path preserved: Queue submit/wait/present remains the single-semaphore path that was always compiled before. Reversed-depth math, clears, depth compares, polygon offset, SSAO push constant, and flare ortho Z range match the previous #ifdef USE_REVERSED_DEPTH / #ifndef USE_REVERSED_DEPTH branches that were actually in use.
  • Build: ./scripts/compile_engine.sh vulkan (Release) succeeded.
  • Tests: ctest in build-vk-Release — all 19 tests passed (smoke, renderer regression, unit tests).

Notes

  • OpenGL renderer (src/renderers/opengl/tr_main.c) is unchanged; Vulkan-only tr_main.c edits are under #ifdef USE_VULKAN as before.
Open in Web View Automation 

cursoragent and others added 2 commits April 26, 2026 10:09
USE_UPLOAD_QUEUE was never defined in CMake or headers; the guarded code
referenced non-existent vk fields and could not compile if enabled.
Keep the single-queue submit path that is actually built.

Co-authored-by: Tim Fox <timfox@outlook.com>
USE_REVERSED_DEPTH is unconditionally defined in vk.h for this renderer;
remove the alternate depth/compare/clear paths so the live reversed-depth
behavior is explicit. OpenGL path in tr_main.c is unchanged.

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 409dadb into main May 4, 2026
52 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 completed for PR #148.

Outcome: no high-confidence medium, high, or critical vulnerabilities found in the added or modified code. The diff removes dead Vulkan upload-queue compile branches and non-reversed-depth code paths; I did not find a new attacker-controlled path to injection, auth/permission bypass, secret exposure, traversal/SSRF/XSS, unsafe deserialization, or supply-chain risk.

Prior automation threads: none found to revalidate.

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