Skip to content

Commit

Permalink
mangoapp: fix deviceID for nvidia GPUs
Browse files Browse the repository at this point in the history
  • Loading branch information
flightlessmango committed Jun 20, 2024
1 parent 41b8761 commit 9cb5a40
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,13 @@ int main(int, char**)
window_size = ImVec2(params.width, params.height);
deviceName = (char*)glGetString(GL_RENDERER);
sw_stats.deviceName = deviceName;

SPDLOG_DEBUG("mangoapp deviceName: {}", deviceName);
#define GLX_RENDERER_VENDOR_ID_MESA 0x8183
auto pfn_glXQueryCurrentRendererIntegerMESA = (Bool (*)(int, unsigned int*)) (glfwGetProcAddress("glXQueryCurrentRendererIntegerMESA"));
if (pfn_glXQueryCurrentRendererIntegerMESA) {
// This will return 0x0 vendorID on NVIDIA so just go to else
if (pfn_glXQueryCurrentRendererIntegerMESA && vendorID != 0x0) {
pfn_glXQueryCurrentRendererIntegerMESA(GLX_RENDERER_VENDOR_ID_MESA, &vendorID);
SPDLOG_DEBUG("mangoapp vendorID: {:#x}", vendorID);
} else {
if (deviceName.find("Radeon") != std::string::npos
|| deviceName.find("AMD") != std::string::npos){
Expand Down

0 comments on commit 9cb5a40

Please sign in to comment.