Skip to content

Commit

Permalink
[WebGPU] WGPUTextureFormat_BC2RGBAUnorm and WGPUTextureFormat_BC2RGBA…
Browse files Browse the repository at this point in the history
…UnormSrgb have the wrong block size in Texture::blockSize

https://bugs.webkit.org/show_bug.cgi?id=263672
<radar://117483503>

Reviewed by Tadeu Zagallo.

WGPUTextureFormat_BC2RGBAUnorm* block size was wrong along with
WGPUTextureFormat_BC2RGBAUnorm* as well.

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

Canonical link: https://commits.webkit.org/269775@main
  • Loading branch information
mwyrzykowski committed Oct 25, 2023
1 parent 5d9e979 commit 9444546
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/WebGPU/WebGPU/Texture.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1638,7 +1638,7 @@ static bool textureViewFormatCompatible(WGPUTextureFormat format1, WGPUTextureFo
return 8;
case WGPUTextureFormat_BC2RGBAUnorm:
case WGPUTextureFormat_BC2RGBAUnormSrgb:
return 8;
return 16;
case WGPUTextureFormat_BC3RGBAUnorm:
case WGPUTextureFormat_BC3RGBAUnormSrgb:
return 16;
Expand All @@ -1658,12 +1658,12 @@ static bool textureViewFormatCompatible(WGPUTextureFormat format1, WGPUTextureFo
case WGPUTextureFormat_ETC2RGB8UnormSrgb:
case WGPUTextureFormat_ETC2RGB8A1Unorm:
case WGPUTextureFormat_ETC2RGB8A1UnormSrgb:
case WGPUTextureFormat_ETC2RGBA8Unorm:
case WGPUTextureFormat_ETC2RGBA8UnormSrgb:
return 8;
case WGPUTextureFormat_EACR11Unorm:
case WGPUTextureFormat_EACR11Snorm:
return 8;
case WGPUTextureFormat_ETC2RGBA8Unorm:
case WGPUTextureFormat_ETC2RGBA8UnormSrgb:
case WGPUTextureFormat_EACRG11Unorm:
case WGPUTextureFormat_EACRG11Snorm:
return 16;
Expand Down

0 comments on commit 9444546

Please sign in to comment.