diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-01-07 05:11:03 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-01-07 20:20:39 +0100 |
commit | 179ee963db1c8310e533daa4457b02b7a8141539 (patch) | |
tree | f511ec266467559a841926b9f7bf27c72b8f3e46 /src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | |
parent | gl_shader_cache: Use dirty flags for shaders (diff) | |
download | yuzu-179ee963db1c8310e533daa4457b02b7a8141539.tar yuzu-179ee963db1c8310e533daa4457b02b7a8141539.tar.gz yuzu-179ee963db1c8310e533daa4457b02b7a8141539.tar.bz2 yuzu-179ee963db1c8310e533daa4457b02b7a8141539.tar.lz yuzu-179ee963db1c8310e533daa4457b02b7a8141539.tar.xz yuzu-179ee963db1c8310e533daa4457b02b7a8141539.tar.zst yuzu-179ee963db1c8310e533daa4457b02b7a8141539.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer_cache.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index d3dcb9a46..0059b336a 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp @@ -933,21 +933,27 @@ Surface RasterizerCacheOpenGL::GetDepthBufferSurface(bool preserve_contents) { } Surface RasterizerCacheOpenGL::GetColorBufferSurface(std::size_t index, bool preserve_contents) { - const auto& regs{Core::System::GetInstance().GPU().Maxwell3D().regs}; + auto& gpu{Core::System::GetInstance().GPU().Maxwell3D()}; + const auto& regs{gpu.regs}; + + if ((gpu.dirty_flags.color_buffer & (1u << static_cast<u32>(index))) == 0) { + return last_color_buffers[index]; + } + gpu.dirty_flags.color_buffer &= ~(1u << static_cast<u32>(index)); ASSERT(index < Tegra::Engines::Maxwell3D::Regs::NumRenderTargets); if (index >= regs.rt_control.count) { - return {}; + return last_color_buffers[index] = {}; } if (regs.rt[index].Address() == 0 || regs.rt[index].format == Tegra::RenderTargetFormat::NONE) { - return {}; + return last_color_buffers[index] = {}; } const SurfaceParams color_params{SurfaceParams::CreateForFramebuffer(index)}; - return GetSurface(color_params, preserve_contents); + return last_color_buffers[index] = GetSurface(color_params, preserve_contents); } void RasterizerCacheOpenGL::LoadSurface(const Surface& surface) { |