From 95dec132030e72b74da6bc46966e4fe5e4e239c0 Mon Sep 17 00:00:00 2001 From: Martino Fontana Date: Mon, 6 Apr 2026 11:37:26 +0200 Subject: 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. --- Source/Core/VideoCommon/ShaderCache.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Source/Core/VideoCommon/ShaderCache.cpp') 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 + #include #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. -- cgit v1.2.3