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 ); } }