Skip to content

Commit

Permalink
[WebGPU] validateLinearTextureData is incorrect for single row textur…
Browse files Browse the repository at this point in the history
…es (height == 1)

https://bugs.webkit.org/show_bug.cgi?id=264139
<rdar://problem/117891312>

Reviewed by Tadeu Zagallo.

rowsPerImage is only used for height > 1, we don't need to validate it when it
is not used.

* Source/WebGPU/WebGPU/Texture.mm:
(WebGPU::Texture::validateLinearTextureData):

Canonical link: https://commits.webkit.org/270187@main
  • Loading branch information
mwyrzykowski committed Nov 3, 2023
1 parent e939159 commit 36bb9e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/WebGPU/WebGPU/Texture.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2799,7 +2799,7 @@ static WGPUExtent3D imageCopyTextureSubresourceSize(const WGPUImageCopyTexture&
return false;
}

if (layout.rowsPerImage != WGPU_COPY_STRIDE_UNDEFINED) {
if (copyExtent.height > 1 && layout.rowsPerImage != WGPU_COPY_STRIDE_UNDEFINED) {
if (layout.rowsPerImage < heightInBlocks)
return false;
}
Expand Down

0 comments on commit 36bb9e1

Please sign in to comment.