Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2021-01-04 14:15:51 +0300
committerJeroen Bakker <jeroen@blender.org>2021-01-13 11:55:25 +0300
commit4a61e9ea0fc50daf73ab904616077f018719871c (patch)
tree67de65f203a9516a7d9e10e545bd36196811e0c9
parentdb7c7486fd88a48543abea01538e9b8026103e39 (diff)
GPU: Enable HQ normal work around for AMD Polaris
THe high quality normals work around is enabled for Polaris cards using the official drivers. Since driver version 2.11.2 they fail to render using low quality normals. The detection of polaris cards is done by matching the opengl renderer. The renderer strings have been extracted from various reports linked to {T82856} but isn't complete as some reports are missing the exact renderer as users don't always report via the help menu.
-rw-r--r--source/blender/gpu/intern/gpu_extensions.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
index 9a114c7cde5..cf413800384 100644
--- a/source/blender/gpu/intern/gpu_extensions.c
+++ b/source/blender/gpu/intern/gpu_extensions.c
@@ -323,6 +323,27 @@ void gpu_extensions_init(void)
}
}
+ /* 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. */
+ if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_ANY, GPU_DRIVER_OFFICIAL)) {
+ /* On Linux the driver does not report its version. Test the OpenGL version in stead. */
+ if (strstr(version, "4.5.14756") || strstr(version, "4.5.14757")) {
+ 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 ")) {
+ GG.use_hq_normals_workaround = true;
+ }
+ }
+ }
+
/* Limit support for GLEW_ARB_base_instance to OpenGL 4.0 and higher. NVIDIA Quadro FX 4800
* (TeraScale) report that they support GLEW_ARB_base_instance, but the driver does not support
* GLEW_ARB_draw_indirect as it has an OpenGL3 context what also matches the minimum needed