From 70743809459b41fae850c87575ac39090e7e49bb Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Wed, 25 Sep 2024 00:22:38 -0700 Subject: [PATCH] metal: fix query set result copies (#6322) The NSRange expects length, not end element. See https://github.com/gfx-rs/metal-rs/blob/9bbe74b1d3706e46ddf41bc8aad58ee74b0bf844/src/lib.rs#L51 --- wgpu-hal/src/metal/command.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wgpu-hal/src/metal/command.rs b/wgpu-hal/src/metal/command.rs index 069013570..9e38cf865 100644 --- a/wgpu-hal/src/metal/command.rs +++ b/wgpu-hal/src/metal/command.rs @@ -490,7 +490,7 @@ impl crate::CommandEncoder for super::CommandEncoder { wgt::QueryType::Timestamp => { encoder.resolve_counters( set.counter_sample_buffer.as_ref().unwrap(), - metal::NSRange::new(range.start as u64, range.end as u64), + metal::NSRange::new(range.start as u64, (range.end - range.start) as u64), &buffer.raw, offset, );