From 173a33886c72304aea923382ec114679dcad6ba4 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 9 Sep 2017 14:04:26 +1000 Subject: Vulkan: Move render pass management to ObjectCache --- Source/Core/VideoBackends/Vulkan/ObjectCache.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Source/Core/VideoBackends/Vulkan/ObjectCache.h') diff --git a/Source/Core/VideoBackends/Vulkan/ObjectCache.h b/Source/Core/VideoBackends/Vulkan/ObjectCache.h index bfcec09166..5b7939f95b 100644 --- a/Source/Core/VideoBackends/Vulkan/ObjectCache.h +++ b/Source/Core/VideoBackends/Vulkan/ObjectCache.h @@ -9,6 +9,7 @@ #include #include #include +#include #include #include "Common/CommonTypes.h" @@ -66,6 +67,10 @@ public: // Dummy image for samplers that are unbound Texture2D* GetDummyImage() const { return m_dummy_texture.get(); } VkImageView GetDummyImageView() const { return m_dummy_texture->GetView(); } + // Render pass cache. + VkRenderPass GetRenderPass(VkFormat color_format, VkFormat depth_format, u32 multisamples, + VkAttachmentLoadOp load_op); + // Perform at startup, create descriptor layouts, compiles all static shaders. bool Initialize(); @@ -81,6 +86,7 @@ private: bool CreateUtilityShaderVertexFormat(); bool CreateStaticSamplers(); void DestroySamplers(); + void DestroyRenderPassCache(); std::array m_descriptor_set_layouts = {}; std::array m_pipeline_layouts = {}; @@ -96,6 +102,10 @@ private: // Dummy image for samplers that are unbound std::unique_ptr m_dummy_texture; + + // Render pass cache + using RenderPassCacheKey = std::tuple; + std::map m_render_pass_cache; }; extern std::unique_ptr g_object_cache; -- cgit v1.2.3