Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1f316fb5ae9cef5d4ea3fb52168ad10100e04729
      
https://github.com/WebKit/WebKit/commit/1f316fb5ae9cef5d4ea3fb52168ad10100e04729
  Author: Jon Butler <[email protected]>
  Date:   2026-09-29 (Tue, 29 Sep 2026)

  Changed paths:
    M Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/TextureMtl.mm
    M Source/ThirdParty/ANGLE/src/tests/gl_tests/ReadPixelsTest.cpp

  Log Message:
  -----------
  [ANGLE] Reset Metal render targets when a texture image is redefined
https://bugs.webkit.org/show_bug.cgi?id=320737
rdar://180731265

Reviewed by Kimmo Kinnunen.

Re-specifying a texture level with the same format and size discards the 
level's image,
but leaves the render targets that point at it. A render target holds only a 
weak
reference, and the framebuffer's cached render pass keeps the discarded image 
alive, so
the next framebuffer sync does not rebuild the render target. The framebuffer
then
releases the image when it prepares the read, and glReadPixels reads a render 
target with
no texture. The texture-to-buffer read traps on a -1 shader index, and the blit 
read
dereferences null.

Clear the render targets for the image that redefineImage discards. The next 
use rebuilds
them from the new image, and the read returns the re-specified contents.

* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/TextureMtl.mm:
(rx::TextureMtl::redefineImage):
* Source/ThirdParty/ANGLE/src/tests/gl_tests/ReadPixelsTest.cpp:
(ReadPixelsPBOTest::testReadFromRespecifiedAttachment):
(TEST_P(ReadPixelsPBOTest, ReadFromRespecifiedAttachment)):
(TEST_P(ReadPixelsPBOTest, ReadFromRespecifiedAttachmentWithMatchingFormat)):

Canonical link: 
https://flagged.apple.com:443/proxy?t2=DZ6h4b9cq0&o=aHR0cHM6Ly9jb21taXRzLndlYmtpdC5vcmcvMzIyMTQ1QG1haW4=&emid=68bc2714-93d3-4639-859b-1b88145b36e0&c=11



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

Reply via email to