summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authorMartino Fontana <tinozzo123@gmail.com>2026-04-06 11:37:26 +0200
committerMartino Fontana <tinozzo123@gmail.com>2026-04-17 12:39:46 +0200
commit95dec132030e72b74da6bc46966e4fe5e4e239c0 (patch)
treef4340655ebc036425e69048651ee49dec16ddc12 /Source/Core/VideoCommon
parent33f62b0f9f36a3dfccc3ecfc13358899d0cc8036 (diff)
Improve usage of std::move and const references parameters
Accomplished using `run-clang-tidy` with `performance-move-const-arg,performance-unnecessary-value-param,modernize-pass-by-value`. Changed arguments to const references, removed them where inappropriate (e.g. sink parameters). Same with std::move. Manually reviewed each change to make sure that it makes sense, and do something more appropriate if possible.
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/Assets/CustomAsset.cpp4
-rw-r--r--Source/Core/VideoCommon/Assets/CustomAsset.h4
-rw-r--r--Source/Core/VideoCommon/Assets/ShaderAsset.cpp4
-rw-r--r--Source/Core/VideoCommon/GraphicsModSystem/Runtime/CustomPipeline.cpp3
-rw-r--r--Source/Core/VideoCommon/GraphicsModSystem/Runtime/CustomPipeline.h2
-rw-r--r--Source/Core/VideoCommon/GraphicsModSystem/Runtime/CustomShaderCache.cpp32
-rw-r--r--Source/Core/VideoCommon/GraphicsModSystem/Runtime/GraphicsModManager.cpp25
-rw-r--r--Source/Core/VideoCommon/NetPlayGolfUI.cpp6
-rw-r--r--Source/Core/VideoCommon/NetPlayGolfUI.h2
-rw-r--r--Source/Core/VideoCommon/OnScreenDisplay.cpp4
-rw-r--r--Source/Core/VideoCommon/PerformanceTracker.cpp5
-rw-r--r--Source/Core/VideoCommon/PerformanceTracker.h2
-rw-r--r--Source/Core/VideoCommon/Resources/MaterialResource.cpp6
-rw-r--r--Source/Core/VideoCommon/Resources/MaterialResource.h2
-rw-r--r--Source/Core/VideoCommon/Resources/ShaderResource.cpp7
-rw-r--r--Source/Core/VideoCommon/Resources/ShaderResource.h3
-rw-r--r--Source/Core/VideoCommon/ShaderCache.cpp10
-rw-r--r--Source/Core/VideoCommon/ShaderCompileUtils.cpp5
-rw-r--r--Source/Core/VideoCommon/ShaderCompileUtils.h2
-rw-r--r--Source/Core/VideoCommon/TextureCacheBase.cpp2
20 files changed, 69 insertions, 61 deletions
diff --git a/Source/Core/VideoCommon/Assets/CustomAsset.cpp b/Source/Core/VideoCommon/Assets/CustomAsset.cpp
index 7e2e817d15..c01fb3b689 100644
--- a/Source/Core/VideoCommon/Assets/CustomAsset.cpp
+++ b/Source/Core/VideoCommon/Assets/CustomAsset.cpp
@@ -8,8 +8,8 @@
namespace VideoCommon
{
CustomAsset::CustomAsset(std::shared_ptr<CustomAssetLibrary> library,
- const CustomAssetLibrary::AssetID& asset_id, u64 asset_handle)
- : m_owning_library(std::move(library)), m_asset_id(asset_id), m_handle(asset_handle)
+ CustomAssetLibrary::AssetID asset_id, u64 asset_handle)
+ : m_owning_library(std::move(library)), m_asset_id(std::move(asset_id)), m_handle(asset_handle)
{
}
diff --git a/Source/Core/VideoCommon/Assets/CustomAsset.h b/Source/Core/VideoCommon/Assets/CustomAsset.h
index cdf5f14e70..6fe25a7fcf 100644
--- a/Source/Core/VideoCommon/Assets/CustomAsset.h
+++ b/Source/Core/VideoCommon/Assets/CustomAsset.h
@@ -20,8 +20,8 @@ public:
using ClockType = std::chrono::steady_clock;
using TimeType = ClockType::time_point;
- CustomAsset(std::shared_ptr<CustomAssetLibrary> library,
- const CustomAssetLibrary::AssetID& asset_id, u64 session_id);
+ CustomAsset(std::shared_ptr<CustomAssetLibrary> library, CustomAssetLibrary::AssetID asset_id,
+ u64 session_id);
virtual ~CustomAsset() = default;
CustomAsset(const CustomAsset&) = delete;
CustomAsset(CustomAsset&&) = delete;
diff --git a/Source/Core/VideoCommon/Assets/ShaderAsset.cpp b/Source/Core/VideoCommon/Assets/ShaderAsset.cpp
index 04a9139212..d6ec53db6d 100644
--- a/Source/Core/VideoCommon/Assets/ShaderAsset.cpp
+++ b/Source/Core/VideoCommon/Assets/ShaderAsset.cpp
@@ -116,7 +116,7 @@ static bool ParseShaderValue(const CustomAssetLibrary::AssetID& asset_id,
ShaderProperty::RGB rgb;
if (!ParseNumeric<float, 3>(asset_id, json_value, code_name, &rgb.value))
return false;
- *value = std::move(rgb);
+ *value = rgb;
return true;
}
else if (type == "rgba")
@@ -124,7 +124,7 @@ static bool ParseShaderValue(const CustomAssetLibrary::AssetID& asset_id,
ShaderProperty::RGBA rgba;
if (!ParseNumeric<float, 4>(asset_id, json_value, code_name, &rgba.value))
return false;
- *value = std::move(rgba);
+ *value = rgba;
return true;
}
else if (type == "bool")
diff --git a/Source/Core/VideoCommon/GraphicsModSystem/Runtime/CustomPipeline.cpp b/Source/Core/VideoCommon/GraphicsModSystem/Runtime/CustomPipeline.cpp
index bb09a84328..df8e07469f 100644
--- a/Source/Core/VideoCommon/GraphicsModSystem/Runtime/CustomPipeline.cpp
+++ b/Source/Core/VideoCommon/GraphicsModSystem/Runtime/CustomPipeline.cpp
@@ -9,8 +9,7 @@
#include "Common/CommonTypes.h"
#include "VideoCommon/Assets/CustomAssetLibrary.h"
-void CustomPipeline::UpdatePixelData(std::shared_ptr<VideoCommon::CustomAssetLibrary>,
- std::span<const u32>,
+void CustomPipeline::UpdatePixelData(const VideoCommon::CustomAssetLibrary*, std::span<const u32>,
const VideoCommon::CustomAssetLibrary::AssetID&)
{
}
diff --git a/Source/Core/VideoCommon/GraphicsModSystem/Runtime/CustomPipeline.h b/Source/Core/VideoCommon/GraphicsModSystem/Runtime/CustomPipeline.h
index 3aa7b6641c..a05a28ea16 100644
--- a/Source/Core/VideoCommon/GraphicsModSystem/Runtime/CustomPipeline.h
+++ b/Source/Core/VideoCommon/GraphicsModSystem/Runtime/CustomPipeline.h
@@ -11,7 +11,7 @@
struct CustomPipeline
{
- void UpdatePixelData(std::shared_ptr<VideoCommon::CustomAssetLibrary> library,
+ void UpdatePixelData(const VideoCommon::CustomAssetLibrary* library,
std::span<const u32> texture_units,
const VideoCommon::CustomAssetLibrary::AssetID& material_to_load);
};
diff --git a/Source/Core/VideoCommon/GraphicsModSystem/Runtime/CustomShaderCache.cpp b/Source/Core/VideoCommon/GraphicsModSystem/Runtime/CustomShaderCache.cpp
index 54b0d786f2..91d4082348 100644
--- a/Source/Core/VideoCommon/GraphicsModSystem/Runtime/CustomShaderCache.cpp
+++ b/Source/Core/VideoCommon/GraphicsModSystem/Runtime/CustomShaderCache.cpp
@@ -3,6 +3,8 @@
#include "VideoCommon/GraphicsModSystem/Runtime/CustomShaderCache.h"
+#include <utility>
+
#include "VideoCommon/AbstractGfx.h"
#include "VideoCommon/VideoConfig.h"
#include "VideoCommon/VideoEvents.h"
@@ -100,11 +102,11 @@ void CustomShaderCache::AsyncCreatePipeline(const VideoCommon::GXPipelineUid& ui
class PipelineWorkItem final : public VideoCommon::AsyncShaderCompiler::WorkItem
{
public:
- PipelineWorkItem(CustomShaderCache* shader_cache, const VideoCommon::GXPipelineUid& uid,
- const CustomShaderInstance& custom_shaders, PipelineIterator iterator,
- const AbstractPipelineConfig& pipeline_config)
- : m_shader_cache(shader_cache), m_uid(uid), m_iterator(iterator), m_config(pipeline_config),
- m_custom_shaders(custom_shaders)
+ PipelineWorkItem(CustomShaderCache* shader_cache, VideoCommon::GXPipelineUid uid,
+ CustomShaderInstance custom_shaders, PipelineIterator iterator,
+ AbstractPipelineConfig pipeline_config)
+ : m_shader_cache(shader_cache), m_uid(std::move(uid)), m_iterator(iterator),
+ m_config(std::move(pipeline_config)), m_custom_shaders(std::move(custom_shaders))
{
SetStagesReady();
}
@@ -184,11 +186,11 @@ void CustomShaderCache::AsyncCreatePipeline(const VideoCommon::GXUberPipelineUid
class PipelineWorkItem final : public VideoCommon::AsyncShaderCompiler::WorkItem
{
public:
- PipelineWorkItem(CustomShaderCache* shader_cache, const VideoCommon::GXUberPipelineUid& uid,
- const CustomShaderInstance& custom_shaders, UberPipelineIterator iterator,
- const AbstractPipelineConfig& pipeline_config)
- : m_shader_cache(shader_cache), m_uid(uid), m_iterator(iterator), m_config(pipeline_config),
- m_custom_shaders(custom_shaders)
+ PipelineWorkItem(CustomShaderCache* shader_cache, VideoCommon::GXUberPipelineUid uid,
+ CustomShaderInstance custom_shaders, UberPipelineIterator iterator,
+ AbstractPipelineConfig pipeline_config)
+ : m_shader_cache(shader_cache), m_uid(std::move(uid)), m_iterator(iterator),
+ m_config(std::move(pipeline_config)), m_custom_shaders(std::move(custom_shaders))
{
SetStagesReady();
}
@@ -281,8 +283,9 @@ void CustomShaderCache::QueuePixelShaderCompile(const PixelShaderUid& uid,
{
public:
PixelShaderWorkItem(CustomShaderCache* shader_cache, const PixelShaderUid& uid,
- const CustomShaderInstance& custom_shaders, PixelShaderIterator iter)
- : m_shader_cache(shader_cache), m_uid(uid), m_custom_shaders(custom_shaders), m_iter(iter)
+ CustomShaderInstance custom_shaders, PixelShaderIterator iter)
+ : m_shader_cache(shader_cache), m_uid(uid), m_custom_shaders(std::move(custom_shaders)),
+ m_iter(iter)
{
}
@@ -319,8 +322,9 @@ void CustomShaderCache::QueuePixelShaderCompile(const UberShader::PixelShaderUid
{
public:
PixelShaderWorkItem(CustomShaderCache* shader_cache, const UberShader::PixelShaderUid& uid,
- const CustomShaderInstance& custom_shaders, UberPixelShaderIterator iter)
- : m_shader_cache(shader_cache), m_uid(uid), m_custom_shaders(custom_shaders), m_iter(iter)
+ CustomShaderInstance custom_shaders, UberPixelShaderIterator iter)
+ : m_shader_cache(shader_cache), m_uid(uid), m_custom_shaders(std::move(custom_shaders)),
+ m_iter(iter)
{
}
diff --git a/Source/Core/VideoCommon/GraphicsModSystem/Runtime/GraphicsModManager.cpp b/Source/Core/VideoCommon/GraphicsModSystem/Runtime/GraphicsModManager.cpp
index 5f9cf48d52..c49b655804 100644
--- a/Source/Core/VideoCommon/GraphicsModSystem/Runtime/GraphicsModManager.cpp
+++ b/Source/Core/VideoCommon/GraphicsModSystem/Runtime/GraphicsModManager.cpp
@@ -247,23 +247,22 @@ void GraphicsModManager::Load(const GraphicsModGroupConfig& config)
}
}
+ const auto create_action =
+ [filesystem_library = std::move(filesystem_library)](
+ const std::string_view& action_name, const picojson::value& json_data,
+ GraphicsModConfig mod_config) -> std::unique_ptr<GraphicsModAction> {
+ auto action = GraphicsModActionFactory::Create(action_name, json_data, filesystem_library);
+ if (action == nullptr)
+ {
+ return nullptr;
+ }
+ return std::make_unique<DecoratedAction>(std::move(action), std::move(mod_config));
+ };
+
for (const auto& mod : mods)
{
for (const GraphicsModFeatureConfig& feature : mod.m_features)
{
- const auto create_action =
- [filesystem_library](const std::string_view& action_name,
- const picojson::value& json_data,
- GraphicsModConfig mod_config) -> std::unique_ptr<GraphicsModAction> {
- auto action =
- GraphicsModActionFactory::Create(action_name, json_data, std::move(filesystem_library));
- if (action == nullptr)
- {
- return nullptr;
- }
- return std::make_unique<DecoratedAction>(std::move(action), std::move(mod_config));
- };
-
const auto internal_group = fmt::format("{}.{}", mod.m_title, feature.m_group);
const auto add_target = [&](const GraphicsTargetConfig& target) {
diff --git a/Source/Core/VideoCommon/NetPlayGolfUI.cpp b/Source/Core/VideoCommon/NetPlayGolfUI.cpp
index d8ada720ad..87b866b348 100644
--- a/Source/Core/VideoCommon/NetPlayGolfUI.cpp
+++ b/Source/Core/VideoCommon/NetPlayGolfUI.cpp
@@ -3,6 +3,8 @@
#include "VideoCommon/NetPlayGolfUI.h"
+#include <utility>
+
#include <fmt/format.h>
#include <imgui.h>
@@ -13,8 +15,8 @@ constexpr float DEFAULT_WINDOW_HEIGHT = 45.0f;
std::unique_ptr<NetPlayGolfUI> g_netplay_golf_ui;
-NetPlayGolfUI::NetPlayGolfUI(std::shared_ptr<NetPlay::NetPlayClient> netplay_client)
- : m_netplay_client{netplay_client}
+NetPlayGolfUI::NetPlayGolfUI(std::weak_ptr<NetPlay::NetPlayClient> netplay_client)
+ : m_netplay_client{std::move(netplay_client)}
{
}
diff --git a/Source/Core/VideoCommon/NetPlayGolfUI.h b/Source/Core/VideoCommon/NetPlayGolfUI.h
index d8d69ffe66..fc815a75e9 100644
--- a/Source/Core/VideoCommon/NetPlayGolfUI.h
+++ b/Source/Core/VideoCommon/NetPlayGolfUI.h
@@ -13,7 +13,7 @@ class NetPlayClient;
class NetPlayGolfUI
{
public:
- explicit NetPlayGolfUI(std::shared_ptr<NetPlay::NetPlayClient> netplay_client);
+ explicit NetPlayGolfUI(std::weak_ptr<NetPlay::NetPlayClient> netplay_client);
~NetPlayGolfUI();
void Display();
diff --git a/Source/Core/VideoCommon/OnScreenDisplay.cpp b/Source/Core/VideoCommon/OnScreenDisplay.cpp
index 6f42879c34..8ab5463d3d 100644
--- a/Source/Core/VideoCommon/OnScreenDisplay.cpp
+++ b/Source/Core/VideoCommon/OnScreenDisplay.cpp
@@ -142,14 +142,14 @@ void AddTypedMessage(MessageType type, std::string message, u32 ms, u32 argb,
for (auto it = range.first; it != range.second; ++it)
it->second.should_discard = true;
- s_messages.emplace(type, Message(std::move(message), ms, argb, std::move(icon)));
+ s_messages.emplace(type, Message(std::move(message), ms, argb, icon));
}
void AddMessage(std::string message, u32 ms, u32 argb,
const VideoCommon::CustomTextureData::ArraySlice::Level* icon)
{
std::lock_guard lock{s_messages_mutex};
- s_messages.emplace(MessageType::Typeless, Message(std::move(message), ms, argb, std::move(icon)));
+ s_messages.emplace(MessageType::Typeless, Message(std::move(message), ms, argb, icon));
}
void DrawMessages()
diff --git a/Source/Core/VideoCommon/PerformanceTracker.cpp b/Source/Core/VideoCommon/PerformanceTracker.cpp
index 725d6b26e3..3d519865be 100644
--- a/Source/Core/VideoCommon/PerformanceTracker.cpp
+++ b/Source/Core/VideoCommon/PerformanceTracker.cpp
@@ -6,6 +6,7 @@
#include <algorithm>
#include <cmath>
#include <iomanip>
+#include <utility>
#include <implot.h>
@@ -18,9 +19,9 @@ static constexpr double SAMPLE_RC_RATIO = 0.25;
static constexpr u64 MAX_DT_QUEUE_SIZE = 1UL << 12;
static constexpr u64 MAX_QUALITY_GRAPH_SIZE = 1UL << 8;
-PerformanceTracker::PerformanceTracker(const std::optional<std::string> log_name,
+PerformanceTracker::PerformanceTracker(std::optional<std::string> log_name,
const std::optional<DT> sample_window_duration)
- : m_log_name{log_name}, m_sample_window_duration{sample_window_duration}
+ : m_log_name{std::move(log_name)}, m_sample_window_duration{sample_window_duration}
{
Reset();
}
diff --git a/Source/Core/VideoCommon/PerformanceTracker.h b/Source/Core/VideoCommon/PerformanceTracker.h
index 358de676b4..e210a8497c 100644
--- a/Source/Core/VideoCommon/PerformanceTracker.h
+++ b/Source/Core/VideoCommon/PerformanceTracker.h
@@ -14,7 +14,7 @@
class PerformanceTracker
{
public:
- PerformanceTracker(const std::optional<std::string> log_name = std::nullopt,
+ PerformanceTracker(std::optional<std::string> log_name = std::nullopt,
const std::optional<DT> sample_window_duration = std::nullopt);
~PerformanceTracker() = default;
diff --git a/Source/Core/VideoCommon/Resources/MaterialResource.cpp b/Source/Core/VideoCommon/Resources/MaterialResource.cpp
index d41937d992..ea96cdf5f6 100644
--- a/Source/Core/VideoCommon/Resources/MaterialResource.cpp
+++ b/Source/Core/VideoCommon/Resources/MaterialResource.cpp
@@ -62,8 +62,8 @@ MaterialResource::MaterialResource(Resource::ResourceContext resource_context)
}
MaterialResource::MaterialResource(Resource::ResourceContext resource_context,
- const GXPipelineUid& pipeline_uid)
- : Resource(std::move(resource_context)), m_uid(pipeline_uid)
+ GXPipelineUid pipeline_uid)
+ : Resource(std::move(resource_context)), m_uid(std::move(pipeline_uid))
{
m_material_asset = m_resource_context.asset_cache->CreateAsset<MaterialAsset>(
m_resource_context.primary_asset_id, m_resource_context.asset_library, this);
@@ -221,7 +221,7 @@ Resource::TaskComplete MaterialResource::ProcessData()
VideoCommon::GXPipelineUid* uid, FramebufferState frame_buffer_state)
: m_material_resource_data(std::move(material_resource_data)),
m_shader_resource_data(std::move(shader_resource_data)), m_uid(uid),
- m_frame_buffer_state(frame_buffer_state)
+ m_frame_buffer_state(std::move(frame_buffer_state))
{
}
diff --git a/Source/Core/VideoCommon/Resources/MaterialResource.h b/Source/Core/VideoCommon/Resources/MaterialResource.h
index 6f4835927f..9729039d43 100644
--- a/Source/Core/VideoCommon/Resources/MaterialResource.h
+++ b/Source/Core/VideoCommon/Resources/MaterialResource.h
@@ -29,7 +29,7 @@ class MaterialResource final : public Resource
{
public:
explicit MaterialResource(Resource::ResourceContext resource_context);
- MaterialResource(Resource::ResourceContext resource_context, const GXPipelineUid& pipeline_uid);
+ MaterialResource(Resource::ResourceContext resource_context, GXPipelineUid pipeline_uid);
struct TextureLikeReference
{
diff --git a/Source/Core/VideoCommon/Resources/ShaderResource.cpp b/Source/Core/VideoCommon/Resources/ShaderResource.cpp
index 08aa994055..7b77886e2e 100644
--- a/Source/Core/VideoCommon/Resources/ShaderResource.cpp
+++ b/Source/Core/VideoCommon/Resources/ShaderResource.cpp
@@ -4,6 +4,7 @@
#include "VideoCommon/Resources/ShaderResource.h"
#include <string_view>
+#include <utility>
#include <fmt/format.h>
@@ -382,11 +383,11 @@ CompileVertexShader(VertexShaderUid* uid, std::string_view preprocessor_settings
}
} // namespace
ShaderResource::ShaderResource(Resource::ResourceContext resource_context,
- const std::optional<GXPipelineUid>& pipeline_uid,
- const std::string& preprocessor_setting,
+ std::optional<GXPipelineUid> pipeline_uid,
+ std::string preprocessor_setting,
const ShaderHostConfig& shader_host_config)
: Resource(std::move(resource_context)), m_shader_host_config{.bits = shader_host_config.bits},
- m_uid(pipeline_uid), m_preprocessor_settings(preprocessor_setting)
+ m_uid(std::move(pipeline_uid)), m_preprocessor_settings(std::move(preprocessor_setting))
{
m_shader_asset = m_resource_context.asset_cache->CreateAsset<RasterSurfaceShaderAsset>(
m_resource_context.primary_asset_id, m_resource_context.asset_library, this);
diff --git a/Source/Core/VideoCommon/Resources/ShaderResource.h b/Source/Core/VideoCommon/Resources/ShaderResource.h
index 2f35087aab..1e59a1b11d 100644
--- a/Source/Core/VideoCommon/Resources/ShaderResource.h
+++ b/Source/Core/VideoCommon/Resources/ShaderResource.h
@@ -18,8 +18,7 @@ class ShaderResource final : public Resource
{
public:
ShaderResource(Resource::ResourceContext resource_context,
- const std::optional<GXPipelineUid>& pipeline_uid,
- const std::string& preprocessor_settings,
+ std::optional<GXPipelineUid> pipeline_uid, std::string preprocessor_setting,
const ShaderHostConfig& shader_host_config);
class Data
diff --git a/Source/Core/VideoCommon/ShaderCache.cpp b/Source/Core/VideoCommon/ShaderCache.cpp
index 22a5437046..2627656d0d 100644
--- a/Source/Core/VideoCommon/ShaderCache.cpp
+++ b/Source/Core/VideoCommon/ShaderCache.cpp
@@ -3,6 +3,8 @@
#include "VideoCommon/ShaderCache.h"
+#include <utility>
+
#include <fmt/format.h>
#include "Common/Assert.h"
@@ -1018,8 +1020,8 @@ void ShaderCache::QueuePipelineCompile(const GXPipelineUid& uid, u32 priority)
class PipelineWorkItem final : public AsyncShaderCompiler::WorkItem
{
public:
- PipelineWorkItem(ShaderCache* shader_cache_, const GXPipelineUid& uid_, u32 priority_)
- : shader_cache(shader_cache_), uid(uid_), priority(priority_)
+ PipelineWorkItem(ShaderCache* shader_cache_, GXPipelineUid uid_, u32 priority_)
+ : shader_cache(shader_cache_), uid(std::move(uid_)), priority(priority_)
{
// Check if all the stages required for this pipeline have been compiled.
// If not, this work item becomes a no-op, and re-queues the pipeline for the next frame.
@@ -1090,8 +1092,8 @@ void ShaderCache::QueueUberPipelineCompile(const GXUberPipelineUid& uid, u32 pri
class UberPipelineWorkItem final : public AsyncShaderCompiler::WorkItem
{
public:
- UberPipelineWorkItem(ShaderCache* shader_cache_, const GXUberPipelineUid& uid_, u32 priority_)
- : shader_cache(shader_cache_), uid(uid_), priority(priority_)
+ UberPipelineWorkItem(ShaderCache* shader_cache_, GXUberPipelineUid uid_, u32 priority_)
+ : shader_cache(shader_cache_), uid(std::move(uid_)), priority(priority_)
{
// Check if all the stages required for this UberPipeline have been compiled.
// If not, this work item becomes a no-op, and re-queues the UberPipeline for the next frame.
diff --git a/Source/Core/VideoCommon/ShaderCompileUtils.cpp b/Source/Core/VideoCommon/ShaderCompileUtils.cpp
index 297d86ea92..ee4adbf46e 100644
--- a/Source/Core/VideoCommon/ShaderCompileUtils.cpp
+++ b/Source/Core/VideoCommon/ShaderCompileUtils.cpp
@@ -4,14 +4,15 @@
#include "VideoCommon/ShaderCompileUtils.h"
#include <ranges>
+#include <utility>
#include "Common/FileUtil.h"
#include "Common/StringUtil.h"
namespace VideoCommon
{
-ShaderIncluder::ShaderIncluder(const std::string& user_path, const std::string& system_path)
- : m_root_user_path(user_path), m_root_system_path(system_path)
+ShaderIncluder::ShaderIncluder(std::string user_path, std::string system_path)
+ : m_root_user_path(std::move(user_path)), m_root_system_path(std::move(system_path))
{
}
diff --git a/Source/Core/VideoCommon/ShaderCompileUtils.h b/Source/Core/VideoCommon/ShaderCompileUtils.h
index 0e7c5eed5f..8bccca836c 100644
--- a/Source/Core/VideoCommon/ShaderCompileUtils.h
+++ b/Source/Core/VideoCommon/ShaderCompileUtils.h
@@ -15,7 +15,7 @@ namespace VideoCommon
class ShaderIncluder final : public glslang::TShader::Includer
{
public:
- ShaderIncluder(const std::string& user_path, const std::string& system_path);
+ ShaderIncluder(std::string user_path, std::string system_path);
~ShaderIncluder() override = default;
std::vector<std::string> GetIncludes() const;
diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp
index 6fc13c5fba..8da63bf891 100644
--- a/Source/Core/VideoCommon/TextureCacheBase.cpp
+++ b/Source/Core/VideoCommon/TextureCacheBase.cpp
@@ -657,7 +657,7 @@ void TextureCacheBase::DoSaveState(PointerWrap& p)
}
}
- auto doList = [&p](auto list) {
+ auto doList = [&p](const auto& list) {
u32 list_size = static_cast<u32>(list.size());
p.Do(list_size);
for (const auto& it : list)