Changeset 288105 in webkit
- Timestamp:
- Jan 17, 2022, 4:56:11 PM (5 years ago)
- Location:
- trunk/Source/ThirdParty/ANGLE
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
src/libANGLE/renderer/metal/ProgramMtl.mm (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/ThirdParty/ANGLE/ChangeLog
r288097 r288105 1 2022-01-17 David Kilzer <ddkilzer@apple.com> 2 3 REGRESSION (r286603): rx::ProgramMtl::getSpecializedShader() leaks MTLFunctionConstantValues object due early return when an error occurs in ANGLE_TRY() macro 4 <https://webkit.org/b/235281> 5 <rdar://problem/87656387> 6 7 Reviewed by Darin Adler. 8 9 * src/libANGLE/renderer/metal/ProgramMtl.mm: 10 (rx::ProgramMtl::getSpecializedShader): 11 - Use mtl::AutoObjCObj<> to release MTLFunctionConstantValues 12 object on early return. 13 1 14 2022-01-17 David Kilzer <ddkilzer@apple.com> 2 15 -
trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/ProgramMtl.mm
r287068 r288105 590 590 mtl::TranslatedShaderInfo *translatedMslInfo = &mMslShaderTranslateInfo[shaderType]; 591 591 ProgramShaderObjVariantMtl *shaderVariant; 592 MTLFunctionConstantValues *funcConstants = nil;592 mtl::AutoObjCObj<MTLFunctionConstantValues> funcConstants; 593 593 594 594 if (shaderType == gl::ShaderType::Vertex) … … 640 640 } 641 641 642 funcConstants = [[MTLFunctionConstantValues alloc] init];642 funcConstants = mtl::adoptObjCObj([[MTLFunctionConstantValues alloc] init]); 643 643 [funcConstants setConstantValue:&emulateDiscard 644 644 type:MTLDataTypeBool … … 676 676 } 677 677 678 funcConstants = [[MTLFunctionConstantValues alloc] init];678 funcConstants = mtl::adoptObjCObj([[MTLFunctionConstantValues alloc] init]); 679 679 [funcConstants setConstantValue:&emulateCoverageMask 680 680 type:MTLDataTypeBool … … 696 696 type:MTLDataTypeBool 697 697 withName:@"ANGLEUseSampleCompareLod"]; 698 698 699 // Create Metal shader object 699 700 ANGLE_MTL_OBJC_SCOPE 700 701 { 701 702 ANGLE_TRY(CreateMslShader(context, translatedMslInfo->metalLibrary, SHADER_ENTRY_NAME, 702 funcConstants, &shaderVariant->metalShader)); 703 [funcConstants ANGLE_MTL_AUTORELEASE]; 703 funcConstants.get(), &shaderVariant->metalShader)); 704 704 } 705 705
Note:
See TracChangeset
for help on using the changeset viewer.