diff options
Diffstat (limited to '')
-rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 565b99254..2e19fced2 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -1122,7 +1122,7 @@ typename TextureCache<P>::BlitImages TextureCache<P>::GetBlitImages( break; } if (can_be_depth_blit) { - const ImageBase* const dst_image = src_id ? &slot_images[src_id] : nullptr; + const ImageBase* const dst_image = dst_id ? &slot_images[dst_id] : nullptr; DeduceBlitImages(dst_info, src_info, dst_image, src_image); if (GetFormatType(dst_info.format) != GetFormatType(src_info.format)) { continue; @@ -1135,8 +1135,16 @@ typename TextureCache<P>::BlitImages TextureCache<P>::GetBlitImages( dst_id = InsertImage(dst_info, dst_addr, RelaxedOptions{}); } } while (has_deleted_images); - if (GetFormatType(dst_info.format) != SurfaceType::ColorTexture) { - // Make sure the images are depth and/or stencil textures. + const ImageBase& src_image = slot_images[src_id]; + const ImageBase& dst_image = slot_images[dst_id]; + const bool native_bgr = runtime.HasNativeBgr(); + if (GetFormatType(dst_info.format) != GetFormatType(dst_image.info.format) || + GetFormatType(src_info.format) != GetFormatType(src_image.info.format) || + !VideoCore::Surface::IsViewCompatible(dst_info.format, dst_image.info.format, false, + native_bgr) || + !VideoCore::Surface::IsViewCompatible(src_info.format, src_image.info.format, false, + native_bgr)) { + // Make sure the images match the expected format. do { has_deleted_images = false; src_id = FindOrInsertImage(src_info, src_addr, RelaxedOptions{}); @@ -1847,9 +1855,20 @@ void TextureCache<P>::CopyImage(ImageId dst_id, ImageId src_id, std::vector<Imag .height = std::min(dst_view.size.height, src_view.size.height), .depth = std::min(dst_view.size.depth, src_view.size.depth), }; - UNIMPLEMENTED_IF(copy.extent != expected_size); + const Extent3D scaled_extent = [is_rescaled, expected_size]() { + if (!is_rescaled) { + return expected_size; + } + const auto& resolution = Settings::values.resolution_info; + return Extent3D{ + .width = resolution.ScaleUp(expected_size.width), + .height = resolution.ScaleUp(expected_size.height), + .depth = expected_size.depth, + }; + }(); + UNIMPLEMENTED_IF(copy.extent != scaled_extent); - runtime.ConvertImage(dst_framebuffer, dst_view, src_view, is_rescaled); + runtime.ConvertImage(dst_framebuffer, dst_view, src_view); } } |