Browse Source

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).
pull/15/merge
Lioncash 6 years ago
parent
commit
67df3f7742
  1. 2
      src/video_core/renderer_opengl/gl_shader_decompiler.cpp

2
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);
}

Loading…
Cancel
Save