public void GetNextDrawable() { if (!_drawable.IsNull) { ObjectiveCRuntime.release(_drawable.NativePtr); } using (NSAutoreleasePool.Begin()) { _drawable = _metalLayer.nextDrawable(); ObjectiveCRuntime.retain(_drawable.NativePtr); } }
private protected override void WaitForIdleCore() { MTLCommandBuffer lastCB = default(MTLCommandBuffer); lock (_submittedCommandsLock) { lastCB = _latestSubmittedCB; ObjectiveCRuntime.retain(lastCB.NativePtr); } if (lastCB.NativePtr != IntPtr.Zero && lastCB.status != MTLCommandBufferStatus.Completed) { lastCB.waitUntilCompleted(); } ObjectiveCRuntime.release(lastCB.NativePtr); }