diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-01-04 05:56:44 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-01-04 06:06:40 +0100 |
commit | 7d904fef2e6ac9ce8a3df71e758a36d39b8f69e5 (patch) | |
tree | 5bdc2bdcf8b5aeb594a3a2b16c183b13d6fe2771 /src/video_core/texture_cache/texture_cache.h | |
parent | gl_texture_cache: Create base images with sRGB (diff) | |
download | yuzu-7d904fef2e6ac9ce8a3df71e758a36d39b8f69e5.tar yuzu-7d904fef2e6ac9ce8a3df71e758a36d39b8f69e5.tar.gz yuzu-7d904fef2e6ac9ce8a3df71e758a36d39b8f69e5.tar.bz2 yuzu-7d904fef2e6ac9ce8a3df71e758a36d39b8f69e5.tar.lz yuzu-7d904fef2e6ac9ce8a3df71e758a36d39b8f69e5.tar.xz yuzu-7d904fef2e6ac9ce8a3df71e758a36d39b8f69e5.tar.zst yuzu-7d904fef2e6ac9ce8a3df71e758a36d39b8f69e5.zip |
Diffstat (limited to 'src/video_core/texture_cache/texture_cache.h')
-rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 968059842..ad86c50b4 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -883,6 +883,7 @@ ImageId TextureCache<P>::FindImage(const ImageInfo& info, GPUVAddr gpu_addr, if (!cpu_addr) { return ImageId{}; } + const bool broken_views = runtime.HasBrokenTextureViewFormats(); ImageId image_id; const auto lambda = [&](ImageId existing_image_id, ImageBase& existing_image) { if (info.type == ImageType::Linear || existing_image.info.type == ImageType::Linear) { @@ -892,11 +893,11 @@ ImageId TextureCache<P>::FindImage(const ImageInfo& info, GPUVAddr gpu_addr, if (existing_image.gpu_addr == gpu_addr && existing.type == info.type && existing.pitch == info.pitch && IsPitchLinearSameSize(existing, info, strict_size) && - IsViewCompatible(existing.format, info.format)) { + IsViewCompatible(existing.format, info.format, broken_views)) { image_id = existing_image_id; return true; } - } else if (IsSubresource(info, existing_image, gpu_addr, options)) { + } else if (IsSubresource(info, existing_image, gpu_addr, options, broken_views)) { image_id = existing_image_id; return true; } @@ -926,6 +927,7 @@ template <class P> ImageId TextureCache<P>::JoinImages(const ImageInfo& info, GPUVAddr gpu_addr, VAddr cpu_addr) { ImageInfo new_info = info; const size_t size_bytes = CalculateGuestSizeInBytes(new_info); + const bool broken_views = runtime.HasBrokenTextureViewFormats(); std::vector<ImageId> overlap_ids; std::vector<ImageId> left_aliased_ids; std::vector<ImageId> right_aliased_ids; @@ -940,7 +942,9 @@ ImageId TextureCache<P>::JoinImages(const ImageInfo& info, GPUVAddr gpu_addr, VA } return; } - const auto solution = ResolveOverlap(new_info, gpu_addr, cpu_addr, overlap, true); + static constexpr bool strict_size = true; + const std::optional<OverlapResult> solution = + ResolveOverlap(new_info, gpu_addr, cpu_addr, overlap, strict_size, broken_views); if (solution) { gpu_addr = solution->gpu_addr; cpu_addr = solution->cpu_addr; @@ -950,9 +954,10 @@ ImageId TextureCache<P>::JoinImages(const ImageInfo& info, GPUVAddr gpu_addr, VA } static constexpr auto options = RelaxedOptions::Size | RelaxedOptions::Format; const ImageBase new_image_base(new_info, gpu_addr, cpu_addr); - if (IsSubresource(new_info, overlap, gpu_addr, options)) { + if (IsSubresource(new_info, overlap, gpu_addr, options, broken_views)) { left_aliased_ids.push_back(overlap_id); - } else if (IsSubresource(overlap.info, new_image_base, overlap.gpu_addr, options)) { + } else if (IsSubresource(overlap.info, new_image_base, overlap.gpu_addr, options, + broken_views)) { right_aliased_ids.push_back(overlap_id); } }); |