diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-02-21 05:56:00 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-02-28 21:56:43 +0100 |
commit | ac204754d4fe2aaae214025d8f1f40bcb938d74f (patch) | |
tree | 2d22f37fa52eda5fd66d7420e2c4c674c7b863c1 /src/video_core/renderer_vulkan | |
parent | vk_rasterizer: Pass Maxwell registers to dynamic updates (diff) | |
download | yuzu-ac204754d4fe2aaae214025d8f1f40bcb938d74f.tar yuzu-ac204754d4fe2aaae214025d8f1f40bcb938d74f.tar.gz yuzu-ac204754d4fe2aaae214025d8f1f40bcb938d74f.tar.bz2 yuzu-ac204754d4fe2aaae214025d8f1f40bcb938d74f.tar.lz yuzu-ac204754d4fe2aaae214025d8f1f40bcb938d74f.tar.xz yuzu-ac204754d4fe2aaae214025d8f1f40bcb938d74f.tar.zst yuzu-ac204754d4fe2aaae214025d8f1f40bcb938d74f.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_state_tracker.cpp | 41 |
1 files changed, 2 insertions, 39 deletions
diff --git a/src/video_core/renderer_vulkan/vk_state_tracker.cpp b/src/video_core/renderer_vulkan/vk_state_tracker.cpp index 67229ffcc..d74e68b63 100644 --- a/src/video_core/renderer_vulkan/vk_state_tracker.cpp +++ b/src/video_core/renderer_vulkan/vk_state_tracker.cpp @@ -8,6 +8,7 @@ #include "common/common_types.h" #include "core/core.h" +#include "video_core/dirty_flags.h" #include "video_core/engines/maxwell_3d.h" #include "video_core/gpu.h" #include "video_core/renderer_vulkan/vk_state_tracker.h" @@ -38,39 +39,6 @@ Flags MakeInvalidationFlags() { return flags; } -template <typename Integer> -void FillBlock(Table& table, std::size_t begin, std::size_t num, Integer dirty_index) { - const auto it = std::begin(table) + begin; - std::fill(it, it + num, static_cast<u8>(dirty_index)); -} - -template <typename Integer1, typename Integer2> -void FillBlock(Tables& tables, std::size_t begin, std::size_t num, Integer1 index_a, - Integer2 index_b) { - FillBlock(tables[0], begin, num, index_a); - FillBlock(tables[1], begin, num, index_b); -} - -void SetupDirtyRenderTargets(Tables& tables) { - static constexpr std::size_t num_per_rt = NUM(rt[0]); - static constexpr std::size_t begin = OFF(rt); - static constexpr std::size_t num = num_per_rt * Regs::NumRenderTargets; - for (std::size_t rt = 0; rt < Regs::NumRenderTargets; ++rt) { - FillBlock(tables[0], begin + rt * num_per_rt, num_per_rt, ColorBuffer0 + rt); - } - FillBlock(tables[1], begin, num, RenderTargets); - - static constexpr std::array zeta_flags{ZetaBuffer, RenderTargets}; - for (std::size_t i = 0; i < std::size(zeta_flags); ++i) { - const u8 flag = zeta_flags[i]; - auto& table = tables[i]; - table[OFF(zeta_enable)] = flag; - table[OFF(zeta_width)] = flag; - table[OFF(zeta_height)] = flag; - FillBlock(table, OFF(zeta), NUM(zeta), flag); - } -} - void SetupDirtyViewports(Tables& tables) { FillBlock(tables[0], OFF(viewport_transform), NUM(viewport_transform), Viewports); FillBlock(tables[0], OFF(viewports), NUM(viewports), Viewports); @@ -123,12 +91,7 @@ void StateTracker::Initialize() { SetupDirtyDepthBounds(tables); SetupDirtyStencilProperties(tables); - auto& store = dirty.on_write_stores; - store[RenderTargets] = true; - store[ZetaBuffer] = true; - for (std::size_t i = 0; i < Regs::NumRenderTargets; ++i) { - store[ColorBuffer0 + i] = true; - } + SetupCommonOnWriteStores(dirty.on_write_stores); } void StateTracker::InvalidateCommandBufferState() { |