Skip to content

Commit

Permalink
Fixed race condition related to joint buffer recycling
Browse files Browse the repository at this point in the history
  • Loading branch information
warrenm committed May 29, 2018
1 parent 3d22318 commit a8adc33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Framework/GLTFMTL/Source/GLTFMTLRenderer.m
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ - (void)renderScene:(GLTFScene *)scene
[self drawRenderList:renderList commandEncoder:renderEncoder];

NSArray *copiedDeferredReusableBuffers = [self.deferredReusableBuffers copy];
[commandBuffer addScheduledHandler:^(id<MTLCommandBuffer> commandBuffer) {
[commandBuffer addCompletedHandler:^(id<MTLCommandBuffer> commandBuffer) {
dispatch_async(dispatch_get_main_queue(), ^{
for (id<MTLBuffer> buffer in copiedDeferredReusableBuffers) {
[self enqueueReusableBuffer:buffer];
Expand Down

0 comments on commit a8adc33

Please sign in to comment.