summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2019-04-11 21:49:21 -0400
committerGravatar GitHub2019-04-11 21:49:21 -0400
commitc0b2b7020de11cb87409703f1f5937a7dc2eb8e3 (patch)
tree965543091085393ed2791a4850f618bbadc63d52
parentMerge pull request #2278 from ReinUsesLisp/vc-texture-cache (diff)
parentgl_rasterizer_cache: Relax restrictions on FastCopySurface and FastLayeredCop... (diff)
downloadyuzu-c0b2b7020de11cb87409703f1f5937a7dc2eb8e3.tar.gz
yuzu-c0b2b7020de11cb87409703f1f5937a7dc2eb8e3.tar.xz
yuzu-c0b2b7020de11cb87409703f1f5937a7dc2eb8e3.zip
Merge pull request #2387 from FernandoS27/fast-copy-relax
gl_rasterizer_cache: Relax restrictions on FastCopySurface
-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,
1179 return new_surface; 1179 return new_surface;
1180 } 1180 }
1181 1181
1182 const bool old_compressed =
1183 GetFormatTuple(old_params.pixel_format, old_params.component_type).compressed;
1184 const bool new_compressed =
1185 GetFormatTuple(new_params.pixel_format, new_params.component_type).compressed;
1186 const bool compatible_formats =
1187 GetFormatBpp(old_params.pixel_format) == GetFormatBpp(new_params.pixel_format) &&
1188 !(old_compressed || new_compressed);
1182 // For compatible surfaces, we can just do fast glCopyImageSubData based copy 1189 // For compatible surfaces, we can just do fast glCopyImageSubData based copy
1183 if (old_params.target == new_params.target && old_params.type == new_params.type && 1190 if (old_params.target == new_params.target && old_params.depth == new_params.depth &&
1184 old_params.depth == new_params.depth && old_params.depth == 1 && 1191 old_params.depth == 1 && compatible_formats) {
1185 GetFormatBpp(old_params.pixel_format) == GetFormatBpp(new_params.pixel_format)) {
1186 FastCopySurface(old_surface, new_surface); 1192 FastCopySurface(old_surface, new_surface);
1187 return new_surface; 1193 return new_surface;
1188 } 1194 }
@@ -1197,7 +1203,7 @@ Surface RasterizerCacheOpenGL::RecreateSurface(const Surface& old_surface,
1197 case SurfaceTarget::TextureCubemap: 1203 case SurfaceTarget::TextureCubemap:
1198 case SurfaceTarget::Texture2DArray: 1204 case SurfaceTarget::Texture2DArray:
1199 case SurfaceTarget::TextureCubeArray: 1205 case SurfaceTarget::TextureCubeArray:
1200 if (old_params.pixel_format == new_params.pixel_format) 1206 if (compatible_formats)
1201 FastLayeredCopySurface(old_surface, new_surface); 1207 FastLayeredCopySurface(old_surface, new_surface);
1202 else { 1208 else {
1203 AccurateCopySurface(old_surface, new_surface); 1209 AccurateCopySurface(old_surface, new_surface);