mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2026-01-15 13:01:42 +01:00
JBR-5580 J2DBench: ~15% drop performance because of non optimal synchronization in metal (MBP 16'' x64)
Replaced NSMutableArray with NSMutableSet, removed unnecessary __block modifier.
(cherry picked from commit fd940831a2)
This commit is contained in:
@@ -185,7 +185,7 @@ extern void initSamplers(id<MTLDevice> device);
|
||||
|
||||
_tempTransform = [[MTLTransform alloc] init];
|
||||
if (isDisplaySyncEnabled()) {
|
||||
_layers = [[NSMutableArray alloc] init];
|
||||
_layers = [[NSMutableSet alloc] init];
|
||||
_displayLinkCount = 0;
|
||||
CVDisplayLinkCreateWithCGDisplay(displayID, &_displayLink);
|
||||
CVDisplayLinkSetOutputCallback(_displayLink, &mtlDisplayLinkCallback, (__bridge void *) self);
|
||||
|
||||
@@ -143,11 +143,10 @@ BOOL isDisplaySyncEnabled() {
|
||||
}
|
||||
|
||||
[commandBuf presentDrawable:mtlDrawable];
|
||||
__block MTLLayer* layer = self;
|
||||
[layer retain];
|
||||
[self retain];
|
||||
[commandBuf addCompletedHandler:^(id <MTLCommandBuffer> commandBuf) {
|
||||
layer.nextDrawableCount--;
|
||||
[layer release];
|
||||
self.nextDrawableCount--;
|
||||
[self release];
|
||||
}];
|
||||
|
||||
[commandBuf commit];
|
||||
|
||||
Reference in New Issue
Block a user