fix(gpui): keep rejected in scope for the external-texture draw

Merged
SO
1mo ago
+4-1

What this fixes

The Windows build of gpui_windows failed to compile. In DirectXRenderer's external-texture draw, rejected was declared inside the device-borrow block, but the partial-upload check that reads it runs after that block ends. The fix moves the declaration above the block. There is no behaviour change on any platform.

Why merge it now

Cherry Pick already pins this commit (d31a784): cherrypick main has pointed its cherrypick-zed submodule here since 877920ef ("point cherrypick-zed at the Windows external-texture compile fix"). The commit exists only on this branch, so deleting or force-pushing the branch would leave the pinned submodule commit unfetchable for fresh clones and CI. Merging it into main makes the pin reachable from the default branch.

Checks

  • One commit, crates/gpui_windows/src/directx_renderer.rs, +4/−1.
  • It sits directly on top of main (6397a12), so the merge is a fast-forward with no conflicts.
  • Cherry Pick main and CodeCraftersLLC/cherrypick#132 already check out this commit as their submodule. Their PR CI does not compile the Windows renderer, so the Windows build itself was not re-verified here.

🤖 Generated with Claude Code


[!NOTE]
Low Risk
Single-line scoping fix in Windows rendering with no intended runtime behavior change.

Overview
Fixes a Windows compile error in draw_external_frame: the rejected flag was declared inside the scoped block that borrows the D3D device, but the function still reads it after that block when deciding whether to return ExternalTextureUpload::Partial.

The change moves let mut rejected = false above the device block and adds a short comment. Upload validation still sets rejected inside the block; the post-draw partial-upload path is unchanged in intent—only the variable’s lifetime is widened so the crate builds.

Reviewed by Cursor Bugbot for commit d31a784a13e539f8bdefa770bac39e1f0ae7da4b. Bugbot is set up for automated code reviews on this repo. Configure here.


Summary by cubic

Fixes the Windows compile failure in gpui_windows's external-texture draw by moving the rejected flag above the device-borrow block, where the partial-upload check reads it after the borrow ends. No behavior change on any platform.

Merge note

  • Cherry Pick's cherrypick-zed submodule pins this commit, which exists only on this branch; merging into main keeps the pin reachable for fresh clones and CI.