summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/video_core/renderer_vulkan/vk_rasterizer.cpp3
-rw-r--r--src/video_core/renderer_vulkan/vk_state_tracker.cpp6
-rw-r--r--src/video_core/renderer_vulkan/vk_state_tracker.h5
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)>;