From 67df3f7742187abb34d9a2eb4633334331c3318e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 15 Oct 2019 19:00:20 -0400 Subject: gl_shader_decompiler: Use a std::string_view with GetDeclarationWithSuffix() This allows the function to be completely non-allocating for inputs of all sizes (i.e. there's no heap cost for an input to convert to a std::string_view). --- src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index bd0c5c5d6..2c50ed538 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -2246,7 +2246,7 @@ private: code.AddLine("#ifdef SAMPLER_{}_IS_BUFFER", sampler.GetIndex()); } - std::string GetDeclarationWithSuffix(u32 index, const std::string& name) const { + std::string GetDeclarationWithSuffix(u32 index, std::string_view name) const { return fmt::format("{}_{}_{}", name, index, suffix); } -- cgit v1.2.3