SwapChain
- Namespace: Turian.Engine.Core
- Source File: SwapChain.Selection.cs, SwapChain.Resources.cs, SwapChain.cs
Fields
MaxFramesInFlight (int) = 2: Gets the maximum frames in flight.
Properties
VkSwapChain
(SwapchainKHR): Gets the Vulkan swap chain.
SwapChainImageFormat
(Format): Gets the format of the swap chain images.
SwapChainDepthFormat
(Format): Gets the format of the depth component in the swap chain.
UseFifo
(bool) { get; set }: Indicates whether FIFO swapping is used.
Width
(uint): Gets the width of the swap chain.
Height
(uint): Gets the height of the swap chain.
SwapChainExtent
(Extent2D): Gets the extent of the swap chain.
AspectRatio
(float): Gets the aspect ratio of the swap chain.
RenderPass
(RenderPass): Gets the render pass of the swap chain.
Public Methods
GetSwapChainImageViews
public ImageView[] GetSwapChainImageViews()
Gets an array of image views for the swap chain images.
Returns: ImageView[]
- An array of image views.
GetFrameBufferAt
public Framebuffer GetFrameBufferAt(uint i)
Gets the framebuffer at a specified index for rendering.
Parameters:
i(uint): The index of the framebuffer to retrieve.
Returns: Framebuffer
- The framebuffer at the specified index.
GetFrameBuffers
public Framebuffer[] GetFrameBuffers()
Gets an array of framebuffers for rendering.
Returns: Framebuffer[]
- An array of framebuffers.
GetFrameBufferCount
public uint GetFrameBufferCount()
Gets the count of framebuffers in the swap chain.
Returns: uint
- The count of framebuffers.
ImageCount
public uint ImageCount()
Gets the image count of the swap chain.
Returns: uint
- The image count of the swap chain.
AcquireNextImage
public Result AcquireNextImage(uint imageIndex)
Acquires the next image in the swap chain.
Parameters:
imageIndex(uint): The index of the image to acquire.
Returns: Result
- The result of the acquire operation.
SubmitCommandBuffers
public unsafe Result SubmitCommandBuffers(CommandBuffer commandBuffer, uint imageIndex)
Submits the command buffers for execution.
Parameters:
commandBuffer(CommandBuffer): The command buffer to submit.imageIndex(uint): The index of the image in the swap chain.
Returns: Result
- The result of the submission. Remarks: This method performs several tasks: - Waits for the fences before acquiring the next image. - Assigns in-flight images. - Configures and submits the submit info. - Resets the fences. - Handles the presentation of the queue. This method is unsafe because it uses pointers and unmanaged memory operations.
Dispose
public unsafe void Dispose()
Dispose buffers