summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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 958f90f99..7029b3d5e 100644
--- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp
+++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
@@ -1037,6 +1037,9 @@ void RasterizerVulkan::UpdateBlendConstants(Tegra::Engines::Maxwell3D& gpu) {
1037} 1037}
1038 1038
1039void RasterizerVulkan::UpdateDepthBounds(Tegra::Engines::Maxwell3D& gpu) { 1039void RasterizerVulkan::UpdateDepthBounds(Tegra::Engines::Maxwell3D& gpu) {
1040 if (!state_tracker.TouchDepthBounds()) {
1041 return;
1042 }
1040 const auto& regs = gpu.regs; 1043 const auto& regs = gpu.regs;
1041 scheduler.Record([min = regs.depth_bounds[0], max = regs.depth_bounds[1]]( 1044 scheduler.Record([min = regs.depth_bounds[0], max = regs.depth_bounds[1]](
1042 auto cmdbuf, auto& dld) { cmdbuf.setDepthBounds(min, max, dld); }); 1045 auto cmdbuf, auto& dld) { cmdbuf.setDepthBounds(min, max, dld); });
diff --git a/src/video_core/renderer_vulkan/vk_state_tracker.cpp b/src/video_core/renderer_vulkan/vk_state_tracker.cpp
index c7e54c68b..b55180dd8 100644
--- a/src/video_core/renderer_vulkan/vk_state_tracker.cpp
+++ b/src/video_core/renderer_vulkan/vk_state_tracker.cpp
@@ -32,6 +32,7 @@ Flags MakeInvalidationFlags() {
32 flags[Scissors] = true; 32 flags[Scissors] = true;
33 flags[DepthBias] = true; 33 flags[DepthBias] = true;
34 flags[BlendConstants] = true; 34 flags[BlendConstants] = true;
35 flags[DepthBounds] = true;
35 return flags; 36 return flags;
36} 37}
37 38
@@ -89,6 +90,10 @@ void SetupDirtyBlendConstants(Tables& tables) {
89 FillBlock(tables[0], OFF(blend_color), NUM(blend_color), BlendConstants); 90 FillBlock(tables[0], OFF(blend_color), NUM(blend_color), BlendConstants);
90} 91}
91 92
93void SetupDirtyDepthBounds(Tables& tables) {
94 FillBlock(tables[0], OFF(depth_bounds), NUM(depth_bounds), DepthBounds);
95}
96
92} // Anonymous namespace 97} // Anonymous namespace
93 98
94StateTracker::StateTracker(Core::System& system) 99StateTracker::StateTracker(Core::System& system)
@@ -102,6 +107,7 @@ void StateTracker::Initialize() {
102 SetupDirtyScissors(tables); 107 SetupDirtyScissors(tables);
103 SetupDirtyDepthBias(tables); 108 SetupDirtyDepthBias(tables);
104 SetupDirtyBlendConstants(tables); 109 SetupDirtyBlendConstants(tables);
110 SetupDirtyDepthBounds(tables);
105 111
106 auto& store = dirty.on_write_stores; 112 auto& store = dirty.on_write_stores;
107 store[RenderTargets] = true; 113 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 a0493813a..25b5c647b 100644
--- a/src/video_core/renderer_vulkan/vk_state_tracker.h
+++ b/src/video_core/renderer_vulkan/vk_state_tracker.h
@@ -23,6 +23,7 @@ enum : u8 {
23 Scissors, 23 Scissors,
24 DepthBias, 24 DepthBias,
25 BlendConstants, 25 BlendConstants,
26 DepthBounds,
26}; 27};
27 28
28} // namespace Dirty 29} // namespace Dirty
@@ -51,6 +52,10 @@ public:
51 return Exchange(Dirty::BlendConstants, false); 52 return Exchange(Dirty::BlendConstants, false);
52 } 53 }
53 54
55 bool TouchDepthBounds() {
56 return Exchange(Dirty::DepthBounds, false);
57 }
58
54private: 59private:
55 using Flags = std::remove_reference_t<decltype(Tegra::Engines::Maxwell3D::dirty.flags)>; 60 using Flags = std::remove_reference_t<decltype(Tegra::Engines::Maxwell3D::dirty.flags)>;
56 61