rt: the emulated module boxed in its lowering; the reaper's end takes the lowerings left
Clippy: Lowered::Made held a Kernel beside three small variants (large_enum_variant), and the reaper's end drained the queue into a new one (drain_collect).
This commit is contained in:
1 parent
fdc3fd3907
commit
ec8d82744d
2 files changed
+4
-4
No files matched your search
@@ -99,7 +99,7 @@ pub(crate) struct Emulated {
|
||||
/// What the reaper's lowering of an emulated variant gave.
|
||||
pub(crate) enum Lowered {
|
||||
/// The module, and the translator's notes of it.
|
||||
Made(Kernel, Vec<PrecisionNote>),
|
||||
Made(Box<Kernel>, Vec<PrecisionNote>),
|
||||
/// The translator refused the variant, or it reads what the compute encoder does not supply.
|
||||
Refused,
|
||||
/// `vkCreateShaderModule` failed.
|
||||
@@ -742,7 +742,7 @@ impl PipelineInner {
|
||||
}
|
||||
};
|
||||
match lowered {
|
||||
Lowered::Made(kernel, _) => Ok(kernel),
|
||||
Lowered::Made(kernel, _) => Ok(&**kernel),
|
||||
Lowered::Refused => Err(refused),
|
||||
&Lowered::Failed(result) => Err(Error::Vulkan {
|
||||
call: "vkCreateShaderModule",
|
||||
@@ -782,7 +782,7 @@ impl Emulated {
|
||||
};
|
||||
let notes = pipeline.stage.precision_notes.clone();
|
||||
match Kernel::new(core, pipeline, descriptor.required_threads_per_threadgroup) {
|
||||
Ok(kernel) => Lowered::Made(kernel, notes),
|
||||
Ok(kernel) => Lowered::Made(Box::new(kernel), notes),
|
||||
Err(Error::Vulkan { result, .. }) => Lowered::Failed(result),
|
||||
Err(_) => Lowered::Refused,
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ pub(crate) fn run(core: Arc<Core>) {
|
||||
break Next::Job(job);
|
||||
}
|
||||
if state.stop {
|
||||
break Next::End(state.lowerings.drain(..).collect());
|
||||
break Next::End(std::mem::take(&mut state.lowerings));
|
||||
}
|
||||
if let Some(lowering) = state.lowerings.pop_front() {
|
||||
break Next::Lower(lowering);
|
||||
|
||||
Reference in new issue
Block a user