summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/common/alignment.h10
-rw-r--r--src/core/hle/service/bcat/backend/backend.cpp9
-rw-r--r--src/core/hle/service/bcat/backend/backend.h11
-rw-r--r--src/core/hle/service/bcat/backend/boxcat.cpp3
-rw-r--r--src/core/hle/service/bcat/module.cpp6
-rw-r--r--src/video_core/renderer_opengl/gl_shader_disk_cache.cpp28
-rw-r--r--src/video_core/renderer_opengl/gl_shader_disk_cache.h5
-rw-r--r--src/yuzu/main.cpp4
8 files changed, 46 insertions, 30 deletions
diff --git a/src/common/alignment.h b/src/common/alignment.h
index 88d5d3a65..cdd4833f8 100644
--- a/src/common/alignment.h
+++ b/src/common/alignment.h
@@ -51,7 +51,17 @@ public:
using reference = T&;
using const_reference = const T&;
+ using propagate_on_container_copy_assignment = std::true_type;
+ using propagate_on_container_move_assignment = std::true_type;
+ using propagate_on_container_swap = std::true_type;
+ using is_always_equal = std::true_type;
+
public:
+ constexpr AlignmentAllocator() noexcept = default;
+
+ template <typename T2>
+ constexpr AlignmentAllocator(const AlignmentAllocator<T2, Align>&) noexcept {}
+
pointer address(reference r) noexcept {
return std::addressof(r);
}
diff --git a/src/core/hle/service/bcat/backend/backend.cpp b/src/core/hle/service/bcat/backend/backend.cpp
index 9b677debe..9d6946bc5 100644
--- a/src/core/hle/service/bcat/backend/backend.cpp
+++ b/src/core/hle/service/bcat/backend/backend.cpp
@@ -10,13 +10,14 @@
namespace Service::BCAT {
-ProgressServiceBackend::ProgressServiceBackend(std::string event_name) : impl{} {
+ProgressServiceBackend::ProgressServiceBackend(std::string_view event_name) {
auto& kernel{Core::System::GetInstance().Kernel()};
event = Kernel::WritableEvent::CreateEventPair(
- kernel, Kernel::ResetType::Automatic, "ProgressServiceBackend:UpdateEvent:" + event_name);
+ kernel, Kernel::ResetType::Automatic,
+ std::string("ProgressServiceBackend:UpdateEvent:").append(event_name));
}
-Kernel::SharedPtr<Kernel::ReadableEvent> ProgressServiceBackend::GetEvent() {
+Kernel::SharedPtr<Kernel::ReadableEvent> ProgressServiceBackend::GetEvent() const {
return event.readable;
}
@@ -95,7 +96,7 @@ Backend::Backend(DirectoryGetter getter) : dir_getter(std::move(getter)) {}
Backend::~Backend() = default;
-NullBackend::NullBackend(const DirectoryGetter& getter) : Backend(std::move(getter)) {}
+NullBackend::NullBackend(DirectoryGetter getter) : Backend(std::move(getter)) {}
NullBackend::~NullBackend() = default;
diff --git a/src/core/hle/service/bcat/backend/backend.h b/src/core/hle/service/bcat/backend/backend.h
index 3f5d8b5dd..51dbd3316 100644
--- a/src/core/hle/service/bcat/backend/backend.h
+++ b/src/core/hle/service/bcat/backend/backend.h
@@ -6,6 +6,9 @@
#include <functional>
#include <optional>
+#include <string>
+#include <string_view>
+
#include "common/common_types.h"
#include "core/file_sys/vfs_types.h"
#include "core/hle/kernel/readable_event.h"
@@ -85,14 +88,14 @@ public:
void FinishDownload(ResultCode result);
private:
- explicit ProgressServiceBackend(std::string event_name);
+ explicit ProgressServiceBackend(std::string_view event_name);
- Kernel::SharedPtr<Kernel::ReadableEvent> GetEvent();
+ Kernel::SharedPtr<Kernel::ReadableEvent> GetEvent() const;
DeliveryCacheProgressImpl& GetImpl();
void SignalUpdate() const;
- DeliveryCacheProgressImpl impl;
+ DeliveryCacheProgressImpl impl{};
Kernel::EventPair event;
bool need_hle_lock = false;
};
@@ -128,7 +131,7 @@ protected:
// A backend of BCAT that provides no operation.
class NullBackend : public Backend {
public:
- explicit NullBackend(const DirectoryGetter& getter);
+ explicit NullBackend(DirectoryGetter getter);
~NullBackend() override;
bool Synchronize(TitleIDVersion title, ProgressServiceBackend& progress) override;
diff --git a/src/core/hle/service/bcat/backend/boxcat.cpp b/src/core/hle/service/bcat/backend/boxcat.cpp
index 0e451e9c2..64022982b 100644
--- a/src/core/hle/service/bcat/backend/boxcat.cpp
+++ b/src/core/hle/service/bcat/backend/boxcat.cpp
@@ -495,7 +495,8 @@ Boxcat::StatusResult Boxcat::GetStatus(std::optional<std::string>& global,
}
return StatusResult::Success;
- } catch (const nlohmann::json::parse_error& e) {
+ } catch (const nlohmann::json::parse_error& error) {
+ LOG_ERROR(Service_BCAT, "{}", error.what());
return StatusResult::ParseError;
}
}
diff --git a/src/core/hle/service/bcat/module.cpp b/src/core/hle/service/bcat/module.cpp
index 8931fb385..4e4aa758b 100644
--- a/src/core/hle/service/bcat/module.cpp
+++ b/src/core/hle/service/bcat/module.cpp
@@ -454,7 +454,7 @@ private:
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
- rb.Push<u32>(write_size * sizeof(DeliveryCacheDirectoryEntry));
+ rb.Push(static_cast<u32>(write_size * sizeof(DeliveryCacheDirectoryEntry)));
}
void GetCount(Kernel::HLERequestContext& ctx) {
@@ -471,7 +471,7 @@ private:
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
- rb.Push<u32>(files.size());
+ rb.Push(static_cast<u32>(files.size()));
}
FileSys::VirtualDir root;
@@ -528,7 +528,7 @@ private:
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
- rb.Push<u32>(size);
+ rb.Push(static_cast<u32>(size));
}
FileSys::VirtualDir root;
diff --git a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp
index 6a7012b54..74cc33476 100644
--- a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp
@@ -112,14 +112,15 @@ std::optional<std::pair<std::vector<ShaderDiskCacheRaw>, std::vector<ShaderDiskC
ShaderDiskCacheOpenGL::LoadTransferable() {
// Skip games without title id
const bool has_title_id = system.CurrentProcess()->GetTitleID() != 0;
- if (!Settings::values.use_disk_shader_cache || !has_title_id)
+ if (!Settings::values.use_disk_shader_cache || !has_title_id) {
return {};
- tried_to_load = true;
+ }
FileUtil::IOFile file(GetTransferablePath(), "rb");
if (!file.IsOpen()) {
LOG_INFO(Render_OpenGL, "No transferable shader cache found for game with title id={}",
GetTitleID());
+ is_usable = true;
return {};
}
@@ -135,6 +136,7 @@ ShaderDiskCacheOpenGL::LoadTransferable() {
LOG_INFO(Render_OpenGL, "Transferable shader cache is old - removing");
file.Close();
InvalidateTransferable();
+ is_usable = true;
return {};
}
if (version > NativeVersion) {
@@ -180,13 +182,15 @@ ShaderDiskCacheOpenGL::LoadTransferable() {
}
}
- return {{raws, usages}};
+ is_usable = true;
+ return {{std::move(raws), std::move(usages)}};
}
std::pair<std::unordered_map<u64, ShaderDiskCacheDecompiled>, ShaderDumpsMap>
ShaderDiskCacheOpenGL::LoadPrecompiled() {
- if (!IsUsable())
+ if (!is_usable) {
return {};
+ }
FileUtil::IOFile file(GetPrecompiledPath(), "rb");
if (!file.IsOpen()) {
@@ -479,8 +483,9 @@ void ShaderDiskCacheOpenGL::InvalidatePrecompiled() {
}
void ShaderDiskCacheOpenGL::SaveRaw(const ShaderDiskCacheRaw& entry) {
- if (!IsUsable())
+ if (!is_usable) {
return;
+ }
const u64 id = entry.GetUniqueIdentifier();
if (transferable.find(id) != transferable.end()) {
@@ -501,8 +506,9 @@ void ShaderDiskCacheOpenGL::SaveRaw(const ShaderDiskCacheRaw& entry) {
}
void ShaderDiskCacheOpenGL::SaveUsage(const ShaderDiskCacheUsage& usage) {
- if (!IsUsable())
+ if (!is_usable) {
return;
+ }
const auto it = transferable.find(usage.unique_identifier);
ASSERT_MSG(it != transferable.end(), "Saving shader usage without storing raw previously");
@@ -528,8 +534,9 @@ void ShaderDiskCacheOpenGL::SaveUsage(const ShaderDiskCacheUsage& usage) {
void ShaderDiskCacheOpenGL::SaveDecompiled(u64 unique_identifier, const std::string& code,
const GLShader::ShaderEntries& entries) {
- if (!IsUsable())
+ if (!is_usable) {
return;
+ }
if (precompiled_cache_virtual_file.GetSize() == 0) {
SavePrecompiledHeaderToVirtualPrecompiledCache();
@@ -543,8 +550,9 @@ void ShaderDiskCacheOpenGL::SaveDecompiled(u64 unique_identifier, const std::str
}
void ShaderDiskCacheOpenGL::SaveDump(const ShaderDiskCacheUsage& usage, GLuint program) {
- if (!IsUsable())
+ if (!is_usable) {
return;
+ }
GLint binary_length{};
glGetProgramiv(program, GL_PROGRAM_BINARY_LENGTH, &binary_length);
@@ -565,10 +573,6 @@ void ShaderDiskCacheOpenGL::SaveDump(const ShaderDiskCacheUsage& usage, GLuint p
}
}
-bool ShaderDiskCacheOpenGL::IsUsable() const {
- return tried_to_load && Settings::values.use_disk_shader_cache;
-}
-
FileUtil::IOFile ShaderDiskCacheOpenGL::AppendTransferableFile() const {
if (!EnsureDirectories())
return {};
diff --git a/src/video_core/renderer_opengl/gl_shader_disk_cache.h b/src/video_core/renderer_opengl/gl_shader_disk_cache.h
index cc8bbd61e..9595bd71b 100644
--- a/src/video_core/renderer_opengl/gl_shader_disk_cache.h
+++ b/src/video_core/renderer_opengl/gl_shader_disk_cache.h
@@ -224,9 +224,6 @@ private:
bool SaveDecompiledFile(u64 unique_identifier, const std::string& code,
const GLShader::ShaderEntries& entries);
- /// Returns if the cache can be used
- bool IsUsable() const;
-
/// Opens current game's transferable file and write it's header if it doesn't exist
FileUtil::IOFile AppendTransferableFile() const;
@@ -297,7 +294,7 @@ private:
std::unordered_map<u64, std::unordered_set<ShaderDiskCacheUsage>> transferable;
// The cache has been loaded at boot
- bool tried_to_load{};
+ bool is_usable{};
};
} // namespace OpenGL
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 197e704b4..451e4a4d6 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -1903,10 +1903,10 @@ void GMainWindow::UpdateWindowTitle(const QString& title_name) {
full_name, branch_name, description,
std::string{}, date, build_id)));
} else {
- const auto fmt = std::string(Common::g_title_bar_format_idle);
+ const auto fmt = std::string(Common::g_title_bar_format_running);
setWindowTitle(QString::fromStdString(
fmt::format(fmt.empty() ? "yuzu {0}| {3} | {1}-{2}" : fmt, full_name, branch_name,
- description, std::string{}, date, build_id)));
+ description, title_name.toStdString(), date, build_id)));
}
}