Moved requesting current drawable before presenting (#1779)

This commit is contained in:
Alex Cristici
2023-10-18 23:27:36 +03:00
committed by GitHub
parent b40032ea06
commit 7f785ae660

View File

@@ -54,8 +54,6 @@ public:
commandBuffer = [commandQueue commandBuffer];
commandBufferPtr = NS::RetainPtr((__bridge MTL::CommandBuffer*)commandBuffer);
currentDrawable = [mtlView currentDrawable];
}
const mbgl::mtl::RendererBackend& getBackend() const override { return backend; }
@@ -78,6 +76,7 @@ public:
}
void swap() override {
id<CAMetalDrawable> currentDrawable = [mtlView currentDrawable];
[commandBuffer presentDrawable:currentDrawable];
[commandBuffer commit];
@@ -105,7 +104,6 @@ private:
public:
MLNMapViewImplDelegate* delegate = nil;
MTKView *mtlView = nil;
id<CAMetalDrawable> currentDrawable;
id <MTLCommandBuffer> commandBuffer;
id <MTLCommandQueue> commandQueue;