haikuwebkit/Source/ThirdParty/ANGLE/src
David Kilzer d3c1e70fc1 [Metal ANGLE] Fix over-autorelease of rx::DisplayMtl::getMetalDeviceMatchingAttribute() and various Objective-C leaks
<https://webkit.org/b/229128>
<rdar://problem/81964007>

Reviewed by Alex Christensen.

* src/libANGLE/renderer/metal/DisplayMtl.h:
(rx::DisplayMtl::getMetalDeviceMatchingAttribute):
- Change to return mtl::AutoObjCPtr<> to make ownership clear.
(rx::DisplayMtl::mMetalDevice):
- No need to initialize to nil.

* src/libANGLE/renderer/metal/DisplayMtl.mm:
(rx::DisplayMtl::initializeImpl):
- Update for changes to getMetalDeviceMatchingAttribute().
(rx::DisplayMtl::getMetalDeviceMatchingAttribute):
- Change to return mtl::AutoObjCPtr<> to make ownership clear.
- Fix leak of `deviceList`, `externalGPUs`, `integratedGPUs`, and
  `discreteGPUs`.
- Use mtl::adoptObjCObj<>() to prevent leak of
  MTLCreateSystemDefaultDevice().

* src/libANGLE/renderer/metal/IOSurfaceSurfaceMtl.mm:
- Fix leak of `captureDescriptor` in two different if blocks.

* src/libANGLE/renderer/metal/ProgramMtl.mm:
- Fix leak of `funcConstants` in early return on error path.

* src/libANGLE/renderer/metal/ProvokingVertexHelper.mm:
(rx::ProvokingVertexHelper::getSpecializedShader):
- Fix leak of `fcValues`.

* src/libANGLE/renderer/metal/SurfaceMtl.mm:
- Fix leak of `captureDescriptor` in two different if blocks.

* src/libANGLE/renderer/metal/mtl_common.h:
(rx::mtl::WrappedObject::retainAssign):
- Move statement inside #if/#endif that isn't needed for ARC.
(rx::mtl::WrappedObject::unretainAssign): Add.
(rx::mtl::AutoObjCPtr::AutoObjCPtr): Add.
(rx::mtl::adoptObjCObj): Add.
- Add a helper method to adopt an Objective-C object to
  eliminate the need to autorelease a +1 retained object before
  an mtl::AutoObjCPtr<> object wraps it.  Modeled after
  WTF::RetainPtr<> in WebKit.

* src/libANGLE/renderer/metal/mtl_state_cache.mm:
(rx::mtl::RenderPipelineCache::createRenderPipelineState):
(rx::mtl::ProvokingVertexComputePipelineCache::createComputePipelineState):
- Use adoptObjCObj<>() to fix potential leak on the early return
  path since these methods return an mtl::AutoObjCPtr<>.


Canonical link: https://commits.webkit.org/240610@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281160 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-17 20:32:30 +00:00
..
android_system_settings Re-landing r270129, r270194, and r270258. 2020-12-02 18:36:01 +00:00
common [ANGLE] Support importing external MTLTextures 2021-06-22 20:33:10 +00:00
compiler WebGL2 demo doesn't work due to failing compilation to metal backend 2021-07-15 22:56:57 +00:00
feature_support_util Re-landing r270129, r270194, and r270258. 2020-12-02 18:36:01 +00:00
gpu_info_util Use kIOMainPortDefault where available 2021-04-16 01:45:06 +00:00
image_util Re-landing r270129, r270194, and r270258. 2020-12-02 18:36:01 +00:00
libANGLE [Metal ANGLE] Fix over-autorelease of rx::DisplayMtl::getMetalDeviceMatchingAttribute() and various Objective-C leaks 2021-08-17 20:32:30 +00:00
libEGL Re-landing r270129, r270194, and r270258. 2020-12-02 18:36:01 +00:00
libGL Re-landing r270129, r270194, and r270258. 2020-12-02 18:36:01 +00:00
libGLESv1_CM Re-landing r270129, r270194, and r270258. 2020-12-02 18:36:01 +00:00
libGLESv2 3.5 MB system-wide footprint impact due to thread-locals in libANGLE 2021-07-27 21:36:17 +00:00
tests Cherry-pick ANGLE: Revise WebGL's shaderSource validation 2021-08-11 11:20:55 +00:00
third_party Re-landing r270129, r270194, and r270258. 2020-12-02 18:36:01 +00:00
angle_commit.h Re-landing r270129, r270194, and r270258. 2020-12-02 18:36:01 +00:00
commit_id.py Re-landing r270129, r270194, and r270258. 2020-12-02 18:36:01 +00:00
compiler.gni Regressions from ANGLE Metal enablement 2021-03-17 02:15:13 +00:00
copy_compiler_dll.bat
libGLESv2.gni Re-landing r270129, r270194, and r270258. 2020-12-02 18:36:01 +00:00