Skip to content

Commit

Permalink
Moved requesting current drawable before presenting.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcristici committed Oct 18, 2023
1 parent b40032e commit 9801ac0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions platform/ios/src/MLNMapView+Metal.mm
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ void bind() override {

commandBuffer = [commandQueue commandBuffer];
commandBufferPtr = NS::RetainPtr((__bridge MTL::CommandBuffer*)commandBuffer);

currentDrawable = [mtlView currentDrawable];
}

const mbgl::mtl::RendererBackend& getBackend() const override { return backend; }
Expand All @@ -78,6 +76,7 @@ void bind() override {
}

void swap() override {
id<CAMetalDrawable> currentDrawable = [mtlView currentDrawable];
[commandBuffer presentDrawable:currentDrawable];
[commandBuffer commit];

Expand Down Expand Up @@ -105,7 +104,6 @@ void swap() override {
public:
MLNMapViewImplDelegate* delegate = nil;
MTKView *mtlView = nil;
id<CAMetalDrawable> currentDrawable;
id <MTLCommandBuffer> commandBuffer;
id <MTLCommandQueue> commandQueue;

Expand Down

0 comments on commit 9801ac0

Please sign in to comment.