summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2018-09-11 20:14:00 -0400
committerGravatar bunnei2018-09-11 22:54:46 -0400
commit7bb226f22da31bcf4aeeaaf7ac07a3ee77347e20 (patch)
tree5847e3d2ab8053fdca40822db8546de02e35ad2e /src
parentgl_shader_cache: Remove cache_width/cache_height. (diff)
downloadyuzu-7bb226f22da31bcf4aeeaaf7ac07a3ee77347e20.tar.gz
yuzu-7bb226f22da31bcf4aeeaaf7ac07a3ee77347e20.tar.xz
yuzu-7bb226f22da31bcf4aeeaaf7ac07a3ee77347e20.zip
gl_rasterizer_cache: Always blit on recreate, regardless of format.
- Fixes several rendering issues with Super Mario Odyssey.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
index 0d7a38e3e..3b38565f4 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
@@ -811,16 +811,20 @@ Surface RasterizerCacheOpenGL::RecreateSurface(const Surface& surface,
811 // Get a new surface with the new parameters, and blit the previous surface to it 811 // Get a new surface with the new parameters, and blit the previous surface to it
812 Surface new_surface{GetUncachedSurface(new_params)}; 812 Surface new_surface{GetUncachedSurface(new_params)};
813 813
814 // If format is unchanged, we can do a faster blit without reinterpreting pixel data 814 if (params.pixel_format == new_params.pixel_format ||
815 if (params.pixel_format == new_params.pixel_format) { 815 !Settings::values.use_accurate_framebuffers) {
816 // If the format is the same, just do a framebuffer blit. This is significantly faster than
817 // using PBOs. The is also likely less accurate, as textures will be converted rather than
818 // reinterpreted.
819
816 BlitTextures(surface->Texture().handle, params.GetRect(), new_surface->Texture().handle, 820 BlitTextures(surface->Texture().handle, params.GetRect(), new_surface->Texture().handle,
817 params.GetRect(), params.type, read_framebuffer.handle, 821 params.GetRect(), params.type, read_framebuffer.handle,
818 draw_framebuffer.handle); 822 draw_framebuffer.handle);
819 return new_surface; 823 } else {
820 } 824 // When use_accurate_framebuffers setting is enabled, perform a more accurate surface copy,
825 // where pixels are reinterpreted as a new format (without conversion). This code path uses
826 // OpenGL PBOs and is quite slow.
821 827
822 // When using accurate framebuffers, always copy old data to new surface, regardless of format
823 if (Settings::values.use_accurate_framebuffers) {
824 auto source_format = GetFormatTuple(params.pixel_format, params.component_type); 828 auto source_format = GetFormatTuple(params.pixel_format, params.component_type);
825 auto dest_format = GetFormatTuple(new_params.pixel_format, new_params.component_type); 829 auto dest_format = GetFormatTuple(new_params.pixel_format, new_params.component_type);
826 830