summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-03-26 22:55:07 +0100
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:24 +0200
commitec005be99d4f231f6d4d812841c84ab4af4204a6 (patch)
tree2e5737fd0155138615ab9e6596d7bcf59b822b36 /src/video_core/renderer_vulkan/vk_render_pass_cache.cpp
parentshader: Implement TXQ and fix FragDepth (diff)
downloadyuzu-ec005be99d4f231f6d4d812841c84ab4af4204a6.tar
yuzu-ec005be99d4f231f6d4d812841c84ab4af4204a6.tar.gz
yuzu-ec005be99d4f231f6d4d812841c84ab4af4204a6.tar.bz2
yuzu-ec005be99d4f231f6d4d812841c84ab4af4204a6.tar.lz
yuzu-ec005be99d4f231f6d4d812841c84ab4af4204a6.tar.xz
yuzu-ec005be99d4f231f6d4d812841c84ab4af4204a6.tar.zst
yuzu-ec005be99d4f231f6d4d812841c84ab4af4204a6.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_vulkan/vk_render_pass_cache.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp b/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp
index 1c6ba7289..b2dcd74ab 100644
--- a/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp
@@ -56,15 +56,12 @@ VkRenderPass RenderPassCache::Get(const RenderPassKey& key) {
return *pair->second;
}
boost::container::static_vector<VkAttachmentDescription, 9> descriptions;
- u32 num_images{0};
-
for (size_t index = 0; index < key.color_formats.size(); ++index) {
const PixelFormat format{key.color_formats[index]};
if (format == PixelFormat::Invalid) {
continue;
}
descriptions.push_back(AttachmentDescription(*device, format, key.samples));
- ++num_images;
}
const size_t num_colors{descriptions.size()};
const VkAttachmentReference* depth_attachment{};
@@ -89,7 +86,7 @@ VkRenderPass RenderPassCache::Get(const RenderPassKey& key) {
.pNext = nullptr,
.flags = 0,
.attachmentCount = static_cast<u32>(descriptions.size()),
- .pAttachments = descriptions.data(),
+ .pAttachments = descriptions.empty() ? nullptr : descriptions.data(),
.subpassCount = 1,
.pSubpasses = &subpass,
.dependencyCount = 0,