Skip to content

Commit

Permalink
Fix a bad slice operation in image_copy stencil tests
Browse files Browse the repository at this point in the history
  • Loading branch information
toji committed Oct 23, 2023
1 parent 2499ea9 commit b3c2508
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/webgpu/api/operation/command_buffer/image_copy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}
}
Expand Down

0 comments on commit b3c2508

Please sign in to comment.