Skip to content

Commit 1d8b50e

Browse files
bors[bot]kvark
andcommitted
Merge #2403
2403: [mtl] retain raw_value for longer r=kvark a=kvark A proper follow-up to #2402 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 a435a05 + a310dab commit 1d8b50e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/backend/metal/src/command.rs

+3-4
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)