diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-04-23 01:14:35 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-04-23 22:34:16 +0200 |
commit | f665c921144264ba2ed0fef37d9db28d552a5511 (patch) | |
tree | 27004ef3a0f66ded1364e916822174f57d3b7616 /src/video_core/renderer_vulkan/vk_rasterizer.cpp | |
parent | Merge pull request #3768 from H27CK/cmd-title-fmt (diff) | |
download | yuzu-f665c921144264ba2ed0fef37d9db28d552a5511.tar yuzu-f665c921144264ba2ed0fef37d9db28d552a5511.tar.gz yuzu-f665c921144264ba2ed0fef37d9db28d552a5511.tar.bz2 yuzu-f665c921144264ba2ed0fef37d9db28d552a5511.tar.lz yuzu-f665c921144264ba2ed0fef37d9db28d552a5511.tar.xz yuzu-f665c921144264ba2ed0fef37d9db28d552a5511.tar.zst yuzu-f665c921144264ba2ed0fef37d9db28d552a5511.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_rasterizer.cpp')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 8a1f57891..ef21b186b 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -1245,28 +1245,15 @@ std::size_t RasterizerVulkan::CalculateConstBufferSize( } RenderPassParams RasterizerVulkan::GetRenderPassParams(Texceptions texceptions) const { - using namespace VideoCore::Surface; - const auto& regs = system.GPU().Maxwell3D().regs; - RenderPassParams renderpass_params; - - for (std::size_t rt = 0; rt < static_cast<std::size_t>(regs.rt_control.count); ++rt) { - const auto& rendertarget = regs.rt[rt]; - if (rendertarget.Address() == 0 || rendertarget.format == Tegra::RenderTargetFormat::NONE) { - continue; - } - renderpass_params.color_attachments.push_back(RenderPassParams::ColorAttachment{ - static_cast<u32>(rt), PixelFormatFromRenderTargetFormat(rendertarget.format), - texceptions[rt]}); - } - - renderpass_params.has_zeta = regs.zeta_enable; - if (renderpass_params.has_zeta) { - renderpass_params.zeta_pixel_format = PixelFormatFromDepthFormat(regs.zeta.format); - renderpass_params.zeta_texception = texceptions[ZETA_TEXCEPTION_INDEX]; - } - - return renderpass_params; + RenderPassParams params; + params.num_color_attachments = static_cast<u8>(regs.rt_control.count); + std::transform(regs.rt.begin(), regs.rt.end(), params.color_formats.begin(), + [](const auto& rt) { return static_cast<u8>(rt.format); }); + params.texceptions = static_cast<u8>(texceptions.to_ullong()); + params.zeta_format = regs.zeta_enable ? static_cast<u8>(regs.zeta.format) : 0; + params.zeta_texception = texceptions[ZETA_TEXCEPTION_INDEX]; + return params; } } // namespace Vulkan |