mirror of
https://github.com/yuzu-emu/yuzu-mainline
synced 2024-11-23 16:43:56 +00:00
gl_rasterizer_cache: Relax restrictions on FastCopySurface and FastLayeredCopySurface
This commit is contained in:
parent
6951741a94
commit
c9305959d3
1 changed files with 10 additions and 4 deletions
|
@ -1179,10 +1179,16 @@ Surface RasterizerCacheOpenGL::RecreateSurface(const Surface& old_surface,
|
||||||
return new_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
|
// For compatible surfaces, we can just do fast glCopyImageSubData based copy
|
||||||
if (old_params.target == new_params.target && old_params.type == new_params.type &&
|
if (old_params.target == new_params.target && old_params.depth == new_params.depth &&
|
||||||
old_params.depth == new_params.depth && old_params.depth == 1 &&
|
old_params.depth == 1 && compatible_formats) {
|
||||||
GetFormatBpp(old_params.pixel_format) == GetFormatBpp(new_params.pixel_format)) {
|
|
||||||
FastCopySurface(old_surface, new_surface);
|
FastCopySurface(old_surface, new_surface);
|
||||||
return new_surface;
|
return new_surface;
|
||||||
}
|
}
|
||||||
|
@ -1197,7 +1203,7 @@ Surface RasterizerCacheOpenGL::RecreateSurface(const Surface& old_surface,
|
||||||
case SurfaceTarget::TextureCubemap:
|
case SurfaceTarget::TextureCubemap:
|
||||||
case SurfaceTarget::Texture2DArray:
|
case SurfaceTarget::Texture2DArray:
|
||||||
case SurfaceTarget::TextureCubeArray:
|
case SurfaceTarget::TextureCubeArray:
|
||||||
if (old_params.pixel_format == new_params.pixel_format)
|
if (compatible_formats)
|
||||||
FastLayeredCopySurface(old_surface, new_surface);
|
FastLayeredCopySurface(old_surface, new_surface);
|
||||||
else {
|
else {
|
||||||
AccurateCopySurface(old_surface, new_surface);
|
AccurateCopySurface(old_surface, new_surface);
|
||||||
|
|
Loading…
Reference in a new issue