summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2019-05-11 01:21:02 -0400
committerGravatar ReinUsesLisp2019-06-20 21:36:12 -0300
commitd65a4af89582f272efbbfd47d1ee78e616553312 (patch)
tree82e3742e6a03f55ebe4b3aecc21c554d4d5d9334 /src
parentengine_upload: Addapt to new Texture Cache (diff)
downloadyuzu-d65a4af89582f272efbbfd47d1ee78e616553312.tar.gz
yuzu-d65a4af89582f272efbbfd47d1ee78e616553312.tar.xz
yuzu-d65a4af89582f272efbbfd47d1ee78e616553312.zip
texture_cache return invalid buffer on deactivated color_mask
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp6
-rw-r--r--src/video_core/texture_cache/texture_cache.h5
2 files changed, 9 insertions, 2 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 2d6fd154a..2872dbdeb 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -370,10 +370,12 @@ void RasterizerOpenGL::SetupCachedFramebuffer(const FramebufferCacheKey& fbkey,
370 return; 370 return;
371 371
372 if (fbkey.is_single_buffer) { 372 if (fbkey.is_single_buffer) {
373 if (fbkey.color_attachments[0] != GL_NONE) { 373 if (fbkey.color_attachments[0] != GL_NONE && fbkey.colors[0]) {
374 fbkey.colors[0]->Attach(fbkey.color_attachments[0]); 374 fbkey.colors[0]->Attach(fbkey.color_attachments[0]);
375 glDrawBuffer(fbkey.color_attachments[0]);
376 } else {
377 glDrawBuffer(GL_NONE);
375 } 378 }
376 glDrawBuffer(fbkey.color_attachments[0]);
377 } else { 379 } else {
378 for (std::size_t index = 0; index < Maxwell::NumRenderTargets; ++index) { 380 for (std::size_t index = 0; index < Maxwell::NumRenderTargets; ++index) {
379 if (fbkey.colors[index]) { 381 if (fbkey.colors[index]) {
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index 1b8ada910..7058399e2 100644
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -133,6 +133,11 @@ public:
133 return {}; 133 return {};
134 } 134 }
135 135
136 if (regs.color_mask[index].raw != 0) {
137 SetEmptyColorBuffer(index);
138 return {};
139 }
140
136 const auto& config{regs.rt[index]}; 141 const auto& config{regs.rt[index]};
137 const auto gpu_addr{config.Address()}; 142 const auto gpu_addr{config.Address()};
138 if (!gpu_addr) { 143 if (!gpu_addr) {