From b3c2508028464ecbc0396a6a543fb328a55520ad Mon Sep 17 00:00:00 2001 From: Brandon Jones Date: Mon, 23 Oct 2023 14:43:37 -0700 Subject: [PATCH] Fix a bad slice operation in image_copy stencil tests --- .../operation/command_buffer/image_copy.spec.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/webgpu/api/operation/command_buffer/image_copy.spec.ts b/src/webgpu/api/operation/command_buffer/image_copy.spec.ts index f5b11534305f..9f08ffd5e46c 100644 --- a/src/webgpu/api/operation/command_buffer/image_copy.spec.ts +++ b/src/webgpu/api/operation/command_buffer/image_copy.spec.ts @@ -1088,16 +1088,19 @@ class ImageCopyTest extends TextureTestMixin(GPUTest) { // Check the valid data in outputStagingBuffer once per row. for (let y = 0; y < copyFromOutputTextureLayout.mipSize[1]; ++y) { + const rowOffset = expectedStencilTextureDataBytesPerRow * y; + const dataStart = expectedStencilTextureDataOffset + + expectedStencilTextureDataBytesPerRow * + expectedStencilTextureDataRowsPerImage * + stencilTextureLayer + + rowOffset; this.expectGPUBufferValuesEqual( outputStagingBuffer, expectedStencilTextureData.slice( - expectedStencilTextureDataOffset + - expectedStencilTextureDataBytesPerRow * - expectedStencilTextureDataRowsPerImage * - stencilTextureLayer + - expectedStencilTextureDataBytesPerRow * y, - copyFromOutputTextureLayout.mipSize[0] - ) + dataStart, + dataStart + copyFromOutputTextureLayout.mipSize[0] + ), + rowOffset ); } }