[webkit-changes] [WebKit/WebKit] b6b15a: [WebGPU] Calling GPUTexture.destroy() on the resul...

mwyrzykowski noreply at github.com
Fri Jan 5 15:34:42 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b6b15a92672c6f687c48ddaff2a646783e2bfe8a
      https://github.com/WebKit/WebKit/commit/b6b15a92672c6f687c48ddaff2a646783e2bfe8a
  Author: Mike Wyrzykowski <mwyrzykowski at apple.com>
  Date:   2024-01-05 (Fri, 05 Jan 2024)

  Changed paths:
    M Source/WebGPU/WebGPU/PresentationContextIOSurface.mm
    M Source/WebGPU/WebGPU/Texture.h
    M Source/WebGPU/WebGPU/Texture.mm

  Log Message:
  -----------
  [WebGPU] Calling GPUTexture.destroy() on the result of GPUCanvasContext.getCurrentTexture() is problematic
https://bugs.webkit.org/show_bug.cgi?id=267098
<radar://120494910>

Reviewed by Tadeu Zagallo.

Calling GPUTexture.destroy() on the result of GPUCanvasContext.getCurrentTexture() was
problematic because we don't continuously make new IOSurface backed MTLTexture instances
for the canvas.

We don't need to, we just need to ensure that calling destroy makes the Texture act
like an invalid texture and that calling getCurrentTexture() returns a non-destroyed
texture.

* Source/WebGPU/WebGPU/PresentationContextIOSurface.mm:
(WebGPU::PresentationContextIOSurface::configure):
(WebGPU::PresentationContextIOSurface::getCurrentTexture):
* Source/WebGPU/WebGPU/Texture.h:
* Source/WebGPU/WebGPU/Texture.mm:
(WebGPU::Texture::recreateIfNeeded):
(WebGPU::Texture::makeCanvasBacking):
(WebGPU::Texture::destroy):

Canonical link: https://commits.webkit.org/272711@main




More information about the webkit-changes mailing list