From b70ff4e4d151577c8b7b05b9e44866b5a94ce8ab Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Tue, 10 Nov 2026 00:44:58 -0800 Subject: [PATCH] Test: a texture buffer's border by t through runtime sampler words Five words the M3 answered in the conformance case read-through-buffer: s border alone reads texel 0, s and t border the border, t zero under s repeat the border, s clamp_to_edge clamps whatever t and r are, and t repeat under s border reads texel 0. With the border taken from s, the first and fifth read the border instead. Verified: next, with the suite on msi. (cherry picked from commit 158acdd959bd9e492e399e974e516e03cdcf01d7) --- .../src/tests/engine_texture_oob/through.rs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/crates/metal2vulkan/src/tests/engine_texture_oob/through.rs b/crates/metal2vulkan/src/tests/engine_texture_oob/through.rs index 3541df421..b9aef68fe 100644 --- a/crates/metal2vulkan/src/tests/engine_texture_oob/through.rs +++ b/crates/metal2vulkan/src/tests/engine_texture_oob/through.rs @@ -510,6 +510,34 @@ fn reads_through_runtime_samplers_address_by_their_word() { word([ZERO; 3], TB, 0), vec![([8, 0, 0, 0], Want::Border(TB))], ), + // A texture buffer's border follows `t`'s mode, and `s`'s `clamp_to_edge` clamps first: + // the M3's per-axis answers (the conformance case `read-through-buffer`). + buffer( + word([BORDER, EDGE, EDGE], OW, 0), + vec![ + ([8, 0, 0, 0], at(0, [0, 0, 0])), + ([int(-1), 0, 0, 0], at(0, [0, 0, 0])), + ], + ), + buffer( + word([BORDER, BORDER, EDGE], OW, 0), + vec![([9, 0, 0, 0], Want::Border(OW))], + ), + buffer( + word([REPEAT, ZERO, REPEAT], OW, 0), + vec![([int(-1), 0, 0, 0], Want::Border(OW))], + ), + buffer( + word([EDGE, BORDER, BORDER], OW, 0), + vec![ + ([8, 0, 0, 0], at(0, [7, 0, 0])), + ([int(-1), 0, 0, 0], at(0, [0, 0, 0])), + ], + ), + buffer( + word([BORDER, REPEAT, BORDER], OW, 0), + vec![([100, 0, 0, 0], at(0, [0, 0, 0]))], + ), ]; for case in &buffers { let ran = case.check(&bc);