From 1910f5851f8dda9e2c47ad42957ed2ce9a6a11df Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Wed, 21 Aug 2013 05:34:42 -0500 Subject: [PATCH] Make us capable of supporting driver specific issues(OSS versus official) --- Source/Core/VideoCommon/Src/DriverDetails.cpp | 39 ++++++++++++++++--- Source/Core/VideoCommon/Src/DriverDetails.h | 19 ++++++++- Source/Plugins/Plugin_VideoOGL/Src/Render.cpp | 8 ++-- 3 files changed, 56 insertions(+), 10 deletions(-) diff --git a/Source/Core/VideoCommon/Src/DriverDetails.cpp b/Source/Core/VideoCommon/Src/DriverDetails.cpp index 76cf08dce9..85b7d3a47f 100644 --- a/Source/Core/VideoCommon/Src/DriverDetails.cpp +++ b/Source/Core/VideoCommon/Src/DriverDetails.cpp @@ -20,6 +20,7 @@ namespace DriverDetails // Local members Vendor m_vendor = VENDOR_UNKNOWN; + Driver m_driver = DRIVER_UNKNOWN; u32 m_devfamily = 0; double m_version = 0.0; @@ -36,24 +37,52 @@ namespace DriverDetails // Private function void InitBugMap() { - switch(m_vendor) + switch(m_driver) { - case VENDOR_QUALCOMM: + case DRIVER_QUALCOMM: for (unsigned int a = 0; a < (sizeof(m_qualcommbugs) / sizeof(BugInfo)); ++a) m_bugs[std::make_pair(m_vendor, m_qualcommbugs[a].m_bug)] = m_qualcommbugs[a]; break; - case VENDOR_ARM: default: break; } } - void Init(Vendor vendor, const u32 devfamily, const double version) + void Init(Vendor vendor, Driver driver, const u32 devfamily, const double version) { m_vendor = vendor; + m_driver = driver; m_devfamily = devfamily; m_version = version; - InitBugMap(); + InitBugMap(); + if (driver == DRIVER_UNKNOWN) + switch(vendor) + { + case VENDOR_NVIDIA: + case VENDOR_TEGRA: + m_driver = DRIVER_NVIDIA; + break; + case VENDOR_ATI: + m_driver = DRIVER_ATI; + break; + case VENDOR_INTEL: + m_driver = DRIVER_INTEL; + break; + case VENDOR_ARM: + m_driver = DRIVER_ARM; + break; + case VENDOR_QUALCOMM: + m_driver = DRIVER_QUALCOMM; + break; + case VENDOR_IMGTEC: + m_driver = DRIVER_IMGTEC; + break; + case VENDOR_VIVANTE: + m_driver = DRIVER_VIVANTE; + break; + default: + break; + } for (auto it = m_bugs.begin(); it != m_bugs.end(); ++it) if (it->second.m_devfamily == m_devfamily) diff --git a/Source/Core/VideoCommon/Src/DriverDetails.h b/Source/Core/VideoCommon/Src/DriverDetails.h index bfa9c572d0..1a434f695a 100644 --- a/Source/Core/VideoCommon/Src/DriverDetails.h +++ b/Source/Core/VideoCommon/Src/DriverDetails.h @@ -21,6 +21,23 @@ namespace DriverDetails VENDOR_UNKNOWN }; + // Enum of known drivers + enum Driver + { + DRIVER_NVIDIA = 0, // Official Nvidia, including mobile GPU + DRIVER_NOUVEAU, // OSS nouveau + DRIVER_ATI, // Official Nvidia + DRIVER_RADEONHD, // OSS Radeon + DRIVER_INTEL, // Official Intel + DRIVER_ARM, // Official Mali driver + DRIVER_LIMA, // OSS Mali driver + DRIVER_QUALCOMM, // Official Adreno driver + DRIVER_FREEDRENO, // OSS Adreno driver + DRIVER_IMGTEC, // OSS PowerVR driver + DRIVER_VIVANTE, // Official vivante driver + DRIVER_UNKNOWN // Unknown driver, default to official hardware driver + }; + // Enum of known bugs // These can be vendor specific, but we put them all in here // For putting a new bug in here, make sure to put a detailed comment above the enum @@ -55,7 +72,7 @@ namespace DriverDetails }; // Initializes our internal vendor, device family, and driver version - void Init(Vendor vendor, const u32 devfamily, const double version); + void Init(Vendor vendor, Driver driver, const u32 devfamily, const double version); // Once Vendor and driver version is set, this will return if it has the applicable bug passed to it. bool HasBug(Bug bug); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index 126294b857..6bf201c771 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -269,17 +269,17 @@ void GLAPIENTRY ClearDepthf(GLfloat depthval) void InitDriverInfo() { - // Get Vendor std::string svendor = std::string(g_ogl_config.gl_vendor); std::string srenderer = std::string(g_ogl_config.gl_renderer); DriverDetails::Vendor vendor = DriverDetails::VENDOR_UNKNOWN; + DriverDetails::Driver driver = DriverDetails::DRIVER_UNKNOWN; u32 devfamily = 0; double version = 0.0; - // Get Vendor first + // Get the vendor first if (svendor == "NVIDIA Corporation" && srenderer != "NVIDIA Tegra") vendor = DriverDetails::VENDOR_NVIDIA; - else if (svendor == "ATI Technologies Inc.") + else if (svendor == "ATI Technologies Inc." || svendor == "Advanced Micro Devices, Inc.") vendor = DriverDetails::VENDOR_ATI; else if (std::string::npos != svendor.find("Intel")) vendor = DriverDetails::VENDOR_INTEL; @@ -317,7 +317,7 @@ void InitDriverInfo() default: break; } - DriverDetails::Init(vendor, devfamily, version); + DriverDetails::Init(vendor, driver, devfamily, version); } // Init functions