Просмотр исходного кода

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 лет назад
Родитель
Сommit
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());
     }
 
-    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);
     }