diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-05-04 23:31:17 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-05-04 23:31:17 +0200 |
commit | 2dbf5290f28efa47b2484537e9316909831fee05 (patch) | |
tree | 8532b1b39dc83cb9d6e6460a21b6fbebd3084b65 /src/video_core/renderer_vulkan/fixed_pipeline_state.cpp | |
parent | gl_rasterizer: Implement viewport swizzles with NV_viewport_swizzle (diff) | |
download | yuzu-2dbf5290f28efa47b2484537e9316909831fee05.tar yuzu-2dbf5290f28efa47b2484537e9316909831fee05.tar.gz yuzu-2dbf5290f28efa47b2484537e9316909831fee05.tar.bz2 yuzu-2dbf5290f28efa47b2484537e9316909831fee05.tar.lz yuzu-2dbf5290f28efa47b2484537e9316909831fee05.tar.xz yuzu-2dbf5290f28efa47b2484537e9316909831fee05.tar.zst yuzu-2dbf5290f28efa47b2484537e9316909831fee05.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan/fixed_pipeline_state.cpp')
-rw-r--r-- | src/video_core/renderer_vulkan/fixed_pipeline_state.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp b/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp index 648b1e71b..6cead3a28 100644 --- a/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp +++ b/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include <algorithm> #include <cstring> #include <tuple> @@ -101,6 +102,12 @@ void FixedPipelineState::ColorBlending::Fill(const Maxwell& regs) noexcept { } } +void FixedPipelineState::ViewportSwizzles::Fill(const Maxwell& regs) noexcept { + const auto& transform = regs.viewport_transform; + std::transform(transform.begin(), transform.end(), swizzles.begin(), + [](const auto& viewport) { return static_cast<u16>(viewport.swizzle.raw); }); +} + void FixedPipelineState::BlendingAttachment::Fill(const Maxwell& regs, std::size_t index) { const auto& mask = regs.color_mask[regs.color_mask_common ? 0 : index]; @@ -144,6 +151,7 @@ void FixedPipelineState::Fill(const Maxwell& regs) { rasterizer.Fill(regs); depth_stencil.Fill(regs); color_blending.Fill(regs); + viewport_swizzles.Fill(regs); } std::size_t FixedPipelineState::Hash() const noexcept { |