diff options
author | bunnei <bunneidev@gmail.com> | 2020-08-27 04:19:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-27 04:19:52 +0200 |
commit | 1e2a92918b0dea7867c5fcb8adba1a139afe6c22 (patch) | |
tree | 7f429fbb90991febf623f77a6a36433c75b414dd /src/video_core/renderer_vulkan/vk_state_tracker.h | |
parent | Merge pull request #4593 from lioncash/const2 (diff) | |
parent | vk_state_tracker: Fix primitive topology (diff) | |
download | yuzu-1e2a92918b0dea7867c5fcb8adba1a139afe6c22.tar yuzu-1e2a92918b0dea7867c5fcb8adba1a139afe6c22.tar.gz yuzu-1e2a92918b0dea7867c5fcb8adba1a139afe6c22.tar.bz2 yuzu-1e2a92918b0dea7867c5fcb8adba1a139afe6c22.tar.lz yuzu-1e2a92918b0dea7867c5fcb8adba1a139afe6c22.tar.xz yuzu-1e2a92918b0dea7867c5fcb8adba1a139afe6c22.tar.zst yuzu-1e2a92918b0dea7867c5fcb8adba1a139afe6c22.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_state_tracker.h')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_state_tracker.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/video_core/renderer_vulkan/vk_state_tracker.h b/src/video_core/renderer_vulkan/vk_state_tracker.h index 54ca0d6c6..13a6ce786 100644 --- a/src/video_core/renderer_vulkan/vk_state_tracker.h +++ b/src/video_core/renderer_vulkan/vk_state_tracker.h @@ -32,7 +32,6 @@ enum : u8 { DepthWriteEnable, DepthCompareOp, FrontFace, - PrimitiveTopology, StencilOp, StencilTestEnable, @@ -43,6 +42,8 @@ static_assert(Last <= std::numeric_limits<u8>::max()); } // namespace Dirty class StateTracker { + using Maxwell = Tegra::Engines::Maxwell3D::Regs; + public: explicit StateTracker(Core::System& system); @@ -102,10 +103,6 @@ public: return Exchange(Dirty::FrontFace, false); } - bool TouchPrimitiveTopology() { - return Exchange(Dirty::PrimitiveTopology, false); - } - bool TouchStencilOp() { return Exchange(Dirty::StencilOp, false); } @@ -114,7 +111,15 @@ public: return Exchange(Dirty::StencilTestEnable, false); } + bool ChangePrimitiveTopology(Maxwell::PrimitiveTopology new_topology) { + const bool has_changed = current_topology != new_topology; + current_topology = new_topology; + return has_changed; + } + private: + static constexpr auto INVALID_TOPOLOGY = static_cast<Maxwell::PrimitiveTopology>(~0u); + bool Exchange(std::size_t id, bool new_value) const noexcept { auto& flags = system.GPU().Maxwell3D().dirty.flags; const bool is_dirty = flags[id]; @@ -124,6 +129,7 @@ private: Core::System& system; Tegra::Engines::Maxwell3D::DirtyState::Flags invalidation_flags; + Maxwell::PrimitiveTopology current_topology = INVALID_TOPOLOGY; }; } // namespace Vulkan |