private void DestroyImage() { _commandBuffer?.WaitForFence(); _commandBuffer = null; Image?.Dispose(); Image = null; }
internal unsafe void EndPresentation(VulkanCommandBufferPool.VulkanCommandBuffer commandBuffer) { VulkanMemoryHelper.TransitionLayout(_device, commandBuffer.InternalHandle, _swapchainImages[_nextImage], ImageLayout.TransferDstOptimal, AccessFlags.AccessNoneKhr, ImageLayout.PresentSrcKhr, AccessFlags.AccessNoneKhr, 1); commandBuffer.Submit( stackalloc[] { _semaphorePair.ImageAvailableSemaphore },
public VulkanSurfaceRenderingSession BeginDraw(float scaling) { if (Image == null) { RecreateImage(); } _commandBuffer?.WaitForFence(); _commandBuffer = null; var session = new VulkanSurfaceRenderingSession(Display, Device, this, scaling); Image.TransitionLayout(ImageLayout.ColorAttachmentOptimal, AccessFlags.AccessNoneKhr); return(session); }
public void EndDraw() { lock (_lock) { if (Display == null) { return; } _commandBuffer = Display.StartPresentation(); Display.BlitImageToCurrentImage(this, _commandBuffer.InternalHandle); Display.EndPresentation(_commandBuffer); } }