summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2019-04-12 03:49:21 +0200
committerGitHub <noreply@github.com>2019-04-12 03:49:21 +0200
commitc0b2b7020de11cb87409703f1f5937a7dc2eb8e3 (patch)
tree965543091085393ed2791a4850f618bbadc63d52
parentMerge pull request #2278 from ReinUsesLisp/vc-texture-cache (diff)
parentgl_rasterizer_cache: Relax restrictions on FastCopySurface and FastLayeredCopySurface (diff)
downloadyuzu-c0b2b7020de11cb87409703f1f5937a7dc2eb8e3.tar
yuzu-c0b2b7020de11cb87409703f1f5937a7dc2eb8e3.tar.gz
yuzu-c0b2b7020de11cb87409703f1f5937a7dc2eb8e3.tar.bz2
yuzu-c0b2b7020de11cb87409703f1f5937a7dc2eb8e3.tar.lz
yuzu-c0b2b7020de11cb87409703f1f5937a7dc2eb8e3.tar.xz
yuzu-c0b2b7020de11cb87409703f1f5937a7dc2eb8e3.tar.zst
yuzu-c0b2b7020de11cb87409703f1f5937a7dc2eb8e3.zip
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
index 9026a9452..55b6d8591 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
@@ -1179,10 +1179,16 @@ Surface RasterizerCacheOpenGL::RecreateSurface(const Surface& old_surface,
return new_surface;
}
+ const bool old_compressed =
+ GetFormatTuple(old_params.pixel_format, old_params.component_type).compressed;
+ const bool new_compressed =
+ GetFormatTuple(new_params.pixel_format, new_params.component_type).compressed;
+ const bool compatible_formats =
+ GetFormatBpp(old_params.pixel_format) == GetFormatBpp(new_params.pixel_format) &&
+ !(old_compressed || new_compressed);
// For compatible surfaces, we can just do fast glCopyImageSubData based copy
- if (old_params.target == new_params.target && old_params.type == new_params.type &&
- old_params.depth == new_params.depth && old_params.depth == 1 &&
- GetFormatBpp(old_params.pixel_format) == GetFormatBpp(new_params.pixel_format)) {
+ if (old_params.target == new_params.target && old_params.depth == new_params.depth &&
+ old_params.depth == 1 && compatible_formats) {
FastCopySurface(old_surface, new_surface);
return new_surface;
}
@@ -1197,7 +1203,7 @@ Surface RasterizerCacheOpenGL::RecreateSurface(const Surface& old_surface,
case SurfaceTarget::TextureCubemap:
case SurfaceTarget::Texture2DArray:
case SurfaceTarget::TextureCubeArray:
- if (old_params.pixel_format == new_params.pixel_format)
+ if (compatible_formats)
FastLayeredCopySurface(old_surface, new_surface);
else {
AccurateCopySurface(old_surface, new_surface);