Skip to content

fix(renderer): deferred path honors the render-target override#121

Merged
proggeramlug merged 1 commit into
mainfrom
feat/render-to-texture
Jul 17, 2026
Merged

fix(renderer): deferred path honors the render-target override#121
proggeramlug merged 1 commit into
mainfrom
feat/render-to-texture

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

The override set by begin_texture_mode was only consulted by the simple 2D end_frameend_frame_with_scene (every 3D app) acquired and presented the surface unconditionally, so render-to-texture has silently no-oped for 3D content since Q1. Now the deferred frame's final passes write the RT view (all depth-less — no attachment-size hazards), nothing presents, and the screenshot branch defers to the next real frame.

Proven live: the editor's model thumbnails render into 128px targets and draw through drawTexturePro — screenshot-verified, the first successful RT sampling in the engine. Follow-up tracked: a native golden test for the RT round-trip.

https://claude.ai/code/session_01PmL9WgNMkAgvpYSHEZga8K

Summary by CodeRabbit

  • Bug Fixes
    • Improved rendering when drawing to custom textures by correctly using the configured color and depth targets.
    • Prevented unnecessary screen presentation and screenshot readback during off-screen rendering.
    • Preserved normal display output when rendering directly to the screen.

…render-to-texture works for 3D apps

begin_texture_mode's override was only consulted by the simple 2D
end_frame; end_frame_with_scene — the path every 3D app actually runs —
acquired the surface unconditionally and presented, so render-to-texture
silently no-oped for 3D content since Q1: the frame went to the screen
and the RT kept its initial contents. (Found by the editor's thumbnail
work: even a bare magenta clear never reached the texture.)

Now: when the override is armed, the deferred frame's final passes
(post/compose chain + 2D overlay — all depth-less, so no attachment-size
hazards) write the RT view, nothing is acquired or presented, and the
screenshot branch defers to the next real frame. All intermediate
passes are unchanged.

Proven end-to-end: the editor renders model thumbnails into 128px
targets via dedicated frames and draws them through drawTexturePro —
the first successful RT sampling in the engine. Follow-up: a golden
test for the RT round-trip in the native suite.

Claude-Session: https://claude.ai/code/session_01PmL9WgNMkAgvpYSHEZga8K
@proggeramlug
proggeramlug merged commit 5fec89f into main Jul 17, 2026
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7bb8e6ac-ee01-4d39-b87f-f36953a8e59a

📥 Commits

Reviewing files that changed from the base of the PR and between 64cfec3 and 0e2c981.

📒 Files selected for processing (1)
  • native/shared/src/renderer/mod.rs

📝 Walkthrough

Walkthrough

end_frame_with_scene now renders directly to active render-target overrides, preserves those views, suppresses swapchain-dependent screenshot readback, and presents frames only when a swapchain output was acquired.

Changes

Render-target output handling

Layer / File(s) Summary
Render-target selection
native/shared/src/renderer/mod.rs
end_frame_with_scene detects active render-target overrides, skips swapchain acquisition, and selects the override color and depth views.
Output-dependent frame completion
native/shared/src/renderer/mod.rs
Screenshot readback is disabled for render-target frames, and present_frame runs only when swapchain output exists.

Estimated code review effort: 3 (Moderate) | ~20 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/render-to-texture

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

proggeramlug added a commit that referenced this pull request Jul 17, 2026
test: live-GPU regression pin for the deferred RT override (#121)
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