瀏覽代碼

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).
Lioncash 6 年之前
父節點
當前提交
67df3f7742
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/video_core/renderer_opengl/gl_shader_decompiler.cpp

+ 1 - 1
src/video_core/renderer_opengl/gl_shader_decompiler.cpp

@@ -2246,7 +2246,7 @@ private:
         code.AddLine("#ifdef SAMPLER_{}_IS_BUFFER", sampler.GetIndex());
         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);
         return fmt::format("{}_{}_{}", name, index, suffix);
     }
     }