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/Resources/ShaderResource.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/Resources/ShaderResource.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Resources/ShaderResource.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
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); |
