Synchronize replaceRegion calls.
In the Discussion part of https://developer.apple.com/documentation/metal/mtltexture/1515679-replaceregion it seems like we should sync the calls to replaceRegion (inside setupTexturesForFrame) in RTCMTLRenderer and not just the command buffer. This is a speculative fix for the linked bug, but we don't have any clear repro case. Have done basic testing in AppRTCMobile and don't see any obvious regressions, so might be worth trying. Bug: webrtc:10024 Change-Id: Id6848691129fba8845f38c3dfe0ba53b9e5a27ce Reviewed-on: https://webrtc-review.googlesource.com/c/123766 Reviewed-by: Kári Helgason <kthelgason@webrtc.org> Commit-Queue: Anders Carlsson <andersc@webrtc.org> Cr-Commit-Position: refs/heads/master@{#26819}
This commit is contained in:
committed by
Commit Bot
parent
7ef34f8505
commit
29f9cd9358
@ -274,10 +274,6 @@ static const NSInteger kMaxInflightBuffers = 1;
|
||||
}
|
||||
|
||||
- (void)render {
|
||||
// Wait until the inflight (curently sent to GPU) command buffer
|
||||
// has completed the GPU work.
|
||||
dispatch_semaphore_wait(_inflight_semaphore, DISPATCH_TIME_FOREVER);
|
||||
|
||||
id<MTLCommandBuffer> commandBuffer = [_commandQueue commandBuffer];
|
||||
commandBuffer.label = commandBufferLabel;
|
||||
|
||||
@ -317,8 +313,14 @@ static const NSInteger kMaxInflightBuffers = 1;
|
||||
|
||||
- (void)drawFrame:(RTCVideoFrame *)frame {
|
||||
@autoreleasepool {
|
||||
// Wait until the inflight (curently sent to GPU) command buffer
|
||||
// has completed the GPU work.
|
||||
dispatch_semaphore_wait(_inflight_semaphore, DISPATCH_TIME_FOREVER);
|
||||
|
||||
if ([self setupTexturesForFrame:frame]) {
|
||||
[self render];
|
||||
} else {
|
||||
dispatch_semaphore_signal(_inflight_semaphore);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user