⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 288510 in webkit


Ignore:
Timestamp:
Jan 24, 2022, 5:55:32 PM (5 years ago)
Author:
Russell Epstein
Message:

Cherry-pick r288105. rdar://problem/87656387

REGRESSION (r286603): rx::ProgramMtl::getSpecializedShader() leaks MTLFunctionConstantValues object due early return when an error occurs in ANGLE_TRY() macro
<​https://webkit.org/b/235281>
<rdar://problem/87656387>

Reviewed by Darin Adler.

  • src/libANGLE/renderer/metal/ProgramMtl.mm: (rx::ProgramMtl::getSpecializedShader):
  • Use mtl::AutoObjCObj<> to release MTLFunctionConstantValues object on early return.

git-svn-id: ​https://svn.webkit.org/repository/webkit/trunk@288105 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-613-branch/Source/ThirdParty/ANGLE
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-613-branch/Source/ThirdParty/ANGLE/ChangeLog

    r288508 r288510  
     12022-01-24  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r288105. rdar://problem/87656387
     4
     5    REGRESSION (r286603): rx::ProgramMtl::getSpecializedShader() leaks MTLFunctionConstantValues object due early return when an error occurs in ANGLE_TRY() macro
     6    <https://webkit.org/b/235281>
     7    <rdar://problem/87656387>
     8   
     9    Reviewed by Darin Adler.
     10   
     11    * src/libANGLE/renderer/metal/ProgramMtl.mm:
     12    (rx::ProgramMtl::getSpecializedShader):
     13    - Use mtl::AutoObjCObj<> to release MTLFunctionConstantValues
     14      object on early return.
     15   
     16   
     17    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288105 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     18
     19    2022-01-17  David Kilzer  <ddkilzer@apple.com>
     20
     21            REGRESSION (r286603): rx::ProgramMtl::getSpecializedShader() leaks MTLFunctionConstantValues object due early return when an error occurs in ANGLE_TRY() macro
     22            <https://webkit.org/b/235281>
     23            <rdar://problem/87656387>
     24
     25            Reviewed by Darin Adler.
     26
     27            * src/libANGLE/renderer/metal/ProgramMtl.mm:
     28            (rx::ProgramMtl::getSpecializedShader):
     29            - Use mtl::AutoObjCObj<> to release MTLFunctionConstantValues
     30              object on early return.
     31
    1322022-01-24  Alan Coon  <alancoon@apple.com>
    233
  • branches/safari-613-branch/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/ProgramMtl.mm

    r287068 r288510  
    590590    mtl::TranslatedShaderInfo *translatedMslInfo = &mMslShaderTranslateInfo[shaderType];
    591591    ProgramShaderObjVariantMtl *shaderVariant;
    592     MTLFunctionConstantValues *funcConstants = nil;
     592    mtl::AutoObjCObj<MTLFunctionConstantValues> funcConstants;
    593593
    594594    if (shaderType == gl::ShaderType::Vertex)
    … …  
    640640            }
    641641
    642             funcConstants = [[MTLFunctionConstantValues alloc] init];
     642            funcConstants = mtl::adoptObjCObj([[MTLFunctionConstantValues alloc] init]);
    643643            [funcConstants setConstantValue:&emulateDiscard
    644644                                       type:MTLDataTypeBool
    … …  
    676676            }
    677677
    678             funcConstants = [[MTLFunctionConstantValues alloc] init];
     678            funcConstants = mtl::adoptObjCObj([[MTLFunctionConstantValues alloc] init]);
    679679            [funcConstants setConstantValue:&emulateCoverageMask
    680680                                       type:MTLDataTypeBool
    … …  
    696696                    type:MTLDataTypeBool
    697697                withName:@"ANGLEUseSampleCompareLod"];
     698
    698699    // Create Metal shader object
    699700    ANGLE_MTL_OBJC_SCOPE
    700701    {
    701702        ANGLE_TRY(CreateMslShader(context, translatedMslInfo->metalLibrary, SHADER_ENTRY_NAME,
    702                                   funcConstants, &shaderVariant->metalShader));
    703         [funcConstants ANGLE_MTL_AUTORELEASE];
     703                                  funcConstants.get(), &shaderVariant->metalShader));
    704704    }
    705705
Note: See TracChangeset for help on using the changeset viewer.