From 856f576c05f378e524f633b04f1e0a63bab6cea7 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 2 Feb 2022 14:05:55 -0500 Subject: [PATCH 1/3] texture_cache: Amend unintended bitwise OR in SynchronizeAliases --- src/video_core/texture_cache/texture_cache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 198bb0cfb..bc45720b6 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -1725,7 +1725,7 @@ void TextureCache

::SynchronizeAliases(ImageId image_id) { }); const auto& resolution = Settings::values.resolution_info; for (const AliasedImage* const aliased : aliased_images) { - if (!resolution.active | !any_rescaled) { + if (!resolution.active || !any_rescaled) { CopyImage(image_id, aliased->id, aliased->copies); continue; } From 7367e55d1de57cb3f728085cbd0b3393a369150e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 2 Feb 2022 14:10:06 -0500 Subject: [PATCH 2/3] texture_cache: Remove dead code within SynchronizeAliases Since these were being copied by value, none of the changes applied in the loop would be reflected. However, from the looks of it, this would already be applied within CopyImage() anyways, so this can be removed. --- src/video_core/texture_cache/texture_cache.h | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index bc45720b6..d57c0c41a 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -1736,19 +1736,7 @@ void TextureCache

::SynchronizeAliases(ImageId image_id) { continue; } ScaleUp(aliased_image); - - const bool both_2d{image.info.type == ImageType::e2D && - aliased_image.info.type == ImageType::e2D}; - auto copies = aliased->copies; - for (auto copy : copies) { - copy.extent.width = std::max( - (copy.extent.width * resolution.up_scale) >> resolution.down_shift, 1); - if (both_2d) { - copy.extent.height = std::max( - (copy.extent.height * resolution.up_scale) >> resolution.down_shift, 1); - } - } - CopyImage(image_id, aliased->id, copies); + CopyImage(image_id, aliased->id, aliased->copies); } } From e015dc82646091c91f10b59f40eb5b76e26a2046 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 2 Feb 2022 14:12:31 -0500 Subject: [PATCH 3/3] texture_cache: Ensure has_blacklisted is always initialized Resolves a -Wmaybe_uninitialized warning --- src/video_core/texture_cache/texture_cache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index d57c0c41a..72eeb8bbd 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -343,7 +343,7 @@ template void TextureCache

::FillImageViews(DescriptorTable& table, std::span cached_image_view_ids, std::span views) { - bool has_blacklisted; + bool has_blacklisted = false; do { has_deleted_images = false; if constexpr (has_blacklists) {