Skip to content

Commit a310dab

Browse files
committed
[mtl] retain raw_value for longer
1 parent dfe390c commit a310dab

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/backend/metal/src/command.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2312,16 +2312,15 @@ impl com::RawCommandBuffer<Backend> for CommandBuffer {
23122312
for clear in clears {
23132313
let pso; // has to live at least as long as all the commands
23142314
let depth_stencil;
2315+
let raw_value;
23152316

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 {
2317+
let (com_clear, target_index) = match *clear.borrow() {
23192318
com::AttachmentClear::Color { index, value } => {
23202319
let channel = self.state.target_formats.colors[index].1;
23212320
//Note: technically we should be able to derive the Channel from the
23222321
// `value` variant, but this is blocked by the portability that is
23232322
// always passing the attachment clears as `ClearColor::Float` atm.
2324-
let raw_value = com::ClearColorRaw::from(value);
2323+
raw_value = com::ClearColorRaw::from(value);
23252324
let com = soft::RenderCommand::BindBufferData {
23262325
stage: pso::Stage::Fragment,
23272326
index: 0,

0 commit comments

Comments
 (0)