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
path: root/source
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2021-01-04 14:15:51 +0300
committerJeroen Bakker <jeroen@blender.org>2021-01-04 14:19:51 +0300
commitcb2517016ba16cd31b4dd36272ebfe95a54f868b (patch)
tree6e1add74da03c25b83ac50a939af879cd3967e58 /source
parenta3fcbb54f4b0dac7f9104d5f45c8540e9764e46d (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.
Diffstat (limited to 'source')
-rw-r--r--source/blender/gpu/opengl/gl_backend.cc30
1 files changed, 17 insertions, 13 deletions
diff --git a/source/blender/gpu/opengl/gl_backend.cc b/source/blender/gpu/opengl/gl_backend.cc
index f683a70b4e6..d9bc3a78dd8 100644
--- a/source/blender/gpu/opengl/gl_backend.cc
+++ b/source/blender/gpu/opengl/gl_backend.cc
@@ -130,19 +130,6 @@ void GLBackend::platform_init()
GPG.support_level = GPU_SUPPORT_LEVEL_LIMITED;
}
}
-
- /* Driver 20.11.2/3 fixes a lot of issues for the Navi cards, but introduces new ones
- * for Polaris based cards cards. The viewport has glitches but doesn't crash.
- * See T82856,T83574. */
- if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_WIN, GPU_DRIVER_OFFICIAL) &&
- (strstr(version, " 20.11.2 ") || strstr(version, " 20.11.3 "))) {
- if (strstr(renderer, "Radeon RX 460 ") || strstr(renderer, "Radeon RX 470 ") ||
- strstr(renderer, "Radeon RX 480 ") || strstr(renderer, "Radeon RX 490 ") ||
- strstr(renderer, "Radeon RX 560 ") || strstr(renderer, "Radeon RX 570 ") ||
- strstr(renderer, "Radeon RX 580 ") || strstr(renderer, "Radeon RX 590 ")) {
- GPG.support_level = GPU_SUPPORT_LEVEL_LIMITED;
- }
- }
if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_UNIX, GPU_DRIVER_ANY)) {
/* Platform seems to work when SB backend is disabled. This can be done
* by adding the environment variable `R600_DEBUG=nosb`. */
@@ -284,6 +271,23 @@ static void detect_workarounds()
GCaps.shader_image_load_store_support = false;
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. This data type is used to pack normals. The work around
+ * uses `GPU_RGBA16I`.*/
+ if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_ANY, GPU_DRIVER_OFFICIAL)) {
+ if (strstr(version, " 20.11.2") || strstr(version, " 20.11.3 ") ||
+ strstr(version, " 20.12.")) {
+ 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;
+ }
+ }
+ }
/* There is an issue with the #glBlitFramebuffer on MacOS with radeon pro graphics.
* Blitting depth with#GL_DEPTH24_STENCIL8 is buggy so the workaround is to use
* #GPU_DEPTH32F_STENCIL8. Then Blitting depth will work but blitting stencil will