citra-emu
/
citra-canary
Archived
1
0
Fork 0

gl_rasterizer: Make use of std::string_view in IsVendorAmd()

Same behavior, no heap allocation.

strings returned from glGetString() are guaranteed to be static strings,
so this is safe to do. They're also guaranteed to be null-terminated.
This commit is contained in:
Lioncash 2020-05-01 05:54:47 -04:00
parent de140a5870
commit df97021f55
1 changed files with 1 additions and 1 deletions

View File

@ -40,7 +40,7 @@ MICROPROFILE_DEFINE(OpenGL_Blits, "OpenGL", "Blits", MP_RGB(100, 100, 255));
MICROPROFILE_DEFINE(OpenGL_CacheManagement, "OpenGL", "Cache Mgmt", MP_RGB(100, 255, 100)); MICROPROFILE_DEFINE(OpenGL_CacheManagement, "OpenGL", "Cache Mgmt", MP_RGB(100, 255, 100));
static bool IsVendorAmd() { static bool IsVendorAmd() {
std::string gpu_vendor{reinterpret_cast<char const*>(glGetString(GL_VENDOR))}; const std::string_view gpu_vendor{reinterpret_cast<char const*>(glGetString(GL_VENDOR))};
return gpu_vendor == "ATI Technologies Inc." || gpu_vendor == "Advanced Micro Devices, Inc."; return gpu_vendor == "ATI Technologies Inc." || gpu_vendor == "Advanced Micro Devices, Inc.";
} }