diff options
Diffstat (limited to 'src/video_core')
-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 be2c4d149..958f90f99 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -1026,6 +1026,9 @@ void RasterizerVulkan::UpdateDepthBias(Tegra::Engines::Maxwell3D& gpu) { } void RasterizerVulkan::UpdateBlendConstants(Tegra::Engines::Maxwell3D& gpu) { + if (!state_tracker.TouchBlendConstants()) { + return; + } const std::array blend_color = {gpu.regs.blend_color.r, gpu.regs.blend_color.g, gpu.regs.blend_color.b, gpu.regs.blend_color.a}; scheduler.Record([blend_color](auto cmdbuf, auto& dld) { diff --git a/src/video_core/renderer_vulkan/vk_state_tracker.cpp b/src/video_core/renderer_vulkan/vk_state_tracker.cpp index c75caaa56..c7e54c68b 100644 --- a/src/video_core/renderer_vulkan/vk_state_tracker.cpp +++ b/src/video_core/renderer_vulkan/vk_state_tracker.cpp @@ -31,6 +31,7 @@ Flags MakeInvalidationFlags() { flags[Viewports] = true; flags[Scissors] = true; flags[DepthBias] = true; + flags[BlendConstants] = true; return flags; } @@ -84,6 +85,10 @@ void SetupDirtyDepthBias(Tables& tables) { table[OFF(polygon_offset_factor)] = DepthBias; } +void SetupDirtyBlendConstants(Tables& tables) { + FillBlock(tables[0], OFF(blend_color), NUM(blend_color), BlendConstants); +} + } // Anonymous namespace StateTracker::StateTracker(Core::System& system) @@ -96,6 +101,7 @@ void StateTracker::Initialize() { SetupDirtyViewports(tables); SetupDirtyScissors(tables); SetupDirtyDepthBias(tables); + SetupDirtyBlendConstants(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 088b47145..a0493813a 100644 --- a/src/video_core/renderer_vulkan/vk_state_tracker.h +++ b/src/video_core/renderer_vulkan/vk_state_tracker.h @@ -22,6 +22,7 @@ enum : u8 { Viewports, Scissors, DepthBias, + BlendConstants, }; } // namespace Dirty @@ -46,6 +47,10 @@ public: return Exchange(Dirty::DepthBias, false); } + bool TouchBlendConstants() { + return Exchange(Dirty::BlendConstants, false); + } + private: using Flags = std::remove_reference_t<decltype(Tegra::Engines::Maxwell3D::dirty.flags)>; |