diff options
| author | Martino Fontana <tinozzo123@gmail.com> | 2026-04-06 11:37:26 +0200 |
|---|---|---|
| committer | Martino Fontana <tinozzo123@gmail.com> | 2026-04-17 12:39:46 +0200 |
| commit | 95dec132030e72b74da6bc46966e4fe5e4e239c0 (patch) | |
| tree | f4340655ebc036425e69048651ee49dec16ddc12 /Source/Core/VideoCommon/ShaderCache.cpp | |
| parent | 33f62b0f9f36a3dfccc3ecfc13358899d0cc8036 (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/ShaderCache.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/ShaderCache.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
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. |
