From daf1cdbb28f70bd38541462ce1ab905f1d6b9ab1 Mon Sep 17 00:00:00 2001 From: Li Hao Date: Mon, 11 Oct 2021 09:09:22 +0000 Subject: [PATCH] Fix resolve range of resolveQuerySet on Metal The second parameter of NSMakeRange(NSUInteger loc, NSUInteger len) is length, here we just need to pass queryCount. Bug: dawn:434 Change-Id: I3dfa82e523310258c81c45c4e1c3af80a3df8704 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66220 Reviewed-by: Corentin Wallez Commit-Queue: Hao Li --- src/dawn_native/metal/CommandBufferMTL.mm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/dawn_native/metal/CommandBufferMTL.mm b/src/dawn_native/metal/CommandBufferMTL.mm index eb9892b6af..cacefa03d5 100644 --- a/src/dawn_native/metal/CommandBufferMTL.mm +++ b/src/dawn_native/metal/CommandBufferMTL.mm @@ -933,8 +933,7 @@ namespace dawn_native { namespace metal { if (@available(macos 10.15, iOS 14.0, *)) { [commandContext->EnsureBlit() resolveCounters:querySet->GetCounterSampleBuffer() - inRange:NSMakeRange(cmd->firstQuery, - cmd->firstQuery + cmd->queryCount) + inRange:NSMakeRange(cmd->firstQuery, cmd->queryCount) destinationBuffer:destination->GetMTLBuffer() destinationOffset:NSUInteger(cmd->destinationOffset)]; } else {