Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 93ddb5c2ffabbf8d106482aa0a3fa71d7d34fef4
      
https://github.com/WebKit/WebKit/commit/93ddb5c2ffabbf8d106482aa0a3fa71d7d34fef4
  Author: Kimmo Kinnunen <[email protected]>
  Date:   2025-12-17 (Wed, 17 Dec 2025)

  Changed paths:
    M Source/ThirdParty/ANGLE/src/libANGLE/capture/capture_gles_2_0_params.cpp
    M Source/ThirdParty/ANGLE/src/libANGLE/formatutils.cpp
    M Source/ThirdParty/ANGLE/src/libANGLE/formatutils.h
    M Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
    M Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/d3d11/Image11.cpp
    M 
Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp
    M Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/FramebufferGL.cpp
    M Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/TextureGL.cpp
    M Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/FrameBufferMtl.mm
    M Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/TextureMtl.mm
    M Source/ThirdParty/ANGLE/src/libANGLE/renderer/null/FramebufferNULL.cpp
    M Source/ThirdParty/ANGLE/src/libANGLE/renderer/vulkan/vk_helpers.cpp
    M Source/ThirdParty/ANGLE/src/libANGLE/renderer/wgpu/TextureWgpu.cpp
    M Source/ThirdParty/ANGLE/src/libANGLE/renderer/wgpu/wgpu_helpers.cpp
    M Source/ThirdParty/ANGLE/src/tests/gl_tests/TextureTest.cpp

  Log Message:
  -----------
  ANGLE: Avoid using UNPACK_SKIP_IMAGES, UNPACK_IMAGE_HEIGHT for non-3d 
textures <rdar://164155603>

Reviewed by Mike Wyrzykowski.

Avoid using UNPACK_SKIP_IMAGES, UNPACK_IMAGE_HEIGHT when uploading
textures with TexImage2D. The UNPACK_IMAGE_HEIGHT was being
being used in Metal texture uploads even when slices was == 1. This
causes validation failure. During TexImage2D the values are not
validated at ANGLE validation level since they are not supposed to
affect anything.

Consider pattern:
formatInfo.computeRowPitch(type, area.width, unpack.alignment,
    unpack.rowLength, &rowPitch);
formatInfo.computeDepthPitch(area.height, unpack.imageHeight,
    sourceRowPitch, &depthPitch);
formatInfo.computeSkipBytes(type, sourceRowPitch, sourceDepthPitch,
    unpack, index.usesTex3D(), &sourceSkipBytes);

Computing the depthPitch would not take into account wheter the
originating command was Tex*Image2D or Tex*Image3D. It would
unconditionally use UNPACK_SKIP_IMAGES, UNPACK_IMAGE_HEIGHT.
The computed depthPitch would then be used to size buffers, read amounts
and write amounts by the implementations.

Combine the pattern to InternalFormat::computeRowDepthSkipBytes(...)
call that uses PixelUnpackState::imageHeight,
PixelUnpackState::imageSkip only for 3D texture uploads.

Compine the pack buffer parameter resolution logic other to function:
InternalFormat::computeRowSkipBytes(..., PixelPackState&,...).

* Source/ThirdParty/ANGLE/src/libANGLE/Context.cpp:
(gl::Context::texImage2D):
* Source/ThirdParty/ANGLE/src/libANGLE/capture/capture_gles_2_0_params.cpp:
(gl::CaptureTexImage2D_pixels):
* Source/ThirdParty/ANGLE/src/libANGLE/formatutils.cpp:
(gl::InternalFormat::computeRowDepthSkipBytes const):
(gl::InternalFormat::computeSkipBytes const):
(gl::InternalFormat::computePackUnpackEndByte const):
* Source/ThirdParty/ANGLE/src/libANGLE/formatutils.h:
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/d3d11/Image11.cpp:
(rx::Image11::loadData):
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/TextureGL.cpp:
(rx::TextureGL::setSubImageRowByRowWorkaround):
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/TextureMtl.mm:
(rx::TextureMtl::setSubImageImpl):
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/vulkan/vk_helpers.cpp:
(rx::vk::ImageHelper::calculateBufferInfo):

Change-Id: Iefac5156412787709ee577a9a71f19a480778e78

Originally-landed-as: 02d2cd92abb8. rdar://166336157
Canonical link: https://commits.webkit.org/304611@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to