2013-06-11 07:33:56 -06:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
2021-07-04 19:22:19 -06:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2013-06-11 07:33:56 -06:00
|
|
|
|
|
|
|
#include <map>
|
|
|
|
|
2014-06-05 17:29:54 -06:00
|
|
|
#include "Common/Logging/LogManager.h"
|
2014-02-17 03:18:15 -07:00
|
|
|
#include "VideoCommon/DriverDetails.h"
|
2013-06-11 07:33:56 -06:00
|
|
|
|
|
|
|
namespace DriverDetails
|
|
|
|
{
|
|
|
|
struct BugInfo
|
|
|
|
{
|
2016-08-12 23:16:31 -06:00
|
|
|
API m_api; // Which API has the issue
|
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
|
2016-01-15 11:13:14 -07:00
|
|
|
Family m_family; // Which family of hardware has the issue
|
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
|
2019-06-08 16:06:34 -06:00
|
|
|
constexpr u32 m_os = OS_ALL | OS_WINDOWS;
|
2013-12-05 08:32:27 -07:00
|
|
|
#elif ANDROID
|
2019-06-08 16:06:34 -06:00
|
|
|
constexpr u32 m_os = OS_ALL | OS_ANDROID;
|
2013-12-05 08:32:27 -07:00
|
|
|
#elif __APPLE__
|
2019-06-08 16:06:34 -06:00
|
|
|
constexpr u32 m_os = OS_ALL | OS_OSX;
|
2013-12-05 08:32:27 -07:00
|
|
|
#elif __linux__
|
2019-06-08 16:06:34 -06:00
|
|
|
constexpr u32 m_os = OS_ALL | OS_LINUX;
|
2015-06-10 23:15:11 -06:00
|
|
|
#elif __FreeBSD__
|
2019-06-08 16:06:34 -06:00
|
|
|
constexpr u32 m_os = OS_ALL | OS_FREEBSD;
|
2016-07-17 04:10:49 -06:00
|
|
|
#elif __OpenBSD__
|
2019-06-08 16:06:34 -06:00
|
|
|
constexpr u32 m_os = OS_ALL | OS_OPENBSD;
|
2020-12-04 09:09:42 -07:00
|
|
|
#elif __NetBSD__
|
|
|
|
constexpr u32 m_os = OS_ALL | OS_NETBSD;
|
2020-12-12 13:25:51 -07:00
|
|
|
#elif __HAIKU__
|
|
|
|
constexpr u32 m_os = OS_ALL | OS_HAIKU;
|
2013-12-05 08:32:27 -07:00
|
|
|
#endif
|
|
|
|
|
2016-08-12 23:16:31 -06:00
|
|
|
static API m_api = API_OPENGL;
|
2014-07-08 07:58:25 -06:00
|
|
|
static Vendor m_vendor = VENDOR_UNKNOWN;
|
|
|
|
static Driver m_driver = DRIVER_UNKNOWN;
|
2016-01-15 11:13:14 -07:00
|
|
|
static Family m_family = Family::UNKNOWN;
|
2014-07-08 07:58:25 -06:00
|
|
|
static double m_version = 0.0;
|
2013-06-11 07:33:56 -06: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
|
2019-06-08 16:06:34 -06:00
|
|
|
constexpr BugInfo m_known_bugs[] = {
|
2016-08-12 23:16:31 -06:00
|
|
|
{API_OPENGL, OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM, Family::UNKNOWN,
|
2016-10-29 16:56:18 -06:00
|
|
|
BUG_BROKEN_BUFFER_STREAM, -1.0, -1.0, true},
|
|
|
|
{API_OPENGL, OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM, Family::UNKNOWN,
|
|
|
|
BUG_BROKEN_NEGATED_BOOLEAN, -1.0, -1.0, true},
|
|
|
|
{API_OPENGL, OS_ALL, VENDOR_ARM, DRIVER_ARM, Family::UNKNOWN, BUG_BROKEN_BUFFER_STREAM, -1.0,
|
2016-01-15 11:13:14 -07:00
|
|
|
-1.0, true},
|
2016-10-29 16:56:18 -06:00
|
|
|
{API_OPENGL, OS_ALL, VENDOR_ARM, DRIVER_ARM, Family::UNKNOWN, BUG_BROKEN_VSYNC, -1.0, -1.0,
|
2016-01-15 11:13:14 -07:00
|
|
|
true},
|
2016-10-29 16:56:18 -06:00
|
|
|
{API_OPENGL, OS_ALL, VENDOR_IMGTEC, DRIVER_IMGTEC, Family::UNKNOWN, BUG_BROKEN_BUFFER_STREAM,
|
2016-08-12 23:16:31 -06:00
|
|
|
-1.0, -1.0, true},
|
2016-10-29 16:56:18 -06:00
|
|
|
{API_OPENGL, OS_ALL, VENDOR_MESA, DRIVER_NOUVEAU, Family::UNKNOWN, BUG_BROKEN_UBO, 900, 916,
|
2016-01-15 11:13:14 -07:00
|
|
|
true},
|
2016-10-29 16:56:18 -06:00
|
|
|
{API_OPENGL, OS_ALL, VENDOR_MESA, DRIVER_R600, Family::UNKNOWN, BUG_BROKEN_UBO, 900, 913, true},
|
|
|
|
{API_OPENGL, OS_ALL, VENDOR_MESA, DRIVER_R600, Family::UNKNOWN, BUG_BROKEN_GEOMETRY_SHADERS,
|
|
|
|
-1.0, 1112.0, true},
|
|
|
|
{API_OPENGL, OS_ALL, VENDOR_MESA, DRIVER_I965, Family::INTEL_SANDY, BUG_BROKEN_GEOMETRY_SHADERS,
|
2016-08-12 23:16:31 -06:00
|
|
|
-1.0, 1120.0, true},
|
2016-10-29 16:56:18 -06:00
|
|
|
{API_OPENGL, OS_ALL, VENDOR_MESA, DRIVER_I965, Family::UNKNOWN, BUG_BROKEN_UBO, 900, 920, true},
|
|
|
|
{API_OPENGL, OS_ALL, VENDOR_MESA, DRIVER_ALL, Family::UNKNOWN, BUG_BROKEN_COPYIMAGE, -1.0,
|
2016-08-12 23:16:31 -06:00
|
|
|
1064.0, true},
|
2016-10-29 16:56:18 -06:00
|
|
|
{API_OPENGL, OS_LINUX, VENDOR_ATI, DRIVER_ATI, Family::UNKNOWN, BUG_BROKEN_PINNED_MEMORY, -1.0,
|
2016-08-12 23:16:31 -06:00
|
|
|
-1.0, true},
|
2017-02-26 08:49:28 -07:00
|
|
|
{API_OPENGL, OS_ALL, VENDOR_MESA, DRIVER_R600, Family::UNKNOWN, BUG_BROKEN_PINNED_MEMORY, -1.0,
|
|
|
|
-1.0, true},
|
2016-10-29 16:56:18 -06:00
|
|
|
{API_OPENGL, OS_LINUX, VENDOR_NVIDIA, DRIVER_NVIDIA, Family::UNKNOWN, BUG_BROKEN_BUFFER_STORAGE,
|
2016-08-12 23:16:31 -06:00
|
|
|
-1.0, 33138.0, true},
|
2016-10-29 16:56:18 -06:00
|
|
|
{API_OPENGL, OS_OSX, VENDOR_INTEL, DRIVER_INTEL, Family::INTEL_SANDY, BUG_PRIMITIVE_RESTART,
|
2016-08-12 23:16:31 -06:00
|
|
|
-1.0, -1.0, true},
|
2016-10-29 16:56:18 -06:00
|
|
|
{API_OPENGL, OS_WINDOWS, VENDOR_NVIDIA, DRIVER_NVIDIA, Family::UNKNOWN,
|
|
|
|
BUG_BROKEN_UNSYNC_MAPPING, -1.0, -1.0, true},
|
|
|
|
{API_OPENGL, OS_LINUX, VENDOR_NVIDIA, DRIVER_NVIDIA, Family::UNKNOWN, BUG_BROKEN_UNSYNC_MAPPING,
|
2016-08-12 23:16:31 -06:00
|
|
|
-1.0, -1.0, true},
|
2018-02-25 08:51:01 -07:00
|
|
|
{API_OPENGL, OS_ALL, VENDOR_ARM, DRIVER_ARM, Family::UNKNOWN, BUG_BROKEN_UNSYNC_MAPPING, -1.0,
|
|
|
|
-1.0, true},
|
2016-08-12 23:16:31 -06:00
|
|
|
{API_OPENGL, OS_WINDOWS, VENDOR_INTEL, DRIVER_INTEL, Family::UNKNOWN,
|
2016-10-29 16:56:18 -06:00
|
|
|
BUG_INTEL_BROKEN_BUFFER_STORAGE, 101810.3907, 101810.3960, true},
|
|
|
|
{API_OPENGL, OS_ALL, VENDOR_ATI, DRIVER_ATI, Family::UNKNOWN, BUG_SLOW_GETBUFFERSUBDATA, -1.0,
|
2016-08-12 23:16:31 -06:00
|
|
|
-1.0, true},
|
2016-10-29 16:56:18 -06:00
|
|
|
{API_OPENGL, OS_ALL, VENDOR_MESA, DRIVER_I965, Family::UNKNOWN, BUG_BROKEN_CLIP_DISTANCE, -1.0,
|
2016-08-12 23:16:31 -06:00
|
|
|
-1.0, true},
|
2019-05-01 05:17:59 -06:00
|
|
|
{API_VULKAN, OS_WINDOWS, VENDOR_ATI, DRIVER_ATI, Family::UNKNOWN,
|
2018-08-31 21:32:56 -06:00
|
|
|
BUG_BROKEN_FRAGMENT_SHADER_INDEX_DECORATION, -1.0, -1.0, true},
|
2016-10-27 13:59:12 -06:00
|
|
|
{API_OPENGL, OS_WINDOWS, VENDOR_ATI, DRIVER_ATI, Family::UNKNOWN,
|
|
|
|
BUG_BROKEN_DUAL_SOURCE_BLENDING, -1.0, -1.0, true},
|
2016-10-29 09:25:04 -06:00
|
|
|
{API_OPENGL, OS_OSX, VENDOR_INTEL, DRIVER_INTEL, Family::UNKNOWN,
|
|
|
|
BUG_BROKEN_DUAL_SOURCE_BLENDING, -1.0, -1.0, true},
|
2021-07-23 06:32:21 -06:00
|
|
|
{API_VULKAN, OS_OSX, VENDOR_INTEL, DRIVER_PORTABILITY, Family::UNKNOWN,
|
|
|
|
BUG_BROKEN_DUAL_SOURCE_BLENDING, -1.0, -1.0, true},
|
2017-05-03 20:22:26 -06:00
|
|
|
{API_OPENGL, OS_ALL, VENDOR_IMGTEC, DRIVER_IMGTEC, Family::UNKNOWN,
|
2017-09-02 14:23:06 -06:00
|
|
|
BUG_BROKEN_BITWISE_OP_NEGATION, -1.0, 108.4693462, true},
|
2019-05-01 05:17:59 -06:00
|
|
|
{API_VULKAN, OS_WINDOWS, VENDOR_ATI, DRIVER_ATI, Family::UNKNOWN, BUG_PRIMITIVE_RESTART, -1.0,
|
|
|
|
-1.0, true},
|
2018-03-13 10:49:32 -06:00
|
|
|
{API_VULKAN, OS_ALL, VENDOR_ARM, DRIVER_ARM, Family::UNKNOWN, BUG_PRIMITIVE_RESTART, -1.0, -1.0,
|
|
|
|
true},
|
2017-07-19 23:25:29 -06:00
|
|
|
{API_OPENGL, OS_LINUX, VENDOR_MESA, DRIVER_I965, Family::UNKNOWN,
|
|
|
|
BUG_SHARED_CONTEXT_SHADER_COMPILATION, -1.0, -1.0, true},
|
2018-07-16 21:33:56 -06:00
|
|
|
{API_OPENGL, OS_LINUX, VENDOR_MESA, DRIVER_NOUVEAU, Family::UNKNOWN,
|
|
|
|
BUG_SHARED_CONTEXT_SHADER_COMPILATION, -1.0, -1.0, true},
|
2017-09-02 22:04:14 -06:00
|
|
|
{API_VULKAN, OS_ALL, VENDOR_NVIDIA, DRIVER_NVIDIA, Family::UNKNOWN, BUG_BROKEN_MSAA_CLEAR, -1.0,
|
|
|
|
-1.0, true},
|
2017-06-19 19:46:17 -06:00
|
|
|
{API_VULKAN, OS_ALL, VENDOR_IMGTEC, DRIVER_IMGTEC, Family::UNKNOWN,
|
|
|
|
BUG_BROKEN_CLEAR_LOADOP_RENDERPASS, -1.0, -1.0, true},
|
2018-07-16 21:26:37 -06:00
|
|
|
{API_VULKAN, OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM, Family::UNKNOWN, BUG_BROKEN_D32F_CLEAR,
|
2019-06-08 16:06:34 -06:00
|
|
|
-1.0, -1.0, true},
|
2019-07-15 03:45:36 -06:00
|
|
|
{API_VULKAN, OS_ALL, VENDOR_MESA, DRIVER_I965, Family::UNKNOWN, BUG_BROKEN_REVERSED_DEPTH_RANGE,
|
|
|
|
-1.0, -1.0, true},
|
|
|
|
{API_VULKAN, OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM, Family::UNKNOWN,
|
2019-07-20 21:27:33 -06:00
|
|
|
BUG_BROKEN_REVERSED_DEPTH_RANGE, -1.0, -1.0, true},
|
|
|
|
{API_VULKAN, OS_OSX, VENDOR_ALL, DRIVER_PORTABILITY, Family::UNKNOWN,
|
2019-10-02 05:32:44 -06:00
|
|
|
BUG_BROKEN_REVERSED_DEPTH_RANGE, -1.0, -1.0, true},
|
|
|
|
{API_VULKAN, OS_ALL, VENDOR_ARM, DRIVER_ARM, Family::UNKNOWN, BUG_SLOW_CACHED_READBACK_MEMORY,
|
|
|
|
-1.0, -1.0, true},
|
|
|
|
{API_VULKAN, OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM, Family::UNKNOWN,
|
2020-04-13 02:19:24 -06:00
|
|
|
BUG_SLOW_CACHED_READBACK_MEMORY, -1.0, -1.0, true},
|
2021-04-11 03:08:42 -06:00
|
|
|
{API_OPENGL, OS_ALL, VENDOR_ARM, DRIVER_ARM, Family::UNKNOWN, BUG_BROKEN_VECTOR_BITWISE_AND,
|
|
|
|
-1.0, -1.0, true},
|
|
|
|
{API_VULKAN, OS_ALL, VENDOR_ARM, DRIVER_ARM, Family::UNKNOWN, BUG_BROKEN_VECTOR_BITWISE_AND,
|
|
|
|
-1.0, -1.0, true},
|
2021-05-28 19:10:48 -06:00
|
|
|
{API_OPENGL, OS_WINDOWS, VENDOR_ATI, DRIVER_ATI, Family::UNKNOWN, BUG_BROKEN_SSBO_FIELD_ATOMICS,
|
|
|
|
-1.0, -1.0, true},
|
2021-09-16 21:22:05 -06:00
|
|
|
{API_VULKAN, OS_OSX, VENDOR_ATI, DRIVER_PORTABILITY, Family::UNKNOWN,
|
|
|
|
BUG_BROKEN_SUBGROUP_INVOCATION_ID, -1.0, -1.0, true},
|
2020-04-13 02:19:24 -06:00
|
|
|
};
|
2013-06-11 07:33:56 -06:00
|
|
|
|
2014-07-08 07:58:25 -06:00
|
|
|
static std::map<Bug, BugInfo> m_bugs;
|
2013-06-11 07:33:56 -06:00
|
|
|
|
2016-08-12 23:16:31 -06:00
|
|
|
void Init(API api, Vendor vendor, Driver driver, const double version, const Family family)
|
2013-06-11 07:33:56 -06:00
|
|
|
{
|
2016-08-12 23:16:31 -06:00
|
|
|
m_api = api;
|
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-12-30 17:26:55 -07:00
|
|
|
m_family = family;
|
2013-10-28 23:23:17 -06:00
|
|
|
|
2013-08-21 04:34:42 -06:00
|
|
|
if (driver == DRIVER_UNKNOWN)
|
2016-08-12 23:16:31 -06:00
|
|
|
{
|
2014-03-10 05:30:55 -06:00
|
|
|
switch (vendor)
|
2013-08-21 04:34:42 -06:00
|
|
|
{
|
|
|
|
case VENDOR_NVIDIA:
|
|
|
|
case VENDOR_TEGRA:
|
|
|
|
m_driver = DRIVER_NVIDIA;
|
2014-02-16 13:30:18 -07:00
|
|
|
break;
|
2013-08-21 04:34:42 -06:00
|
|
|
case VENDOR_ATI:
|
|
|
|
m_driver = DRIVER_ATI;
|
2014-02-16 13:30:18 -07:00
|
|
|
break;
|
2013-08-21 04:34:42 -06:00
|
|
|
case VENDOR_INTEL:
|
|
|
|
m_driver = DRIVER_INTEL;
|
2014-02-16 13:30:18 -07:00
|
|
|
break;
|
2013-08-21 04:34:42 -06:00
|
|
|
case VENDOR_IMGTEC:
|
|
|
|
m_driver = DRIVER_IMGTEC;
|
2014-02-16 13:30:18 -07:00
|
|
|
break;
|
2013-08-21 04:34:42 -06:00
|
|
|
case VENDOR_VIVANTE:
|
|
|
|
m_driver = DRIVER_VIVANTE;
|
2014-02-16 13:30:18 -07:00
|
|
|
break;
|
2013-08-21 04:34:42 -06:00
|
|
|
default:
|
2014-02-16 13:30:18 -07:00
|
|
|
break;
|
2013-08-21 04:34:42 -06:00
|
|
|
}
|
2016-08-12 23:16:31 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
// Clear bug list, as the API may have changed
|
|
|
|
m_bugs.clear();
|
2013-10-28 23:23:17 -06:00
|
|
|
|
2019-06-08 16:06:34 -06:00
|
|
|
for (const auto& bug : m_known_bugs)
|
2013-08-23 02:52:29 -06:00
|
|
|
{
|
2016-08-12 23:16:31 -06:00
|
|
|
if ((bug.m_api & api) && (bug.m_os & m_os) &&
|
|
|
|
(bug.m_vendor == m_vendor || bug.m_vendor == VENDOR_ALL) &&
|
2014-03-10 05:30:55 -06:00
|
|
|
(bug.m_driver == m_driver || bug.m_driver == DRIVER_ALL) &&
|
2016-01-15 11:13:14 -07:00
|
|
|
(bug.m_family == m_family || bug.m_family == Family::UNKNOWN) &&
|
2014-03-10 05:30:55 -06:00
|
|
|
(bug.m_versionstart <= m_version || bug.m_versionstart == -1) &&
|
|
|
|
(bug.m_versionend > m_version || bug.m_versionend == -1))
|
2019-06-08 16:06:34 -06:00
|
|
|
{
|
2015-06-28 17:08:28 -06:00
|
|
|
m_bugs.emplace(bug.m_bug, bug);
|
2019-06-08 16:06:34 -06:00
|
|
|
}
|
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
|
|
|
{
|
2019-06-08 16:06:34 -06:00
|
|
|
const auto it = m_bugs.find(bug);
|
2013-06-11 07:33:56 -06:00
|
|
|
if (it == m_bugs.end())
|
|
|
|
return false;
|
|
|
|
return it->second.m_hasbug;
|
|
|
|
}
|
2019-05-01 05:17:59 -06:00
|
|
|
} // namespace DriverDetails
|