From 513e323884b2a71dfd709c5542cc50dac8f6d64c Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Sun, 8 Nov 2026 00:31:08 -0800 Subject: [PATCH] Build the tiled texture buffer of two levels past the descriptor's check in its planner test The descriptor's own check stops a texture buffer of more than one level before the buffer's plan sees it (RuntimeGap::TextureBufferLevels), so the case panicked in the helper on the M3 (potluck m3-max-7540). The test now takes the checked one-level layout and sets two levels, which the plan stops as MipmapLevelCount. Verified: the device run that follows. (cherry picked from commit ec197cff3e0d414fe4a5524b40391cc1ff5e9318) --- crates/metal2vulkan-runtime/src/tests/linear_plan.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/metal2vulkan-runtime/src/tests/linear_plan.rs b/crates/metal2vulkan-runtime/src/tests/linear_plan.rs index 299c0d84e..c83d0af23 100644 --- a/crates/metal2vulkan-runtime/src/tests/linear_plan.rs +++ b/crates/metal2vulkan-runtime/src/tests/linear_plan.rs @@ -401,9 +401,13 @@ fn a_tiled_texture_takes_levels_over_the_buffer_s_rows() { row_bytes: 32, }) ); - // A texture buffer has one level, at an offset of 16 bytes' multiple. + // A texture buffer has one level (the descriptor's check stops two before the buffer's plan + // here, which holds them to one), at an offset of 16 bytes' multiple. + let mut two = buffer_texture(tiled(1, texture_buffer(64, 0, 256, 4096))); + two.layout.levels = 2; + let facts = BufferFacts { length: 4096 }; assert_eq!( - plan(tiled(2, texture_buffer(64, 0, 256, 4096))), + plan_buffer_texture(&two, &facts).map(|placed| placed.gpu), refused(Pr::MipmapLevelCount { count: 2 }) ); assert_eq!(