diff options
author | bunnei <bunneidev@gmail.com> | 2020-02-24 16:14:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-24 16:14:50 +0100 |
commit | e22ad52cdb18842a12037e8b85d7be854b95206c (patch) | |
tree | f60ec07ce5a4e6f56a1c9c5e18884de52de81334 /src/video_core/renderer_vulkan/vk_rasterizer.cpp | |
parent | Merge pull request #3424 from ReinUsesLisp/spirv-layer (diff) | |
parent | texture_cache: Implement layered framebuffer attachments (diff) | |
download | yuzu-e22ad52cdb18842a12037e8b85d7be854b95206c.tar yuzu-e22ad52cdb18842a12037e8b85d7be854b95206c.tar.gz yuzu-e22ad52cdb18842a12037e8b85d7be854b95206c.tar.bz2 yuzu-e22ad52cdb18842a12037e8b85d7be854b95206c.tar.lz yuzu-e22ad52cdb18842a12037e8b85d7be854b95206c.tar.xz yuzu-e22ad52cdb18842a12037e8b85d7be854b95206c.tar.zst yuzu-e22ad52cdb18842a12037e8b85d7be854b95206c.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_rasterizer.cpp')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 31c078f6a..3bf86da87 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -611,33 +611,34 @@ bool RasterizerVulkan::WalkAttachmentOverlaps(const CachedSurfaceView& attachmen std::tuple<vk::Framebuffer, vk::Extent2D> RasterizerVulkan::ConfigureFramebuffers( vk::RenderPass renderpass) { FramebufferCacheKey key{renderpass, std::numeric_limits<u32>::max(), - std::numeric_limits<u32>::max()}; + std::numeric_limits<u32>::max(), std::numeric_limits<u32>::max()}; - const auto MarkAsModifiedAndPush = [&](const View& view) { - if (view == nullptr) { + const auto try_push = [&](const View& view) { + if (!view) { return false; } key.views.push_back(view->GetHandle()); key.width = std::min(key.width, view->GetWidth()); key.height = std::min(key.height, view->GetHeight()); + key.layers = std::min(key.layers, view->GetNumLayers()); return true; }; for (std::size_t index = 0; index < std::size(color_attachments); ++index) { - if (MarkAsModifiedAndPush(color_attachments[index])) { + if (try_push(color_attachments[index])) { texture_cache.MarkColorBufferInUse(index); } } - if (MarkAsModifiedAndPush(zeta_attachment)) { + if (try_push(zeta_attachment)) { texture_cache.MarkDepthBufferInUse(); } const auto [fbentry, is_cache_miss] = framebuffer_cache.try_emplace(key); auto& framebuffer = fbentry->second; if (is_cache_miss) { - const vk::FramebufferCreateInfo framebuffer_ci({}, key.renderpass, - static_cast<u32>(key.views.size()), - key.views.data(), key.width, key.height, 1); + const vk::FramebufferCreateInfo framebuffer_ci( + {}, key.renderpass, static_cast<u32>(key.views.size()), key.views.data(), key.width, + key.height, key.layers); const auto dev = device.GetLogical(); const auto& dld = device.GetDispatchLoader(); framebuffer = dev.createFramebufferUnique(framebuffer_ci, nullptr, dld); |