diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-02-21 02:19:57 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-02-28 21:56:43 +0100 |
commit | 42f18749658bb4f3ce2e6be7677596d41ac8cd6c (patch) | |
tree | 6bfc16e7f768e1d0d2462104bf61bb8e52278ea4 | |
parent | vk_state_tracker: Initial implementation (diff) | |
download | yuzu-42f18749658bb4f3ce2e6be7677596d41ac8cd6c.tar yuzu-42f18749658bb4f3ce2e6be7677596d41ac8cd6c.tar.gz yuzu-42f18749658bb4f3ce2e6be7677596d41ac8cd6c.tar.bz2 yuzu-42f18749658bb4f3ce2e6be7677596d41ac8cd6c.tar.lz yuzu-42f18749658bb4f3ce2e6be7677596d41ac8cd6c.tar.xz yuzu-42f18749658bb4f3ce2e6be7677596d41ac8cd6c.tar.zst yuzu-42f18749658bb4f3ce2e6be7677596d41ac8cd6c.zip |
-rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 3 | ||||
-rw-r--r-- | src/video_core/renderer_vulkan/vk_state_tracker.cpp | 6 | ||||
-rw-r--r-- | src/video_core/renderer_vulkan/vk_state_tracker.h | 5 |
3 files changed, 14 insertions, 0 deletions
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 41cbf4134..207ef0f0d 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -998,6 +998,9 @@ void RasterizerVulkan::UpdateViewportsState(Tegra::Engines::Maxwell3D& gpu) { } void RasterizerVulkan::UpdateScissorsState(Tegra::Engines::Maxwell3D& gpu) { + if (!state_tracker.TouchScissors()) { + return; + } const auto& regs = gpu.regs; const std::array scissors = { GetScissorState(regs, 0), GetScissorState(regs, 1), GetScissorState(regs, 2), diff --git a/src/video_core/renderer_vulkan/vk_state_tracker.cpp b/src/video_core/renderer_vulkan/vk_state_tracker.cpp index d44992dc9..0e00a9079 100644 --- a/src/video_core/renderer_vulkan/vk_state_tracker.cpp +++ b/src/video_core/renderer_vulkan/vk_state_tracker.cpp @@ -29,6 +29,7 @@ using Flags = std::remove_reference_t<decltype(Maxwell3D::dirty.flags)>; Flags MakeInvalidationFlags() { Flags flags{}; flags[Viewports] = true; + flags[Scissors] = true; return flags; } @@ -71,6 +72,10 @@ void SetupDirtyViewports(Tables& tables) { tables[0][OFF(viewport_transform_enabled)] = Viewports; } +void SetupDirtyScissors(Tables& tables) { + FillBlock(tables[0], OFF(scissor_test), NUM(scissor_test), Scissors); +} + } // Anonymous namespace StateTracker::StateTracker(Core::System& system) @@ -81,6 +86,7 @@ void StateTracker::Initialize() { auto& tables = dirty.tables; SetupDirtyRenderTargets(tables); SetupDirtyViewports(tables); + SetupDirtyScissors(tables); auto& store = dirty.on_write_stores; store[RenderTargets] = true; diff --git a/src/video_core/renderer_vulkan/vk_state_tracker.h b/src/video_core/renderer_vulkan/vk_state_tracker.h index 9ec7b5136..ba8f3a854 100644 --- a/src/video_core/renderer_vulkan/vk_state_tracker.h +++ b/src/video_core/renderer_vulkan/vk_state_tracker.h @@ -20,6 +20,7 @@ enum : u8 { First = VideoCommon::Dirty::LastCommonEntry, Viewports, + Scissors, }; } // namespace Dirty @@ -36,6 +37,10 @@ public: return Exchange(Dirty::Viewports, false); } + bool TouchScissors() { + return Exchange(Dirty::Scissors, false); + } + private: using Flags = std::remove_reference_t<decltype(Tegra::Engines::Maxwell3D::dirty.flags)>; |