Runtime: a mesh state keeps nothing of its descriptor, and the group counts fill by fixed chunks
Clippy in job m3-max-85712 (c6bd918103, plain, m2v_gpu and m2v_cpu_icd alike) stopped the runtime's lib on two errors: - dead_code: Made::Mesh held the MeshPipelineDescriptor, which only a test helper read. A vertex state keeps its descriptor because a pass makes its content again from it (for_pass); no pass does that for a mesh state. Made::Mesh is now a unit variant, and the test helper says a mesh state keeps no vertex or fragment function (rule 4: nothing unused is kept). - clippy::chunks_exact_to_as_chunks in mesh_draw::count_bytes: the three counts now go through as_chunks_mut::<4>(), the same bytes. Verified by the error text of 85712 only; the next job runs the three clippy configurations.
This commit is contained in:
1 parent
45e0a733bd
commit
60e30f5196
2 files changed
+8
-7
No files matched your search
@@ -218,8 +218,8 @@ pub(crate) fn records(piece: [u32; 3], pieces: u32) -> Vec<u8> {
|
||||
/// The group counts' bytes, as the object function or the launcher reads them.
|
||||
pub(crate) fn count_bytes(counts: [u32; 3]) -> [u8; 12] {
|
||||
let mut out = [0; 12];
|
||||
for (at, axis) in out.chunks_exact_mut(4).zip(counts) {
|
||||
at.copy_from_slice(&axis.to_le_bytes());
|
||||
for (at, axis) in out.as_chunks_mut::<4>().0.iter_mut().zip(counts) {
|
||||
*at = axis.to_le_bytes();
|
||||
}
|
||||
out
|
||||
}
|
||||
@@ -149,7 +149,7 @@ impl RenderPipelineState {
|
||||
function(Some(&descriptor.vertex)),
|
||||
function(descriptor.fragment.as_ref()),
|
||||
],
|
||||
Made::Mesh(descriptor) => [None, function(descriptor.fragment.as_ref())],
|
||||
Made::Mesh => [None, None],
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,8 +183,9 @@ pub(crate) struct RenderInner {
|
||||
enum Made {
|
||||
/// `newRenderPipelineStateWithDescriptor:error:`'s.
|
||||
Vertex(RenderPipelineDescriptor),
|
||||
/// `newRenderPipelineStateWithMeshDescriptor:options:reflection:error:`'s.
|
||||
Mesh(MeshPipelineDescriptor),
|
||||
/// `newRenderPipelineStateWithMeshDescriptor:options:reflection:error:`'s, of which the state
|
||||
/// keeps nothing: no pass makes its content again.
|
||||
Mesh,
|
||||
}
|
||||
|
||||
/// The vertex function's index in a draw's tables, and the fragment function's.
|
||||
@@ -1020,7 +1021,7 @@ impl crate::Device {
|
||||
inner: Arc::new(RenderInner {
|
||||
compiled,
|
||||
numbered,
|
||||
descriptor: Made::Mesh(descriptor.clone()),
|
||||
descriptor: Made::Mesh,
|
||||
folded: OnceLock::new(),
|
||||
}),
|
||||
})
|
||||
@@ -2714,7 +2715,7 @@ impl RenderPipelineState {
|
||||
false,
|
||||
false,
|
||||
],
|
||||
Made::Mesh(_) => [false; TABLES],
|
||||
Made::Mesh => [false; TABLES],
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user