summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2019-10-30 00:32:05 -0300
committerGravatar ReinUsesLisp2019-11-07 01:52:18 -0300
commit028b1a34a99a03babb464834f15d069fe2074d55 (patch)
treeeba28e913bfae87dafe4b325bc60ee489ca1b043 /src
parentgl_rasterizer: Emulate viewport flipping with ARB_clip_control (diff)
downloadyuzu-028b1a34a99a03babb464834f15d069fe2074d55.tar.gz
yuzu-028b1a34a99a03babb464834f15d069fe2074d55.tar.xz
yuzu-028b1a34a99a03babb464834f15d069fe2074d55.zip
yuzu_cmd: Use string_view instead of string for extensions
Avoids potential allocations due to the usage of std::string on strings that we know at compile time. Most of these might fit in SSO, but it adds complexity that can be easily avoided with string views.
Diffstat (limited to 'src')
-rw-r--r--src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp
index 075a7074f..6fde694a2 100644
--- a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp
+++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp
@@ -50,7 +50,7 @@ private:
50}; 50};
51 51
52bool EmuWindow_SDL2_GL::SupportsRequiredGLExtensions() { 52bool EmuWindow_SDL2_GL::SupportsRequiredGLExtensions() {
53 std::vector<std::string> unsupported_ext; 53 std::vector<std::string_view> unsupported_ext;
54 54
55 if (!GLAD_GL_ARB_buffer_storage) 55 if (!GLAD_GL_ARB_buffer_storage)
56 unsupported_ext.push_back("ARB_buffer_storage"); 56 unsupported_ext.push_back("ARB_buffer_storage");
@@ -73,8 +73,8 @@ bool EmuWindow_SDL2_GL::SupportsRequiredGLExtensions() {
73 if (!GLAD_GL_ARB_depth_buffer_float) 73 if (!GLAD_GL_ARB_depth_buffer_float)
74 unsupported_ext.push_back("ARB_depth_buffer_float"); 74 unsupported_ext.push_back("ARB_depth_buffer_float");
75 75
76 for (const std::string& ext : unsupported_ext) 76 for (const auto& extension : unsupported_ext)
77 LOG_CRITICAL(Frontend, "Unsupported GL extension: {}", ext); 77 LOG_CRITICAL(Frontend, "Unsupported GL extension: {}", extension);
78 78
79 return unsupported_ext.empty(); 79 return unsupported_ext.empty();
80} 80}