Vulkan/RenderWindow: Add support for depth buffer

Former-commit-id: 42f113fcb7463c0f010fdc325b9024b08de3c667 [formerly 95040d268ff328f2d54459bf11c269dd5f042f73] [formerly 77c2d1139585cbf31f881ffddfb43b23284a7073 [formerly d235ff32fae4612d95d25524410bf1b43974d520]]
Former-commit-id: bab56f18d034bade640bf023c97810adf2c717ff [formerly c62041abb56103d6c7aeac2b55f7bf66acd8882b]
Former-commit-id: cef0ac55f6eaa54f17d3d0cc2030a4b9de7b166c
This commit is contained in:
Lynix
2016-08-09 13:53:12 +02:00
parent 16818fa7a3
commit 8776ffe953
4 changed files with 277 additions and 40 deletions

View File

@@ -16,7 +16,9 @@
#include <Nazara/Vulkan/VkCommandBuffer.hpp>
#include <Nazara/Vulkan/VkCommandPool.hpp>
#include <Nazara/Vulkan/VkDevice.hpp>
#include <Nazara/Vulkan/VkDeviceMemory.hpp>
#include <Nazara/Vulkan/VkFramebuffer.hpp>
#include <Nazara/Vulkan/VkImage.hpp>
#include <Nazara/Vulkan/VkSurface.hpp>
#include <Nazara/Vulkan/VkSwapchain.hpp>
#include <Nazara/Utility/Window.hpp>
@@ -39,13 +41,11 @@ namespace Nz
void BuildPreRenderCommands(UInt32 imageIndex, Vk::CommandBuffer& commandBuffer) override;
void BuildPostRenderCommands(UInt32 imageIndex, Vk::CommandBuffer& commandBuffer) override;
const Vk::Framebuffer& GetFrameBuffer(UInt32 imageIndex) const override;
UInt32 GetFramebufferCount() const;
bool Create(VideoMode mode, const String& title, UInt32 style = WindowStyle_Default);
bool Create(WindowHandle handle);
const Vk::Framebuffer& GetFrameBuffer(UInt32 imageIndex) const override;
UInt32 GetFramebufferCount() const;
const Vk::DeviceHandle& GetDevice() const;
UInt32 GetPresentableFamilyQueue() const;
const Vk::Surface& GetSurface() const;
@@ -55,6 +55,7 @@ namespace Nz
bool IsValid() const;
void SetDepthStencilFormats(std::vector<PixelFormatType> pixelFormat);
void SetPhysicalDevice(VkPhysicalDevice device);
RenderWindow& operator=(const RenderWindow&) = delete;
@@ -65,17 +66,21 @@ namespace Nz
void OnWindowDestroy() override;
void OnWindowResized() override;
bool SetupCommandBuffers();
bool SetupDepthBuffer();
bool SetupRenderPass();
bool SetupSwapchain();
Clock m_clock;
VkFormat m_colorFormat;
VkFormat m_depthFormat;
VkColorSpaceKHR m_colorSpace;
VkFormat m_colorFormat;
VkFormat m_depthStencilFormat;
VkPhysicalDevice m_forcedPhysicalDevice;
std::vector<PixelFormatType> m_wantedDepthStencilFormats;
std::vector<Vk::Framebuffer> m_frameBuffers;
Vk::DeviceHandle m_device;
Vk::DeviceMemory m_depthBufferMemory;
Vk::Image m_depthBuffer;
Vk::ImageView m_depthBufferView;
Vk::Queue m_presentQueue;
Vk::Surface m_surface;
Vk::Swapchain m_swapchain;