diff options
| author | 2020-03-09 18:34:37 -0300 | |
|---|---|---|
| committer | 2020-03-09 18:34:37 -0300 | |
| commit | 22e825a3bc0d9bfb5f8c29a50724c2887014dc02 (patch) | |
| tree | d68f0ace93ba44292e3017dcb219f3132b3314ef /src/video_core/texture_cache | |
| parent | Merge pull request #3486 from ReinUsesLisp/fix-anisotropy-hack (diff) | |
| parent | video_core/dirty_flags: Address feedback (diff) | |
| download | yuzu-22e825a3bc0d9bfb5f8c29a50724c2887014dc02.tar.gz yuzu-22e825a3bc0d9bfb5f8c29a50724c2887014dc02.tar.xz yuzu-22e825a3bc0d9bfb5f8c29a50724c2887014dc02.zip | |
Merge pull request #3301 from ReinUsesLisp/state-tracker
video_core: Remove gl_state and use a state tracker based on dirty flags
Diffstat (limited to 'src/video_core/texture_cache')
| -rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index c70e4aec2..51373b687 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include "core/core.h" | 22 | #include "core/core.h" |
| 23 | #include "core/memory.h" | 23 | #include "core/memory.h" |
| 24 | #include "core/settings.h" | 24 | #include "core/settings.h" |
| 25 | #include "video_core/dirty_flags.h" | ||
| 25 | #include "video_core/engines/fermi_2d.h" | 26 | #include "video_core/engines/fermi_2d.h" |
| 26 | #include "video_core/engines/maxwell_3d.h" | 27 | #include "video_core/engines/maxwell_3d.h" |
| 27 | #include "video_core/gpu.h" | 28 | #include "video_core/gpu.h" |
| @@ -142,11 +143,10 @@ public: | |||
| 142 | TView GetDepthBufferSurface(bool preserve_contents) { | 143 | TView GetDepthBufferSurface(bool preserve_contents) { |
| 143 | std::lock_guard lock{mutex}; | 144 | std::lock_guard lock{mutex}; |
| 144 | auto& maxwell3d = system.GPU().Maxwell3D(); | 145 | auto& maxwell3d = system.GPU().Maxwell3D(); |
| 145 | 146 | if (!maxwell3d.dirty.flags[VideoCommon::Dirty::ZetaBuffer]) { | |
| 146 | if (!maxwell3d.dirty.depth_buffer) { | ||
| 147 | return depth_buffer.view; | 147 | return depth_buffer.view; |
| 148 | } | 148 | } |
| 149 | maxwell3d.dirty.depth_buffer = false; | 149 | maxwell3d.dirty.flags[VideoCommon::Dirty::ZetaBuffer] = false; |
| 150 | 150 | ||
| 151 | const auto& regs{maxwell3d.regs}; | 151 | const auto& regs{maxwell3d.regs}; |
| 152 | const auto gpu_addr{regs.zeta.Address()}; | 152 | const auto gpu_addr{regs.zeta.Address()}; |
| @@ -175,10 +175,10 @@ public: | |||
| 175 | std::lock_guard lock{mutex}; | 175 | std::lock_guard lock{mutex}; |
| 176 | ASSERT(index < Tegra::Engines::Maxwell3D::Regs::NumRenderTargets); | 176 | ASSERT(index < Tegra::Engines::Maxwell3D::Regs::NumRenderTargets); |
| 177 | auto& maxwell3d = system.GPU().Maxwell3D(); | 177 | auto& maxwell3d = system.GPU().Maxwell3D(); |
| 178 | if (!maxwell3d.dirty.render_target[index]) { | 178 | if (!maxwell3d.dirty.flags[VideoCommon::Dirty::ColorBuffer0 + index]) { |
| 179 | return render_targets[index].view; | 179 | return render_targets[index].view; |
| 180 | } | 180 | } |
| 181 | maxwell3d.dirty.render_target[index] = false; | 181 | maxwell3d.dirty.flags[VideoCommon::Dirty::ColorBuffer0 + index] = false; |
| 182 | 182 | ||
| 183 | const auto& regs{maxwell3d.regs}; | 183 | const auto& regs{maxwell3d.regs}; |
| 184 | if (index >= regs.rt_control.count || regs.rt[index].Address() == 0 || | 184 | if (index >= regs.rt_control.count || regs.rt[index].Address() == 0 || |
| @@ -320,14 +320,14 @@ protected: | |||
| 320 | virtual void BufferCopy(TSurface& src_surface, TSurface& dst_surface) = 0; | 320 | virtual void BufferCopy(TSurface& src_surface, TSurface& dst_surface) = 0; |
| 321 | 321 | ||
| 322 | void ManageRenderTargetUnregister(TSurface& surface) { | 322 | void ManageRenderTargetUnregister(TSurface& surface) { |
| 323 | auto& maxwell3d = system.GPU().Maxwell3D(); | 323 | auto& dirty = system.GPU().Maxwell3D().dirty; |
| 324 | const u32 index = surface->GetRenderTarget(); | 324 | const u32 index = surface->GetRenderTarget(); |
| 325 | if (index == DEPTH_RT) { | 325 | if (index == DEPTH_RT) { |
| 326 | maxwell3d.dirty.depth_buffer = true; | 326 | dirty.flags[VideoCommon::Dirty::ZetaBuffer] = true; |
| 327 | } else { | 327 | } else { |
| 328 | maxwell3d.dirty.render_target[index] = true; | 328 | dirty.flags[VideoCommon::Dirty::ColorBuffer0 + index] = true; |
| 329 | } | 329 | } |
| 330 | maxwell3d.dirty.render_settings = true; | 330 | dirty.flags[VideoCommon::Dirty::RenderTargets] = true; |
| 331 | } | 331 | } |
| 332 | 332 | ||
| 333 | void Register(TSurface surface) { | 333 | void Register(TSurface surface) { |