From 96ac3d518a9882a2a040f319c47a567467c9266d Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Wed, 25 Dec 2019 17:02:17 -0300 Subject: gl_rasterizer: Remove dirty flags --- src/video_core/texture_cache/texture_cache.h | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'src/video_core/texture_cache') diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index c70e4aec2..ec6dfa49e 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -143,11 +143,6 @@ public: std::lock_guard lock{mutex}; auto& maxwell3d = system.GPU().Maxwell3D(); - if (!maxwell3d.dirty.depth_buffer) { - return depth_buffer.view; - } - maxwell3d.dirty.depth_buffer = false; - const auto& regs{maxwell3d.regs}; const auto gpu_addr{regs.zeta.Address()}; if (!gpu_addr || !regs.zeta_enable) { @@ -175,10 +170,6 @@ public: std::lock_guard lock{mutex}; ASSERT(index < Tegra::Engines::Maxwell3D::Regs::NumRenderTargets); auto& maxwell3d = system.GPU().Maxwell3D(); - if (!maxwell3d.dirty.render_target[index]) { - return render_targets[index].view; - } - maxwell3d.dirty.render_target[index] = false; const auto& regs{maxwell3d.regs}; if (index >= regs.rt_control.count || regs.rt[index].Address() == 0 || @@ -319,16 +310,7 @@ protected: // and reading it from a separate buffer. virtual void BufferCopy(TSurface& src_surface, TSurface& dst_surface) = 0; - void ManageRenderTargetUnregister(TSurface& surface) { - auto& maxwell3d = system.GPU().Maxwell3D(); - const u32 index = surface->GetRenderTarget(); - if (index == DEPTH_RT) { - maxwell3d.dirty.depth_buffer = true; - } else { - maxwell3d.dirty.render_target[index] = true; - } - maxwell3d.dirty.render_settings = true; - } + void ManageRenderTargetUnregister([[maybe_unused]] TSurface& surface) {} void Register(TSurface surface) { const GPUVAddr gpu_addr = surface->GetGpuAddr(); -- cgit v1.2.3 From dacf83ac0257727a48c971ca1cfcd220976c461f Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Sat, 28 Dec 2019 21:45:56 -0300 Subject: renderer_opengl: Reintroduce dirty flags for render targets --- src/video_core/texture_cache/texture_cache.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/video_core/texture_cache') diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index ec6dfa49e..51373b687 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -22,6 +22,7 @@ #include "core/core.h" #include "core/memory.h" #include "core/settings.h" +#include "video_core/dirty_flags.h" #include "video_core/engines/fermi_2d.h" #include "video_core/engines/maxwell_3d.h" #include "video_core/gpu.h" @@ -142,6 +143,10 @@ public: TView GetDepthBufferSurface(bool preserve_contents) { std::lock_guard lock{mutex}; auto& maxwell3d = system.GPU().Maxwell3D(); + if (!maxwell3d.dirty.flags[VideoCommon::Dirty::ZetaBuffer]) { + return depth_buffer.view; + } + maxwell3d.dirty.flags[VideoCommon::Dirty::ZetaBuffer] = false; const auto& regs{maxwell3d.regs}; const auto gpu_addr{regs.zeta.Address()}; @@ -170,6 +175,10 @@ public: std::lock_guard lock{mutex}; ASSERT(index < Tegra::Engines::Maxwell3D::Regs::NumRenderTargets); auto& maxwell3d = system.GPU().Maxwell3D(); + if (!maxwell3d.dirty.flags[VideoCommon::Dirty::ColorBuffer0 + index]) { + return render_targets[index].view; + } + maxwell3d.dirty.flags[VideoCommon::Dirty::ColorBuffer0 + index] = false; const auto& regs{maxwell3d.regs}; if (index >= regs.rt_control.count || regs.rt[index].Address() == 0 || @@ -310,7 +319,16 @@ protected: // and reading it from a separate buffer. virtual void BufferCopy(TSurface& src_surface, TSurface& dst_surface) = 0; - void ManageRenderTargetUnregister([[maybe_unused]] TSurface& surface) {} + void ManageRenderTargetUnregister(TSurface& surface) { + auto& dirty = system.GPU().Maxwell3D().dirty; + const u32 index = surface->GetRenderTarget(); + if (index == DEPTH_RT) { + dirty.flags[VideoCommon::Dirty::ZetaBuffer] = true; + } else { + dirty.flags[VideoCommon::Dirty::ColorBuffer0 + index] = true; + } + dirty.flags[VideoCommon::Dirty::RenderTargets] = true; + } void Register(TSurface surface) { const GPUVAddr gpu_addr = surface->GetGpuAddr(); -- cgit v1.2.3