2013-06-11 13:33:56 +00:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
2015-05-17 23:08:10 +00:00
|
|
|
// Licensed under GPLv2+
|
2013-06-11 13:33:56 +00:00
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
|
2014-06-05 23:29:54 +00:00
|
|
|
#include "Common/Logging/LogManager.h"
|
2014-02-17 10:18:15 +00:00
|
|
|
#include "VideoCommon/DriverDetails.h"
|
2013-06-11 13:33:56 +00:00
|
|
|
|
|
|
|
namespace DriverDetails
|
|
|
|
{
|
|
|
|
struct BugInfo
|
|
|
|
{
|
2013-12-05 15:32:27 +00:00
|
|
|
u32 m_os; // Which OS has the issue
|
|
|
|
Vendor m_vendor; // Which vendor has the error
|
|
|
|
Driver m_driver; // Which driver has the error
|
2016-01-15 18:13:14 +00:00
|
|
|
Family m_family; // Which family of hardware has the issue
|
2013-06-11 13:33:56 +00:00
|
|
|
Bug m_bug; // Which bug it is
|
|
|
|
double m_versionstart; // When it started
|
|
|
|
double m_versionend; // When it ended
|
|
|
|
bool m_hasbug; // Does it have it?
|
|
|
|
};
|
|
|
|
|
|
|
|
// Local members
|
2013-12-05 15:32:27 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
const u32 m_os = OS_ALL | OS_WINDOWS;
|
|
|
|
#elif ANDROID
|
|
|
|
const u32 m_os = OS_ALL | OS_ANDROID;
|
|
|
|
#elif __APPLE__
|
|
|
|
const u32 m_os = OS_ALL | OS_OSX;
|
2014-03-29 10:05:44 +00:00
|
|
|
#elif __linux__
|
2013-12-05 15:32:27 +00:00
|
|
|
const u32 m_os = OS_ALL | OS_LINUX;
|
2015-06-11 05:15:11 +00:00
|
|
|
#elif __FreeBSD__
|
|
|
|
const u32 m_os = OS_ALL | OS_FREEBSD;
|
2013-12-05 15:32:27 +00:00
|
|
|
#endif
|
|
|
|
|
2014-07-08 13:58:25 +00:00
|
|
|
static Vendor m_vendor = VENDOR_UNKNOWN;
|
|
|
|
static Driver m_driver = DRIVER_UNKNOWN;
|
2016-01-15 18:13:14 +00:00
|
|
|
static Family m_family = Family::UNKNOWN;
|
2014-07-08 13:58:25 +00:00
|
|
|
static double m_version = 0.0;
|
2013-06-11 13:33:56 +00:00
|
|
|
|
|
|
|
// This is a list of all known bugs for each vendor
|
|
|
|
// We use this to check if the device and driver has a issue
|
2014-07-08 13:58:25 +00:00
|
|
|
static BugInfo m_known_bugs[] = {
|
2016-01-15 18:13:14 +00:00
|
|
|
{OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM, Family::UNKNOWN, BUG_BROKENBUFFERSTREAM, -1.0, -1.0, true},
|
|
|
|
{OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM, Family::UNKNOWN, BUG_BROKENNEGATEDBOOLEAN,-1.0, -1.0, true},
|
|
|
|
{OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM, Family::UNKNOWN, BUG_BROKENGLES31, -1.0, -1.0, true},
|
|
|
|
{OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM, Family::UNKNOWN, BUG_BROKENALPHATEST, -1.0, -1.0, true},
|
|
|
|
{OS_ALL, VENDOR_ARM, DRIVER_ARM, Family::UNKNOWN, BUG_BROKENBUFFERSTREAM, -1.0, -1.0, true},
|
|
|
|
{OS_ALL, VENDOR_ARM, DRIVER_ARM, Family::UNKNOWN, BUG_BROKENVSYNC, -1.0, -1.0, true},
|
|
|
|
{OS_ALL, VENDOR_IMGTEC, DRIVER_IMGTEC, Family::UNKNOWN, BUG_BROKENBUFFERSTREAM, -1.0, -1.0, true},
|
|
|
|
{OS_ALL, VENDOR_MESA, DRIVER_NOUVEAU, Family::UNKNOWN, BUG_BROKENUBO, 900, 916, true},
|
|
|
|
{OS_ALL, VENDOR_MESA, DRIVER_R600, Family::UNKNOWN, BUG_BROKENUBO, 900, 913, true},
|
2016-02-11 18:42:24 +00:00
|
|
|
{OS_ALL, VENDOR_MESA, DRIVER_R600, Family::UNKNOWN, BUG_BROKENGEOMETRYSHADERS, -1.0, 1112.0, true},
|
2016-03-04 16:45:13 +00:00
|
|
|
{OS_ALL, VENDOR_MESA, DRIVER_I965, Family::INTEL_SANDY, BUG_BROKENGEOMETRYSHADERS, -1.0, 1120.0, true},
|
2016-01-15 18:13:14 +00:00
|
|
|
{OS_ALL, VENDOR_MESA, DRIVER_I965, Family::UNKNOWN, BUG_BROKENUBO, 900, 920, true},
|
|
|
|
{OS_ALL, VENDOR_MESA, DRIVER_ALL, Family::UNKNOWN, BUG_BROKENCOPYIMAGE, -1.0, 1064.0, true},
|
|
|
|
{OS_LINUX, VENDOR_ATI, DRIVER_ATI, Family::UNKNOWN, BUG_BROKENPINNEDMEMORY, -1.0, -1.0, true},
|
|
|
|
{OS_LINUX, VENDOR_NVIDIA, DRIVER_NVIDIA, Family::UNKNOWN, BUG_BROKENBUFFERSTORAGE, -1.0, 33138.0, true},
|
|
|
|
{OS_OSX, VENDOR_INTEL, DRIVER_INTEL, Family::INTEL_SANDY, BUG_PRIMITIVERESTART, -1.0, -1.0, true},
|
|
|
|
{OS_WINDOWS,VENDOR_NVIDIA, DRIVER_NVIDIA, Family::UNKNOWN, BUG_BROKENUNSYNCMAPPING, -1.0, -1.0, true},
|
|
|
|
{OS_LINUX, VENDOR_NVIDIA, DRIVER_NVIDIA, Family::UNKNOWN, BUG_BROKENUNSYNCMAPPING, -1.0, -1.0, true},
|
|
|
|
{OS_WINDOWS,VENDOR_INTEL, DRIVER_INTEL, Family::UNKNOWN, BUG_INTELBROKENBUFFERSTORAGE, 101810.3907, 101810.3960, true},
|
2013-06-11 13:33:56 +00:00
|
|
|
};
|
|
|
|
|
2014-07-08 13:58:25 +00:00
|
|
|
static std::map<Bug, BugInfo> m_bugs;
|
2013-06-11 13:33:56 +00:00
|
|
|
|
2016-01-15 18:13:14 +00:00
|
|
|
void Init(Vendor vendor, Driver driver, const double version, const Family family)
|
2013-06-11 13:33:56 +00:00
|
|
|
{
|
|
|
|
m_vendor = vendor;
|
2013-08-21 10:34:42 +00:00
|
|
|
m_driver = driver;
|
2013-06-11 13:33:56 +00:00
|
|
|
m_version = version;
|
2013-12-31 00:26:55 +00:00
|
|
|
m_family = family;
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2013-08-21 10:34:42 +00:00
|
|
|
if (driver == DRIVER_UNKNOWN)
|
2014-03-10 11:30:55 +00:00
|
|
|
switch (vendor)
|
2013-08-21 10:34:42 +00:00
|
|
|
{
|
|
|
|
case VENDOR_NVIDIA:
|
|
|
|
case VENDOR_TEGRA:
|
|
|
|
m_driver = DRIVER_NVIDIA;
|
2014-02-16 20:30:18 +00:00
|
|
|
break;
|
2013-08-21 10:34:42 +00:00
|
|
|
case VENDOR_ATI:
|
|
|
|
m_driver = DRIVER_ATI;
|
2014-02-16 20:30:18 +00:00
|
|
|
break;
|
2013-08-21 10:34:42 +00:00
|
|
|
case VENDOR_INTEL:
|
|
|
|
m_driver = DRIVER_INTEL;
|
2014-02-16 20:30:18 +00:00
|
|
|
break;
|
2013-08-21 10:34:42 +00:00
|
|
|
case VENDOR_IMGTEC:
|
|
|
|
m_driver = DRIVER_IMGTEC;
|
2014-02-16 20:30:18 +00:00
|
|
|
break;
|
2013-08-21 10:34:42 +00:00
|
|
|
case VENDOR_VIVANTE:
|
|
|
|
m_driver = DRIVER_VIVANTE;
|
2014-02-16 20:30:18 +00:00
|
|
|
break;
|
2013-08-21 10:34:42 +00:00
|
|
|
default:
|
2014-02-16 20:30:18 +00:00
|
|
|
break;
|
2013-08-21 10:34:42 +00:00
|
|
|
}
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
for (auto& bug : m_known_bugs)
|
2013-08-23 08:52:29 +00:00
|
|
|
{
|
2014-03-10 11:30:55 +00:00
|
|
|
if (( bug.m_os & m_os ) &&
|
|
|
|
( bug.m_vendor == m_vendor || bug.m_vendor == VENDOR_ALL ) &&
|
|
|
|
( bug.m_driver == m_driver || bug.m_driver == DRIVER_ALL ) &&
|
2016-01-15 18:13:14 +00:00
|
|
|
( bug.m_family == m_family || bug.m_family == Family::UNKNOWN) &&
|
2014-03-10 11:30:55 +00:00
|
|
|
( bug.m_versionstart <= m_version || bug.m_versionstart == -1 ) &&
|
|
|
|
( bug.m_versionend > m_version || bug.m_versionend == -1 )
|
2013-08-23 08:52:29 +00:00
|
|
|
)
|
2015-06-28 23:08:28 +00:00
|
|
|
m_bugs.emplace(bug.m_bug, bug);
|
2013-08-23 08:52:29 +00:00
|
|
|
}
|
2013-06-11 13:33:56 +00:00
|
|
|
}
|
|
|
|
|
2013-07-06 00:56:15 +00:00
|
|
|
bool HasBug(Bug bug)
|
2013-06-11 13:33:56 +00:00
|
|
|
{
|
2013-08-23 08:52:29 +00:00
|
|
|
auto it = m_bugs.find(bug);
|
2013-06-11 13:33:56 +00:00
|
|
|
if (it == m_bugs.end())
|
2013-10-29 05:23:17 +00:00
|
|
|
return false;
|
2013-06-11 13:33:56 +00:00
|
|
|
return it->second.m_hasbug;
|
|
|
|
}
|
|
|
|
}
|