Graphics: Replace RenderFrame by RenderResources

This changes makes the whole rendering independent from the RenderFrame acquired from the Swapchain.
This may allow to do offscreen rendering (= without swapchain), or multi-window rendering in the future
This commit is contained in:
Lynix
2023-11-21 23:33:18 +01:00
parent d7d5c09428
commit 1e81b38c0f
66 changed files with 213 additions and 196 deletions

View File

@@ -53,6 +53,11 @@ namespace Nz
SubmitCommandBuffer(commandBuffer, queueTypeFlags);
}
UInt32 VulkanRenderImage::GetImageIndex() const
{
return m_imageIndex;
}
VulkanUploadPool& VulkanRenderImage::GetUploadPool()
{
return m_uploadPool;

View File

@@ -246,7 +246,7 @@ namespace Nz
currentFrame.Reset(imageIndex);
return RenderFrame(&currentFrame, invalidateFramebuffer, m_swapchainSize, imageIndex);
return RenderFrame(&currentFrame, invalidateFramebuffer, m_swapchainSize);
}
std::shared_ptr<CommandPool> VulkanSwapchain::CreateCommandPool(QueueType queueType)
@@ -324,6 +324,11 @@ namespace Nz
return m_supportedPresentModes;
}
RenderResources& VulkanSwapchain::GetTransientResources()
{
return *m_concurrentImageData[m_currentFrame];
}
void VulkanSwapchain::NotifyResize(const Vector2ui& newSize)
{
OnSwapchainResize(this, newSize);
@@ -375,11 +380,6 @@ namespace Nz
}
}
TransientResources& VulkanSwapchain::Transient()
{
return *m_concurrentImageData[m_currentFrame];
}
bool VulkanSwapchain::SetupDepthBuffer()
{
VkImageCreateInfo imageCreateInfo = {