diff options
author | bunnei <bunneidev@gmail.com> | 2018-09-12 02:14:00 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-09-12 04:54:46 +0200 |
commit | 7bb226f22da31bcf4aeeaaf7ac07a3ee77347e20 (patch) | |
tree | 5847e3d2ab8053fdca40822db8546de02e35ad2e | |
parent | gl_shader_cache: Remove cache_width/cache_height. (diff) | |
download | yuzu-7bb226f22da31bcf4aeeaaf7ac07a3ee77347e20.tar yuzu-7bb226f22da31bcf4aeeaaf7ac07a3ee77347e20.tar.gz yuzu-7bb226f22da31bcf4aeeaaf7ac07a3ee77347e20.tar.bz2 yuzu-7bb226f22da31bcf4aeeaaf7ac07a3ee77347e20.tar.lz yuzu-7bb226f22da31bcf4aeeaaf7ac07a3ee77347e20.tar.xz yuzu-7bb226f22da31bcf4aeeaaf7ac07a3ee77347e20.tar.zst yuzu-7bb226f22da31bcf4aeeaaf7ac07a3ee77347e20.zip |
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 16 |
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, // Get a new surface with the new parameters, and blit the previous surface to it Surface new_surface{GetUncachedSurface(new_params)}; - // If format is unchanged, we can do a faster blit without reinterpreting pixel data - if (params.pixel_format == new_params.pixel_format) { + if (params.pixel_format == new_params.pixel_format || + !Settings::values.use_accurate_framebuffers) { + // If the format is the same, just do a framebuffer blit. This is significantly faster than + // using PBOs. The is also likely less accurate, as textures will be converted rather than + // reinterpreted. + BlitTextures(surface->Texture().handle, params.GetRect(), new_surface->Texture().handle, params.GetRect(), params.type, read_framebuffer.handle, draw_framebuffer.handle); - return new_surface; - } + } else { + // When use_accurate_framebuffers setting is enabled, perform a more accurate surface copy, + // where pixels are reinterpreted as a new format (without conversion). This code path uses + // OpenGL PBOs and is quite slow. - // When using accurate framebuffers, always copy old data to new surface, regardless of format - if (Settings::values.use_accurate_framebuffers) { auto source_format = GetFormatTuple(params.pixel_format, params.component_type); auto dest_format = GetFormatTuple(new_params.pixel_format, new_params.component_type); |