GPU: Enable HQ normals workaround for any AMD Drivers on Polaris.

This commit is contained in:
Jeroen Bakker 2021-01-26 12:48:02 +01:00
parent c399651637
commit e6aece32a0
1 changed files with 10 additions and 24 deletions

View File

@ -34,28 +34,6 @@
namespace blender::gpu {
/* See T82856: AMD drivers since 20.11 running on a polaris architecture doesn't support the
* `GL_INT_2_10_10_10_REV` data type correctly. This data type is used to pack normals and flags.
* The work around uses `GPU_RGBA16I` but that is only possible for loop normals.
*
* Vertex and Face normals would still render resulting in undefined behavior during selection and
* rendering. */
static bool is_faulty_T82856_platform(const char *version, const char *renderer)
{
/* On Linux the driver does not report its version. Test the OpenGL version in stead. */
if (strstr(version, "4.5.1475")) {
if (strstr(renderer, " RX 460 ") || strstr(renderer, " RX 470 ") ||
strstr(renderer, " RX 480 ") || strstr(renderer, " RX 490 ") ||
strstr(renderer, " RX 560 ") || strstr(renderer, " RX 560X ") ||
strstr(renderer, " RX 570 ") || strstr(renderer, " RX 580 ") ||
strstr(renderer, " RX 590 ") || strstr(renderer, " RX550/550 ") ||
strstr(renderer, " (TM) 520 ") || strstr(renderer, " (TM) 530 ") ||
strstr(renderer, " R5 ") || strstr(renderer, " R7 ") || strstr(renderer, " R9 ")) {
return true;
}
}
return false;
}
/* -------------------------------------------------------------------- */
/** \name Platform
* \{ */
@ -294,9 +272,17 @@ static void detect_workarounds()
GCaps.broken_amd_driver = true;
}
/* See T82856: AMD drivers since 20.11 running on a polaris architecture doesn't support the
* `GL_INT_2_10_10_10_REV` data type. */
* `GL_INT_2_10_10_10_REV` data type correctly. This data type is used to pack normals and flags.
* The work around uses `GPU_RGBA16I`.
*/
if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_ANY, GPU_DRIVER_OFFICIAL)) {
if (is_faulty_T82856_platform(version, renderer)) {
if (strstr(renderer, " RX 460 ") || strstr(renderer, " RX 470 ") ||
strstr(renderer, " RX 480 ") || strstr(renderer, " RX 490 ") ||
strstr(renderer, " RX 560 ") || strstr(renderer, " RX 560X ") ||
strstr(renderer, " RX 570 ") || strstr(renderer, " RX 580 ") ||
strstr(renderer, " RX 590 ") || strstr(renderer, " RX550/550 ") ||
strstr(renderer, " (TM) 520 ") || strstr(renderer, " (TM) 530 ") ||
strstr(renderer, " R5 ") || strstr(renderer, " R7 ") || strstr(renderer, " R9 ")) {
GCaps.use_hq_normals_workaround = true;
}
}