Skip to content

Commit dfe390c

Browse files
committed
[mtl] keep borrowed clear value longer
1 parent 122da13 commit dfe390c

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)