diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-02-21 04:37:29 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-02-28 21:56:43 +0100 |
commit | cd0e28c9ecb2ecd4579ad9abb8899255f60334da (patch) | |
tree | 1e8182da026f075b66b5047d1bb89076e3e317b2 /src | |
parent | vk_state_tracker: Implement dirty flags for depth bias (diff) | |
download | yuzu-cd0e28c9ecb2ecd4579ad9abb8899255f60334da.tar yuzu-cd0e28c9ecb2ecd4579ad9abb8899255f60334da.tar.gz yuzu-cd0e28c9ecb2ecd4579ad9abb8899255f60334da.tar.bz2 yuzu-cd0e28c9ecb2ecd4579ad9abb8899255f60334da.tar.lz yuzu-cd0e28c9ecb2ecd4579ad9abb8899255f60334da.tar.xz yuzu-cd0e28c9ecb2ecd4579ad9abb8899255f60334da.tar.zst yuzu-cd0e28c9ecb2ecd4579ad9abb8899255f60334da.zip |
Diffstat (limited to 'src')
-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)>; |