diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-02-09 00:31:35 +0100 |
---|---|---|
committer | FernandoS27 <fsahmkow27@gmail.com> | 2019-02-28 02:58:37 +0100 |
commit | d583fc1e97a78dc6a893c332b3537218ddae194a (patch) | |
tree | f133cd2db14a65c5864cfa0b13f1f3d376f935f9 /src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | |
parent | rasterizer_cache: Expose FlushObject to Child classes and allow redefining of Register and Unregister (diff) | |
download | yuzu-d583fc1e97a78dc6a893c332b3537218ddae194a.tar yuzu-d583fc1e97a78dc6a893c332b3537218ddae194a.tar.gz yuzu-d583fc1e97a78dc6a893c332b3537218ddae194a.tar.bz2 yuzu-d583fc1e97a78dc6a893c332b3537218ddae194a.tar.lz yuzu-d583fc1e97a78dc6a893c332b3537218ddae194a.tar.xz yuzu-d583fc1e97a78dc6a893c332b3537218ddae194a.tar.zst yuzu-d583fc1e97a78dc6a893c332b3537218ddae194a.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index 81b6099f9..2d2bbd6ac 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp @@ -968,18 +968,27 @@ Surface RasterizerCacheOpenGL::GetColorBufferSurface(std::size_t index, bool pre gpu.dirty_flags.color_buffer.reset(index); ASSERT(index < Tegra::Engines::Maxwell3D::Regs::NumRenderTargets); + auto Notify = [&]() { + if (last_color_buffers[index] != current_color_buffers[index]) { + NotifyFrameBufferChange(current_color_buffers[index]); + } + last_color_buffers[index] = current_color_buffers[index]; + }; if (index >= regs.rt_control.count) { - return last_color_buffers[index] = {}; + Notify(); + return current_color_buffers[index] = {}; } if (regs.rt[index].Address() == 0 || regs.rt[index].format == Tegra::RenderTargetFormat::NONE) { - return last_color_buffers[index] = {}; + Notify(); + return current_color_buffers[index] = {}; } const SurfaceParams color_params{SurfaceParams::CreateForFramebuffer(index)}; - return last_color_buffers[index] = GetSurface(color_params, preserve_contents); + Notify(); + return current_color_buffers[index] = GetSurface(color_params, preserve_contents); } void RasterizerCacheOpenGL::LoadSurface(const Surface& surface) { @@ -1290,4 +1299,9 @@ Surface RasterizerCacheOpenGL::TryGetReservedSurface(const SurfaceParams& params return {}; } +void RasterizerCacheOpenGL::NotifyFrameBufferChange(Surface triggering_surface) { + if (triggering_surface == nullptr) + return; +} + } // namespace OpenGL |