mirror of
https://github.com/citra-mirror/citra.git
synced 2024-08-20 02:13:23 +02:00
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:
parent
de140a5870
commit
df97021f55
@ -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));
|
||||
|
||||
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.";
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user