2013-06-11 07:33:56 -06:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
#include "LogManager.h"
|
|
|
|
#include "DriverDetails.h"
|
|
|
|
|
|
|
|
namespace DriverDetails
|
|
|
|
{
|
|
|
|
struct BugInfo
|
|
|
|
{
|
2013-12-05 08:32:27 -07: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
|
2013-06-11 07:33:56 -06: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 08:32:27 -07: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;
|
|
|
|
#elif __linux__
|
|
|
|
const u32 m_os = OS_ALL | OS_LINUX;
|
|
|
|
#endif
|
|
|
|
|
2013-06-11 07:33:56 -06:00
|
|
|
Vendor m_vendor = VENDOR_UNKNOWN;
|
2013-08-21 04:34:42 -06:00
|
|
|
Driver m_driver = DRIVER_UNKNOWN;
|
2013-06-11 07:33:56 -06:00
|
|
|
double m_version = 0.0;
|
|
|
|
|
|
|
|
// This is a list of all known bugs for each vendor
|
|
|
|
// We use this to check if the device and driver has a issue
|
2013-08-23 02:52:29 -06:00
|
|
|
BugInfo m_known_bugs[] = {
|
2013-12-19 08:40:13 -07:00
|
|
|
{OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, BUG_NODYNUBOACCESS, 14.0, 46.0, true},
|
|
|
|
{OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, BUG_BROKENCENTROID, 14.0, 46.0, true},
|
|
|
|
{OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, BUG_BROKENINFOLOG, -1.0, 46.0, true},
|
|
|
|
{OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, BUG_ANNIHILATEDUBOS, 41.0, 46.0, true},
|
|
|
|
{OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, BUG_BROKENSWAP, -1.0, 46.0, true},
|
|
|
|
{OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, BUG_BROKENBUFFERSTREAM, -1.0, -1.0, true},
|
2013-12-19 16:30:39 -07:00
|
|
|
{OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, BUG_BROKENTEXTURESIZE, -1.0, -1.0, true},
|
2013-12-19 08:40:13 -07:00
|
|
|
{OS_ALL, VENDOR_ARM, DRIVER_ARM_T6XX, BUG_BROKENBUFFERSTREAM, -1.0, -1.0, true},
|
|
|
|
{OS_ALL, VENDOR_MESA, DRIVER_NOUVEAU, BUG_BROKENUBO, 900, 916, true},
|
|
|
|
{OS_ALL, VENDOR_MESA, DRIVER_R600, BUG_BROKENUBO, 900, 913, true},
|
|
|
|
{OS_ALL, VENDOR_MESA, DRIVER_I965, BUG_BROKENUBO, 900, 920, true},
|
|
|
|
{OS_ALL, VENDOR_ATI, DRIVER_ATI, BUG_BROKENHACKEDBUFFER, -1.0, -1.0, true},
|
|
|
|
{OS_LINUX, VENDOR_ATI, DRIVER_ATI, BUG_BROKENPINNEDMEMORY, -1.0, -1.0, true},
|
|
|
|
{OS_ALL, VENDOR_MESA, DRIVER_NOUVEAU, BUG_BROKENHACKEDBUFFER, -1.0, -1.0, true},
|
2013-06-11 07:33:56 -06:00
|
|
|
};
|
|
|
|
|
2013-08-23 02:52:29 -06:00
|
|
|
std::map<Bug, BugInfo> m_bugs;
|
2013-06-11 07:33:56 -06:00
|
|
|
|
2013-08-23 02:52:29 -06:00
|
|
|
void Init(Vendor vendor, Driver driver, const double version)
|
2013-06-11 07:33:56 -06:00
|
|
|
{
|
|
|
|
m_vendor = vendor;
|
2013-08-21 04:34:42 -06:00
|
|
|
m_driver = driver;
|
2013-06-11 07:33:56 -06:00
|
|
|
m_version = version;
|
2013-10-28 23:23:17 -06:00
|
|
|
|
2013-08-21 04:34:42 -06:00
|
|
|
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_IMGTEC:
|
|
|
|
m_driver = DRIVER_IMGTEC;
|
|
|
|
break;
|
|
|
|
case VENDOR_VIVANTE:
|
|
|
|
m_driver = DRIVER_VIVANTE;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2013-10-28 23:23:17 -06:00
|
|
|
|
2013-10-28 23:09:01 -06:00
|
|
|
for(auto& bug : m_known_bugs)
|
2013-08-23 02:52:29 -06:00
|
|
|
{
|
|
|
|
if(
|
2013-12-06 11:18:20 -07:00
|
|
|
( bug.m_os & m_os ) &&
|
2013-10-28 23:09:01 -06:00
|
|
|
( bug.m_vendor == m_vendor || bug.m_vendor == VENDOR_ALL ) &&
|
|
|
|
( bug.m_driver == m_driver || bug.m_driver == DRIVER_ALL ) &&
|
|
|
|
( bug.m_versionstart <= m_version || bug.m_versionstart == -1 ) &&
|
|
|
|
( bug.m_versionend > m_version || bug.m_versionend == -1 )
|
2013-08-23 02:52:29 -06:00
|
|
|
)
|
2013-10-28 23:09:01 -06:00
|
|
|
m_bugs.insert(std::make_pair(bug.m_bug, bug));
|
2013-08-23 02:52:29 -06:00
|
|
|
}
|
2013-06-11 07:33:56 -06:00
|
|
|
}
|
|
|
|
|
2013-07-05 18:56:15 -06:00
|
|
|
bool HasBug(Bug bug)
|
2013-06-11 07:33:56 -06:00
|
|
|
{
|
2013-08-23 02:52:29 -06:00
|
|
|
auto it = m_bugs.find(bug);
|
2013-06-11 07:33:56 -06:00
|
|
|
if (it == m_bugs.end())
|
2013-10-28 23:23:17 -06:00
|
|
|
return false;
|
2013-06-11 07:33:56 -06:00
|
|
|
return it->second.m_hasbug;
|
|
|
|
}
|
|
|
|
}
|