Changeset 288507 in webkit
- Timestamp:
- Jan 24, 2022, 5:55:23 PM (5 years ago)
- Location:
- branches/safari-613-branch/Source/ThirdParty/ANGLE
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
src/libANGLE/renderer/metal/DisplayMtl.mm (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-613-branch/Source/ThirdParty/ANGLE/ChangeLog
r288046 r288507 1 2022-01-24 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r288074. rdar://problem/87653812 4 5 REGRESSION (r286603): Leak of three NSMutableDictionary objects each time rx::DisplayMtl::getMetalDeviceMatchingAttribute() is called 6 <https://webkit.org/b/235278> 7 <rdar://problem/87653812> 8 9 Reviewed by Darin Adler. 10 11 * src/libANGLE/renderer/metal/DisplayMtl.mm: 12 (rx::DisplayMtl::getMetalDeviceMatchingAttribute): 13 - Make use of mtl::adoptObjCObj<> so these objects are relaseed 14 when the method returns. 15 16 17 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288074 268f45cc-cd09-0410-ab3c-d52691b4dbfc 18 19 2022-01-16 David Kilzer <ddkilzer@apple.com> 20 21 REGRESSION (r286603): Leak of three NSMutableDictionary objects each time rx::DisplayMtl::getMetalDeviceMatchingAttribute() is called 22 <https://webkit.org/b/235278> 23 <rdar://problem/87653812> 24 25 Reviewed by Darin Adler. 26 27 * src/libANGLE/renderer/metal/DisplayMtl.mm: 28 (rx::DisplayMtl::getMetalDeviceMatchingAttribute): 29 - Make use of mtl::adoptObjCObj<> so these objects are relaseed 30 when the method returns. 31 1 32 2022-01-14 Russell Epstein <repstein@apple.com> 2 33 -
branches/safari-613-branch/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/DisplayMtl.mm
r288046 r288507 239 239 auto deviceList = mtl::adoptObjCObj(MTLCopyAllDevices()); 240 240 241 NSMutableArray<id<MTLDevice>> *externalGPUs = [[NSMutableArray alloc] init];242 NSMutableArray<id<MTLDevice>> *integratedGPUs = [[NSMutableArray alloc] init];243 NSMutableArray<id<MTLDevice>> *discreteGPUs = [[NSMutableArray alloc] init];241 auto externalGPUs = mtl::adoptObjCObj<NSMutableArray<id<MTLDevice>>>([[NSMutableArray alloc] init]); 242 auto integratedGPUs = mtl::adoptObjCObj<NSMutableArray<id<MTLDevice>>>([[NSMutableArray alloc] init]); 243 auto discreteGPUs = mtl::adoptObjCObj<NSMutableArray<id<MTLDevice>>>([[NSMutableArray alloc] init]); 244 244 for (id<MTLDevice> device in deviceList.get()) 245 245 { 246 246 if (device.removable) 247 247 { 248 [externalGPUs addObject:device];248 [externalGPUs.get() addObject:device]; 249 249 } 250 250 else if (device.lowPower) 251 251 { 252 [integratedGPUs addObject:device];252 [integratedGPUs.get() addObject:device]; 253 253 } 254 254 else 255 255 { 256 [discreteGPUs addObject:device];256 [discreteGPUs.get() addObject:device]; 257 257 } 258 258 } … … 263 263 { 264 264 // Search for a discrete GPU first. 265 for (id<MTLDevice> device in discreteGPUs )265 for (id<MTLDevice> device in discreteGPUs.get()) 266 266 { 267 267 if (![device isHeadless]) … … 272 272 { 273 273 // If we've selected a low power device, look through integrated devices. 274 for (id<MTLDevice> device in integratedGPUs )274 for (id<MTLDevice> device in integratedGPUs.get()) 275 275 { 276 276 if (![device isHeadless]) … … 296 296 297 297 // Default to use a low power device, look through integrated devices. 298 for (id<MTLDevice> device in integratedGPUs )298 for (id<MTLDevice> device in integratedGPUs.get()) 299 299 { 300 300 if (![device isHeadless])
Note:
See TracChangeset
for help on using the changeset viewer.