replay rt backend: the pass setters reborrow the attachment they set
set_attachment! takes its attachment by value, so passing the `&mut` binding moved it before the clear value was set. Lint 45173 caught it (E0382, three times). Each setter now passes `&mut *a`, as the old backend's setters do. Verified: the next lint compiles the validation crate in every cfg.
This commit is contained in:
1 parent
3e0df2df8c
commit
39f79ecb8e
1 file changed
+3
-3
@@ -286,7 +286,7 @@ impl NewRuntime {
|
||||
None => None,
|
||||
};
|
||||
let a = &mut self.pass(call.receiver).descriptor.color_attachments[at];
|
||||
set_attachment!(set, a);
|
||||
set_attachment!(set, &mut *a);
|
||||
if let Some(clear) = clear {
|
||||
a.clear_color = clear;
|
||||
}
|
||||
@@ -297,7 +297,7 @@ impl NewRuntime {
|
||||
let set = self.attachment_set(call, &f, rt::MAX_COLOR_ATTACHMENTS)?;
|
||||
let clear = f.float("clearDepth")?;
|
||||
let a = &mut self.pass(call.receiver).descriptor.depth_attachment;
|
||||
set_attachment!(set, a);
|
||||
set_attachment!(set, &mut *a);
|
||||
if let Some(clear) = clear {
|
||||
a.clear_depth = clear;
|
||||
}
|
||||
@@ -308,7 +308,7 @@ impl NewRuntime {
|
||||
let set = self.attachment_set(call, &f, rt::MAX_COLOR_ATTACHMENTS + 1)?;
|
||||
let clear = f.count("clearStencil")?;
|
||||
let a = &mut self.pass(call.receiver).descriptor.stencil_attachment;
|
||||
set_attachment!(set, a);
|
||||
set_attachment!(set, &mut *a);
|
||||
if let Some(clear) = clear {
|
||||
a.clear_stencil = clear;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user