From eadd21a25c4cf53742bcb81f16e6bd41cfc616c7 Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Tue, 15 Jun 2021 06:42:12 +0200 Subject: [PATCH] early-access version 1788 --- README.md | 2 +- src/core/hle/service/lm/lm.cpp | 47 ++++++++++++--------------- src/video_core/texture_cache/util.cpp | 10 +++++- 3 files changed, 30 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 9b86fa4b3..daab71b55 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 1787. +This is the source code for early-access 1788. ## Legal Notice diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp index 311e4fb2d..794504314 100755 --- a/src/core/hle/service/lm/lm.cpp +++ b/src/core/hle/service/lm/lm.cpp @@ -51,6 +51,24 @@ struct hash { } // namespace std namespace Service::LM { +namespace { +std::string_view NameOf(LogSeverity severity) { + switch (severity) { + case LogSeverity::Trace: + return "TRACE"; + case LogSeverity::Info: + return "INFO"; + case LogSeverity::Warning: + return "WARNING"; + case LogSeverity::Error: + return "ERROR"; + case LogSeverity::Fatal: + return "FATAL"; + default: + return "UNKNOWN"; + } +} +} // Anonymous namespace enum class LogDestination : u32 { TargetManager = 1 << 0, @@ -262,33 +280,8 @@ private: if (text_log) { output_log += fmt::format("Log Text: {}\n", *text_log); } - - switch (entry.severity) { - case LogSeverity::Trace: - LOG_DEBUG(Service_LM, "LogManager TRACE ({}):\n{}", DestinationToString(destination), - output_log); - break; - case LogSeverity::Info: - LOG_INFO(Service_LM, "LogManager INFO ({}):\n{}", DestinationToString(destination), - output_log); - break; - case LogSeverity::Warning: - LOG_WARNING(Service_LM, "LogManager WARNING ({}):\n{}", - DestinationToString(destination), output_log); - break; - case LogSeverity::Error: - LOG_ERROR(Service_LM, "LogManager ERROR ({}):\n{}", DestinationToString(destination), - output_log); - break; - case LogSeverity::Fatal: - LOG_CRITICAL(Service_LM, "LogManager FATAL ({}):\n{}", DestinationToString(destination), - output_log); - break; - default: - LOG_CRITICAL(Service_LM, "LogManager UNKNOWN ({}):\n{}", - DestinationToString(destination), output_log); - break; - } + LOG_DEBUG(Service_LM, "LogManager {} ({}):\n{}", NameOf(entry.severity), + DestinationToString(destination), output_log); } static std::string DestinationToString(LogDestination destination) { diff --git a/src/video_core/texture_cache/util.cpp b/src/video_core/texture_cache/util.cpp index 9680167ee..4efe042b6 100755 --- a/src/video_core/texture_cache/util.cpp +++ b/src/video_core/texture_cache/util.cpp @@ -1098,7 +1098,15 @@ std::optional FindSubresource(const ImageInfo& candidate, const return std::nullopt; } const ImageInfo& existing = image.info; - if (False(options & RelaxedOptions::Format)) { + if (True(options & RelaxedOptions::Format)) { + // Format checking is relaxed, but we still have to check for matching bytes per block. + // This avoids creating a view for blits on UE4 titles where formats with different bytes + // per block are aliased. + if (BytesPerBlock(existing.format) != BytesPerBlock(candidate.format)) { + return std::nullopt; + } + } else { + // Format comaptibility is not relaxed, ensure we are creating a view on a compatible format if (!IsViewCompatible(existing.format, candidate.format, broken_views, native_bgr)) { return std::nullopt; }