diff --git a/crates/metal2vulkan-runtime/README.md b/crates/metal2vulkan-runtime/README.md index 2dcb42241..49d0eb8c0 100644 --- a/crates/metal2vulkan-runtime/README.md +++ b/crates/metal2vulkan-runtime/README.md @@ -3447,7 +3447,12 @@ cache is answered compile-required on both. pass whose `visibility_result_type` is `Accumulate` (`AccumulatedVisibilityResults`, `set_visibility_result_mode`; counted in `Metrics::accumulated_visibility_refused`), each refused where it is set, the encoder's state unchanged; the replay streams set Metal's defaults - alone, which those setters take as nothing; a draw of lines or a line strip while the encoder's line width + alone, which those setters take as nothing; beside `Accumulate`, while a `Boolean` or `Counting` + mode's query counts the draws, an execution of an indirect command buffer over a range a buffer + holds (`VisibilityResultInterrupt`, `execute_commands_in_buffer_with_range`; counted in + `Metrics::visibility_interrupts_refused`), refused where it is called: its count kernel ends the + rendering, and both need a count carried across two queries with the parts added, which is not + built; a draw of lines or a line strip while the encoder's line width (`set_line_width`, which keeps every width) is not 1 (`LineWidth`): Metal draws such a line as a parallelogram that width wide, and Vulkan's wider lines are a device feature (`wideLines`) the floor does not require; a @@ -3545,7 +3550,9 @@ cache is answered compile-required on both. - While a `Boolean` or `Counting` mode's query counts the draws (from the mode's first draw to the next mode set or the encoder's end), a command that would end the pass's rendering is refused, `Gap::Draw` of `VisibilityResultInterrupt`, the encoder as it was, and counted in - `Metrics::visibility_interrupts_refused`: a memory barrier after a draw that wrote memory; a + `Metrics::visibility_interrupts_refused`: a memory barrier after a draw that wrote memory; an + execution of an indirect command buffer over a range a buffer holds, whose count kernel runs + outside the rendering; a draw that moves an attachment to the feedback layout, pays the barrier owed before an attachment read, or copies into an attachment's shadow what it reads; and, whether or not a copy is owed, a draw that looks at textures over a buffer in images of their own (one bound or diff --git a/crates/metal2vulkan-runtime/src/render_encoder.rs b/crates/metal2vulkan-runtime/src/render_encoder.rs index fdd9e71ca..6cb0672bb 100644 --- a/crates/metal2vulkan-runtime/src/render_encoder.rs +++ b/crates/metal2vulkan-runtime/src/render_encoder.rs @@ -2797,7 +2797,7 @@ impl RenderCommandEncoder { }; let (topology, _) = primitives(PrimitiveType::Triangle); let pipeline = compiled.pipeline(topology, self.raster)?; - let made = (compiled, self.raster, pipeline); + let made = (&**compiled, self.raster, pipeline); let shape = indirect.shape(&self.core, made, buffer.layout(), buffer.size())?; Ok(shape.part) } diff --git a/crates/metal2vulkan-runtime/src/tests/indirect.rs b/crates/metal2vulkan-runtime/src/tests/indirect.rs index fe3dc5fec..5b6359c2f 100644 --- a/crates/metal2vulkan-runtime/src/tests/indirect.rs +++ b/crates/metal2vulkan-runtime/src/tests/indirect.rs @@ -677,8 +677,8 @@ mod on_device { // SAFETY: the buffer holds 16 bytes, which the finished command buffer wrote and whose // writes reach the host. let bytes = unsafe { std::slice::from_raw_parts(contents.as_ptr(), 16) }; - let counts: Vec = (bytes.chunks(8)) - .map(|word| u64::from_le_bytes(word.try_into().expect("a word"))) + let counts: Vec = (bytes.as_chunks::<8>().0.iter()) + .map(|word| u64::from_le_bytes(*word)) .collect(); // Each command draws a band of 16 pixels: the execution's four, the two direct draws'. assert_eq!(counts, [64, 32], "{name}: each mode's samples"); diff --git a/crates/metal2vulkan/src/pipeline/own.rs b/crates/metal2vulkan/src/pipeline/own.rs index b7b01f0a3..b1f68e395 100644 --- a/crates/metal2vulkan/src/pipeline/own.rs +++ b/crates/metal2vulkan/src/pipeline/own.rs @@ -225,9 +225,12 @@ mod tests { ..Config::default() }; let out = run(&module, &config, resources).expect("the run"); - (out.buffers[0][ExecutionCounts::COUNTS_AT as usize..].chunks(4)) - .map(|w| u32::from_le_bytes(w.try_into().expect("a word"))) - .collect() + (out.buffers[0][ExecutionCounts::COUNTS_AT as usize..] + .as_chunks::<4>() + .0 + .iter()) + .map(|w| u32::from_le_bytes(*w)) + .collect() } /// Each part's count runs through the range's last command and no further, none for a part