mirror of
				https://git.suyu.dev/suyu/suyu
				synced 2025-11-03 16:39:01 -06:00 
			
		
		
		
	gl_texture_cache: Disable scissor test when scaling textures
Fixes a bug on BOTW where some objects were no longer being rendered after blitting
This commit is contained in:
		@@ -939,6 +939,11 @@ bool Image::Scale() {
 | 
				
			|||||||
        dst_info.size.height = scaled_height;
 | 
					        dst_info.size.height = scaled_height;
 | 
				
			||||||
        upscaled_backup = MakeImage(dst_info, gl_internal_format);
 | 
					        upscaled_backup = MakeImage(dst_info, gl_internal_format);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    // TODO (ameerj): Investigate other GL states that affect blitting.
 | 
				
			||||||
 | 
					    GLboolean scissor_test;
 | 
				
			||||||
 | 
					    glGetBooleani_v(GL_SCISSOR_TEST, 0, &scissor_test);
 | 
				
			||||||
 | 
					    glDisablei(GL_SCISSOR_TEST, 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const GLuint read_fbo = runtime->rescale_read_fbos[fbo_index].handle;
 | 
					    const GLuint read_fbo = runtime->rescale_read_fbos[fbo_index].handle;
 | 
				
			||||||
    const GLuint draw_fbo = runtime->rescale_draw_fbos[fbo_index].handle;
 | 
					    const GLuint draw_fbo = runtime->rescale_draw_fbos[fbo_index].handle;
 | 
				
			||||||
    for (s32 layer = 0; layer < info.resources.layers; ++layer) {
 | 
					    for (s32 layer = 0; layer < info.resources.layers; ++layer) {
 | 
				
			||||||
@@ -955,6 +960,9 @@ bool Image::Scale() {
 | 
				
			|||||||
                                   0, dst_level_width, dst_level_height, mask, filter);
 | 
					                                   0, dst_level_width, dst_level_height, mask, filter);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    if (scissor_test != GL_FALSE) {
 | 
				
			||||||
 | 
					        glEnablei(GL_SCISSOR_TEST, 0);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    current_texture = upscaled_backup.handle;
 | 
					    current_texture = upscaled_backup.handle;
 | 
				
			||||||
    return true;
 | 
					    return true;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user