summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index f7397dd64..4dd08bccb 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -485,6 +485,12 @@ std::pair<bool, bool> RasterizerOpenGL::ConfigureFramebuffers(
485 View color_surface{ 485 View color_surface{
486 texture_cache.GetColorBufferSurface(*single_color_target, preserve_contents)}; 486 texture_cache.GetColorBufferSurface(*single_color_target, preserve_contents)};
487 487
488 if (color_surface) {
489 // Assume that a surface will be written to if it is used as a framebuffer, even if
490 // the shader doesn't actually write to it.
491 texture_cache.MarkColorBufferInUse(*single_color_target);
492 }
493
488 fbkey.is_single_buffer = true; 494 fbkey.is_single_buffer = true;
489 fbkey.color_attachments[0] = 495 fbkey.color_attachments[0] =
490 GL_COLOR_ATTACHMENT0 + static_cast<GLenum>(*single_color_target); 496 GL_COLOR_ATTACHMENT0 + static_cast<GLenum>(*single_color_target);
@@ -499,6 +505,12 @@ std::pair<bool, bool> RasterizerOpenGL::ConfigureFramebuffers(
499 for (std::size_t index = 0; index < Maxwell::NumRenderTargets; ++index) { 505 for (std::size_t index = 0; index < Maxwell::NumRenderTargets; ++index) {
500 View color_surface{texture_cache.GetColorBufferSurface(index, preserve_contents)}; 506 View color_surface{texture_cache.GetColorBufferSurface(index, preserve_contents)};
501 507
508 if (color_surface) {
509 // Assume that a surface will be written to if it is used as a framebuffer, even
510 // if the shader doesn't actually write to it.
511 texture_cache.MarkColorBufferInUse(index);
512 }
513
502 fbkey.color_attachments[index] = 514 fbkey.color_attachments[index] =
503 GL_COLOR_ATTACHMENT0 + regs.rt_control.GetMap(index); 515 GL_COLOR_ATTACHMENT0 + regs.rt_control.GetMap(index);
504 fbkey.colors[index] = color_surface; 516 fbkey.colors[index] = color_surface;