summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Vulkan/ObjectCache.h
diff options
context:
space:
mode:
authorStenzek <stenzek@users.noreply.github.com>2018-01-12 11:46:55 +1000
committerGitHub <noreply@github.com>2018-01-12 11:46:55 +1000
commitce0c699b6605a1d103b6434bc28d20d161040904 (patch)
tree2f229fc73b0b7d84b92e44f2db4e0d64860c4320 /Source/Core/VideoBackends/Vulkan/ObjectCache.h
parentb93ae142724f07cb9664a92b55887557dbb7d8ee (diff)
parent4997fbce44f9d092c503ce34f92faafb1af1dd44 (diff)
Merge pull request #6246 from stenzek/vulkan-readback-fixes
Vulkan: Fix MSAA regression from 5.0-5968
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/ObjectCache.h')
-rw-r--r--Source/Core/VideoBackends/Vulkan/ObjectCache.h10
1 files changed, 10 insertions, 0 deletions
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 <map>
#include <memory>
#include <string>
+#include <tuple>
#include <unordered_map>
#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<VkDescriptorSetLayout, NUM_DESCRIPTOR_SET_LAYOUTS> m_descriptor_set_layouts = {};
std::array<VkPipelineLayout, NUM_PIPELINE_LAYOUTS> m_pipeline_layouts = {};
@@ -96,6 +102,10 @@ private:
// Dummy image for samplers that are unbound
std::unique_ptr<Texture2D> m_dummy_texture;
+
+ // Render pass cache
+ using RenderPassCacheKey = std::tuple<VkFormat, VkFormat, u32, VkAttachmentLoadOp>;
+ std::map<RenderPassCacheKey, VkRenderPass> m_render_pass_cache;
};
extern std::unique_ptr<ObjectCache> g_object_cache;