From 8db74d6f4e84d7b3fae997cbb65bb25d56bf532f Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Tue, 17 Nov 2026 23:41:28 -0800 Subject: [PATCH] rt tests: the zero-fill ordering test's texture takes a granted index every_device_fills_a_zeroed_private_buffer_before_a_copy_into_it_in_the_next_command_buffer failed at its last check on every device (3090 m3-max-44735, 2080 44736, RX 550 44737, lavapipe 44738): it made its texture with no index, and a texture shaders read or write takes one ("a texture shaders read or write takes an index, and none was given"). Every ordering check before it had passed on all four: the bytes zeroed for each zero_from, and every byte of the span for the four cases of copies into [0, zero_from) and into the zeroed tail in the command buffer after the buffer's making. The test now grants one texture index and places the texture at it, and waits for the gauges to fall after teardown, as the other tests that make textures do. --- crates/metal2vulkan-rt/src/tests/memory.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/metal2vulkan-rt/src/tests/memory.rs b/crates/metal2vulkan-rt/src/tests/memory.rs index 16a0abd03..3d8893fa3 100644 --- a/crates/metal2vulkan-rt/src/tests/memory.rs +++ b/crates/metal2vulkan-rt/src/tests/memory.rs @@ -1345,6 +1345,7 @@ mod on_device { #[test] fn every_device_fills_a_zeroed_private_buffer_before_a_copy_into_it_in_the_next_command_buffer() { + use crate::IndexClass; const LEN: u64 = 4096; const AT: u64 = 1024; const SPAN: u64 = 2 * AT + LEN; @@ -1448,9 +1449,12 @@ mod on_device { } // A texture placed in a block zeroes nothing. + device + .grant_indices(IndexClass::Texture, 4096, 1) + .unwrap_or_else(|error| panic!("{name}: {error}")); let before = counters.metrics().bytes_zeroed; let d = TextureDescriptor::new(TextureType::Type2D, PixelFormat::RGBA8Unorm, 64, 64); - let texture = (device.new_texture(&d, None)) + let texture = (device.new_texture(&d, Some(4096))) .unwrap_or_else(|error| panic!("{name}: a texture: {error}")); assert_eq!( counters.metrics().bytes_zeroed, @@ -1459,11 +1463,7 @@ mod on_device { ); drop((texture, gpu, queue, private, shared)); drop(device); - assert_eq!( - counters.gauges(), - Gauges::default(), - "{name}: gauges after teardown" - ); + wait_until("the teardown", || counters.gauges() == Gauges::default()); println!( "memory: {name}: zeroed Private buffers filled before copies into them; metrics {:?}", counters.metrics()