Fixes various errors related to the swapchain being recreated.
Additionally, `BeginRenderPass` now allows a NULL `renderArea` parameter. If NULL, Refresh will select a sensible default render area.
Co-authored-by: cosmonaut <evan@moonside.games>
Co-committed-by: cosmonaut <evan@moonside.games>
Removes `Refresh_RenderTarget`, `Refresh_CreateRenderTarget` and `Refresh_QueueDestroyRenderTarget`. Render targets are now managed by the implementation.
Adds `REFRESH_TEXTUREFORMAT_B8G8R8A8`.
Adds `Refresh_AcquireSwapchainTexture`. Returns a swapchain texture for the requested window.
Removes `Refresh_QueuePresent`. It is now assumed that the texture returned by `Refresh_AcquireSwapchainTexture` will be presented. This texture can be manipulated like any other texture.
Adds `Refresh_GetSwapchainFormat`. Returns the swapchain format for the requested window.
Reviewed-on: MoonsideGames/Refresh#15
Co-authored-by: cosmonaut <evan@moonside.games>
Co-committed-by: cosmonaut <evan@moonside.games>
Removes `Refresh_RenderPass` and `Refresh_Framebuffer` objects.
`Refresh_BeginRenderPass` now takes a set of `Refresh_ColorAttachmentInfo` structs and an optional `Refresh_DepthStencilAttachmentInfo` struct that describe the render pass. The render pass and framebuffer objects are now managed by the implementation instead of the application.
Accordingly, `Refresh_GraphicsPipelineCreateInfo` now takes a `Refresh_GraphicsPipelineAttachmentInfo` struct that describes render passes that may be used with the pipeline. It is an error to bind a pipeline during an incompatible render pass.
Reviewed-on: MoonsideGames/Refresh#14
Co-authored-by: cosmonaut <evan@moonside.games>
Co-committed-by: cosmonaut <evan@moonside.games>
Rework submission flow to reduce waiting and improve the resource cleanup process.
This patch also gets rid of descriptor set caching.
Co-authored-by: cosmonaut <evan@moonside.games>
Co-committed-by: cosmonaut <evan@moonside.games>
Buffer uploads now require a command buffer, like textures do. Additionally it is now regarded as an error to upload data in the middle of a render pass.
Reviewed-on: MoonsideGames/Refresh#6
Co-authored-by: cosmonaut <evan@moonside.games>
Co-committed-by: cosmonaut <evan@moonside.games>
We used to have monolithic uniform buffers on the VulkanRenderer object, but this was inefficient in the case of threaded usage.
Now, we have a pool of uniform buffers. A uniform buffer is selected from the pool when a pipeline is bound. The uniform buffers are rotated upon presentation.
Now pushing uniforms is now a concern of the command buffer instead of the pipeline. The pipeline should just always have been a static object anyway.
Additionally, we now do extra buffer record-keeping so that buffer data can be updated after a bind/draw.
Fence submission has also been restructured so that submissions don't cause unnecessary blocks. Now we assign one fence per submission, and we don't wait for fences until it's time to present.
Reviewed-on: MoonsideGames/Refresh#1
Co-authored-by: cosmonaut <evan@moonside.games>
Co-committed-by: cosmonaut <evan@moonside.games>