Skip to content

Vulkan: stable main FBO extent for temporal/Forward+/post queries#128

Merged
cursor[bot] merged 1 commit intomainfrom
cursor/stable-main-color-render-extent-7dab
Apr 20, 2026
Merged

Vulkan: stable main FBO extent for temporal/Forward+/post queries#128
cursor[bot] merged 1 commit intomainfrom
cursor/stable-main-color-render-extent-7dab

Conversation

@timfox
Copy link
Copy Markdown
Owner

@timfox timfox commented Apr 20, 2026

Summary

Several subsystems (vk_get_render_target_width/height, Forward+ packing, post FX params, temporal size checks) previously depended on vk.renderWidth, which auxiliary passes (shadow atlases, etc.) temporarily overwrite.

Changes

  • Cache the main scene color attachment pixel size as vk.mainColorWidth / vk.mainColorHeight when the FBO color image is created in vk_attachments.c, and clear it when the color image is destroyed.
  • When vk.fboActive and those fields are non-zero, vk_get_render_target_width/height prefer them over the transient vk.renderWidth pair.
  • Document the invariant in docs/RENDERER_2026_ARCHITECTURE_PASS.md.

Validation

  • ./scripts/compile_engine.sh vulkan (Release)
  • ./scripts/smoke_test.sh
  • ctest -R 'smoke_test|renderer_regression_check'
Open in Web Open in Cursor 

Store main FBO color attachment dimensions when attachments are built and
have vk_get_render_target_width/height prefer them while FBO is active.
Auxiliary passes that temporarily overwrite vk.renderWidth no longer skew
Forward+, post params, temporal resets, or scissor clamping.

Document the behavior in RENDERER_2026_ARCHITECTURE_PASS.md.

Co-authored-by: Tim Fox <timfox@outlook.com>
@cursor cursor Bot marked this pull request as ready for review April 20, 2026 19:36
@cursor cursor Bot merged commit 9f1192b into main Apr 20, 2026
45 of 51 checks passed
@cursor cursor Bot deleted the cursor/stable-main-color-render-extent-7dab branch April 20, 2026 19:36
Copy link
Copy Markdown

@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 for this PR diff.

I did not find any medium/high/critical vulnerabilities introduced by these changes.

Validated areas:

  • Data flow around vk.mainColorWidth / vk.mainColorHeight assignment and reads
  • Bounds/fallback behavior when attachment state is created/destroyed
  • Potential attacker-controlled input paths to memory/indexing/synchronization sinks

Result: changes are limited to renderer-internal extent bookkeeping and do not expose a plausible security exploit path in the modified code.

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