diff options
| author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-01-04 01:56:44 -0300 |
|---|---|---|
| committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-01-04 02:06:40 -0300 |
| commit | 7d904fef2e6ac9ce8a3df71e758a36d39b8f69e5 (patch) | |
| tree | 5bdc2bdcf8b5aeb594a3a2b16c183b13d6fe2771 /src/video_core/texture_cache/util.cpp | |
| parent | 3a49c1a691c7e97b2eea0dffd4c1e05b3296f58c (diff) | |
gl_texture_cache: Avoid format views on Intel and AMD
Intel and AMD proprietary drivers are incapable of rendering to texture
views of different formats than the original texture. Avoid creating
these at a cache level. This will consume more memory, emulating them
with copies.
Diffstat (limited to 'src/video_core/texture_cache/util.cpp')
| -rw-r--r-- | src/video_core/texture_cache/util.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/video_core/texture_cache/util.cpp b/src/video_core/texture_cache/util.cpp index 9ed1fc007..279932778 100644 --- a/src/video_core/texture_cache/util.cpp +++ b/src/video_core/texture_cache/util.cpp @@ -1069,13 +1069,13 @@ bool IsPitchLinearSameSize(const ImageInfo& lhs, const ImageInfo& rhs, bool stri std::optional<OverlapResult> ResolveOverlap(const ImageInfo& new_info, GPUVAddr gpu_addr, VAddr cpu_addr, const ImageBase& overlap, - bool strict_size) { + bool strict_size, bool broken_views) { ASSERT(new_info.type != ImageType::Linear); ASSERT(overlap.info.type != ImageType::Linear); if (!IsLayerStrideCompatible(new_info, overlap.info)) { return std::nullopt; } - if (!IsViewCompatible(overlap.info.format, new_info.format)) { + if (!IsViewCompatible(overlap.info.format, new_info.format, broken_views)) { return std::nullopt; } if (gpu_addr == overlap.gpu_addr) { @@ -1118,14 +1118,15 @@ bool IsLayerStrideCompatible(const ImageInfo& lhs, const ImageInfo& rhs) { } std::optional<SubresourceBase> FindSubresource(const ImageInfo& candidate, const ImageBase& image, - GPUVAddr candidate_addr, RelaxedOptions options) { + GPUVAddr candidate_addr, RelaxedOptions options, + bool broken_views) { const std::optional<SubresourceBase> base = image.TryFindBase(candidate_addr); if (!base) { return std::nullopt; } const ImageInfo& existing = image.info; if (False(options & RelaxedOptions::Format)) { - if (!IsViewCompatible(existing.format, candidate.format)) { + if (!IsViewCompatible(existing.format, candidate.format, broken_views)) { return std::nullopt; } } @@ -1162,8 +1163,8 @@ std::optional<SubresourceBase> FindSubresource(const ImageInfo& candidate, const } bool IsSubresource(const ImageInfo& candidate, const ImageBase& image, GPUVAddr candidate_addr, - RelaxedOptions options) { - return FindSubresource(candidate, image, candidate_addr, options).has_value(); + RelaxedOptions options, bool broken_views) { + return FindSubresource(candidate, image, candidate_addr, options, broken_views).has_value(); } void DeduceBlitImages(ImageInfo& dst_info, ImageInfo& src_info, const ImageBase* dst, |
