mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2025-06-13 08:08:17 -05:00
texture_cache: Blacklist BGRA8 copies and views on OpenGL
In order to force the BGRA8 conversion on Nvidia using OpenGL, we need to forbid texture copies and views with other formats. This commit also adds a boolean relating to this, as this needs to be done only for the OpenGL api, Vulkan must remain unchanged.
This commit is contained in:
@ -1035,13 +1035,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 broken_views) {
|
||||
bool strict_size, bool broken_views, bool native_bgr) {
|
||||
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, broken_views)) {
|
||||
if (!IsViewCompatible(overlap.info.format, new_info.format, broken_views, native_bgr)) {
|
||||
return std::nullopt;
|
||||
}
|
||||
if (gpu_addr == overlap.gpu_addr) {
|
||||
@ -1085,14 +1085,14 @@ bool IsLayerStrideCompatible(const ImageInfo& lhs, const ImageInfo& rhs) {
|
||||
|
||||
std::optional<SubresourceBase> FindSubresource(const ImageInfo& candidate, const ImageBase& image,
|
||||
GPUVAddr candidate_addr, RelaxedOptions options,
|
||||
bool broken_views) {
|
||||
bool broken_views, bool native_bgr) {
|
||||
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, broken_views)) {
|
||||
if (!IsViewCompatible(existing.format, candidate.format, broken_views, native_bgr)) {
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
@ -1129,8 +1129,9 @@ std::optional<SubresourceBase> FindSubresource(const ImageInfo& candidate, const
|
||||
}
|
||||
|
||||
bool IsSubresource(const ImageInfo& candidate, const ImageBase& image, GPUVAddr candidate_addr,
|
||||
RelaxedOptions options, bool broken_views) {
|
||||
return FindSubresource(candidate, image, candidate_addr, options, broken_views).has_value();
|
||||
RelaxedOptions options, bool broken_views, bool native_bgr) {
|
||||
return FindSubresource(candidate, image, candidate_addr, options, broken_views, native_bgr)
|
||||
.has_value();
|
||||
}
|
||||
|
||||
void DeduceBlitImages(ImageInfo& dst_info, ImageInfo& src_info, const ImageBase* dst,
|
||||
|
Reference in New Issue
Block a user