Renderer: Fix MRT support
This commit is contained in:
@@ -60,6 +60,7 @@ namespace Nz
|
||||
private:
|
||||
Vk::CommandBuffer& m_commandBuffer;
|
||||
const VulkanRenderPass* m_currentRenderPass;
|
||||
std::size_t m_currentSubpassIndex;
|
||||
std::size_t m_framebufferCount;
|
||||
std::size_t m_imageIndex;
|
||||
};
|
||||
|
||||
@@ -8,12 +8,13 @@
|
||||
#define NAZARA_VULKANRENDERER_VULKANRENDERPIPELINE_HPP
|
||||
|
||||
#include <Nazara/Prerequisites.hpp>
|
||||
#include <Nazara/Core/Algorithm.hpp>
|
||||
#include <Nazara/Core/MovablePtr.hpp>
|
||||
#include <Nazara/Renderer/RenderPipeline.hpp>
|
||||
#include <Nazara/VulkanRenderer/Config.hpp>
|
||||
#include <Nazara/VulkanRenderer/VulkanRenderPass.hpp>
|
||||
#include <Nazara/VulkanRenderer/Wrapper/Device.hpp>
|
||||
#include <Nazara/VulkanRenderer/Wrapper/Pipeline.hpp>
|
||||
#include <Nazara/VulkanRenderer/Wrapper/RenderPass.hpp>
|
||||
#include <vector>
|
||||
|
||||
namespace Nz
|
||||
@@ -26,7 +27,7 @@ namespace Nz
|
||||
VulkanRenderPipeline(Vk::Device& device, RenderPipelineInfo pipelineInfo);
|
||||
~VulkanRenderPipeline() = default;
|
||||
|
||||
VkPipeline Get(const Vk::RenderPass& renderPass) const;
|
||||
VkPipeline Get(const VulkanRenderPass& renderPass, std::size_t subpassIndex) const;
|
||||
|
||||
inline const RenderPipelineInfo& GetPipelineInfo() const override;
|
||||
|
||||
@@ -71,9 +72,16 @@ namespace Nz
|
||||
};
|
||||
|
||||
private:
|
||||
mutable std::unordered_map<VkRenderPass, Vk::Pipeline> m_pipelines;
|
||||
void UpdateCreateInfo(std::size_t colorBufferCount) const;
|
||||
|
||||
struct PipelineHasher
|
||||
{
|
||||
inline std::size_t operator()(const std::pair<VkRenderPass, std::size_t>& renderPass) const;
|
||||
};
|
||||
|
||||
mutable std::unordered_map<std::pair<VkRenderPass, std::size_t>, Vk::Pipeline, PipelineHasher> m_pipelines;
|
||||
MovablePtr<Vk::Device> m_device;
|
||||
CreateInfo m_pipelineCreateInfo;
|
||||
mutable CreateInfo m_pipelineCreateInfo;
|
||||
RenderPipelineInfo m_pipelineInfo;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7,6 +7,15 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
inline std::size_t VulkanRenderPipeline::PipelineHasher::operator()(const std::pair<VkRenderPass, std::size_t>& renderPass) const
|
||||
{
|
||||
std::size_t seed = 0;
|
||||
HashCombine(seed, renderPass.first);
|
||||
HashCombine(seed, renderPass.second);
|
||||
|
||||
return seed;
|
||||
}
|
||||
|
||||
inline const RenderPipelineInfo& VulkanRenderPipeline::GetPipelineInfo() const
|
||||
{
|
||||
return m_pipelineInfo;
|
||||
|
||||
Reference in New Issue
Block a user