1
0
Fork 0
forked from suyu/suyu

texture_cache return invalid buffer on deactivated color_mask

This commit is contained in:
Fernando Sahmkow 2019-05-11 01:21:02 -04:00 committed by ReinUsesLisp
parent 6bd034eae9
commit d65a4af895
2 changed files with 9 additions and 2 deletions

View file

@ -370,10 +370,12 @@ void RasterizerOpenGL::SetupCachedFramebuffer(const FramebufferCacheKey& fbkey,
return; return;
if (fbkey.is_single_buffer) { if (fbkey.is_single_buffer) {
if (fbkey.color_attachments[0] != GL_NONE) { if (fbkey.color_attachments[0] != GL_NONE && fbkey.colors[0]) {
fbkey.colors[0]->Attach(fbkey.color_attachments[0]); fbkey.colors[0]->Attach(fbkey.color_attachments[0]);
glDrawBuffer(fbkey.color_attachments[0]);
} else {
glDrawBuffer(GL_NONE);
} }
glDrawBuffer(fbkey.color_attachments[0]);
} else { } else {
for (std::size_t index = 0; index < Maxwell::NumRenderTargets; ++index) { for (std::size_t index = 0; index < Maxwell::NumRenderTargets; ++index) {
if (fbkey.colors[index]) { if (fbkey.colors[index]) {

View file

@ -133,6 +133,11 @@ public:
return {}; return {};
} }
if (regs.color_mask[index].raw != 0) {
SetEmptyColorBuffer(index);
return {};
}
const auto& config{regs.rt[index]}; const auto& config{regs.rt[index]};
const auto gpu_addr{config.Address()}; const auto gpu_addr{config.Address()};
if (!gpu_addr) { if (!gpu_addr) {