mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-07-04 23:31:19 +01:00
Implement Reinterpret Surface, to accurately blit 3D textures
This commit is contained in:
parent
dbc34db6ce
commit
cb9fdc7a26
1 changed files with 4 additions and 2 deletions
|
@ -1123,8 +1123,8 @@ Surface RasterizerCacheOpenGL::GetSurface(const SurfaceParams& params, bool pres
|
|||
} else if (preserve_contents) {
|
||||
// If surface parameters changed and we care about keeping the previous data, recreate
|
||||
// the surface from the old one
|
||||
Unregister(surface);
|
||||
Surface new_surface{RecreateSurface(surface, params)};
|
||||
Unregister(surface);
|
||||
Register(new_surface);
|
||||
return new_surface;
|
||||
} else {
|
||||
|
@ -1214,7 +1214,6 @@ Surface RasterizerCacheOpenGL::RecreateSurface(const Surface& old_surface,
|
|||
const bool is_blit{old_params.pixel_format == new_params.pixel_format};
|
||||
|
||||
switch (new_params.target) {
|
||||
case SurfaceParams::SurfaceTarget::Texture3D:
|
||||
case SurfaceParams::SurfaceTarget::Texture2D:
|
||||
if (is_blit) {
|
||||
BlitSurface(old_surface, new_surface, read_framebuffer.handle, draw_framebuffer.handle);
|
||||
|
@ -1222,6 +1221,9 @@ Surface RasterizerCacheOpenGL::RecreateSurface(const Surface& old_surface,
|
|||
CopySurface(old_surface, new_surface, copy_pbo.handle);
|
||||
}
|
||||
break;
|
||||
case SurfaceParams::SurfaceTarget::Texture3D:
|
||||
AccurateCopySurface(old_surface, new_surface);
|
||||
break;
|
||||
case SurfaceParams::SurfaceTarget::TextureCubemap: {
|
||||
if (old_params.rt.array_mode != 1) {
|
||||
// TODO(bunnei): This is used by Breath of the Wild, I'm not sure how to implement this
|
||||
|
|
Loading…
Reference in a new issue