Vulkan: Add renderpass and framebuffers

This commit is contained in:
Lynix
2020-04-10 17:36:05 +02:00
parent 9507c56fc9
commit d9a08640d6
41 changed files with 659 additions and 95 deletions

View File

@@ -7,6 +7,11 @@
namespace Nz
{
inline const VulkanMultipleFramebuffer& VkRenderWindow::GetFramebuffer() const
{
return *m_framebuffer;
}
inline VulkanDevice& VkRenderWindow::GetDevice()
{
return *m_device;
@@ -22,16 +27,6 @@ namespace Nz
return m_graphicsQueue;
}
inline const Vk::Framebuffer& VkRenderWindow::GetFrameBuffer(UInt32 imageIndex) const
{
return m_imageData[imageIndex].framebuffer;
}
inline UInt32 VkRenderWindow::GetFramebufferCount() const
{
return static_cast<UInt32>(m_imageData.size());
}
inline const Vk::Swapchain& VkRenderWindow::GetSwapchain() const
{
return m_swapchain;
@@ -44,11 +39,11 @@ namespace Nz
inline void VkRenderWindow::Present(UInt32 imageIndex, VkSemaphore waitSemaphore)
{
NazaraAssert(imageIndex < m_imageData.size(), "Invalid image index");
NazaraAssert(imageIndex < m_inflightFences.size(), "Invalid image index");
m_presentQueue.Present(m_swapchain, imageIndex, waitSemaphore);
m_currentFrame = (m_currentFrame + 1) % m_imageData.size();
m_currentFrame = (m_currentFrame + 1) % m_inflightFences.size();
}
}