Skip to content

Commit a435a05

Browse files
bors[bot]kvark
andcommitted
Merge #2402
2402: [mtl] keep borrowed clear value longer r=kvark a=kvark Intended to fix szeged/webrender#216 Note: this is a little scary of an issue. Doesn't appear that we have any more of them, but we need to keep an eye on those cases. PR checklist: - [ ] `make` succeeds (on *nix) - [ ] `make reftests` succeeds - [ ] tested examples with the following backends: - [ ] `rustfmt` run on changed code Co-authored-by: Dzmitry Malyshau <[email protected]>
2 parents 122da13 + dfe390c commit a435a05

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/backend/metal/src/command.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2313,7 +2313,9 @@ impl com::RawCommandBuffer<Backend> for CommandBuffer {
23132313
let pso; // has to live at least as long as all the commands
23142314
let depth_stencil;
23152315

2316-
let (com_clear, target_index) = match *clear.borrow() {
2316+
let borrowed_clear = clear.borrow();
2317+
//Note: ^ has to live at least as long as the command
2318+
let (com_clear, target_index) = match *borrowed_clear {
23172319
com::AttachmentClear::Color { index, value } => {
23182320
let channel = self.state.target_formats.colors[index].1;
23192321
//Note: technically we should be able to derive the Channel from the

0 commit comments

Comments
 (0)