From afd778ec01d10f6bd9efe275e5607990a139b09c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Wed, 11 Jun 2025 11:04:10 +0200 Subject: [PATCH] Fix #139939: GPU: Driver Timeout when switching to Material Preview This is caused by the late changes to shader compilation. Using the main thread to compile shaders in a blocking manner should fix the issue. Pull Request: https://projects.blender.org/blender/blender/pulls/140140 --- source/blender/gpu/opengl/gl_backend.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/blender/gpu/opengl/gl_backend.cc b/source/blender/gpu/opengl/gl_backend.cc index e2d7ebbfe94..07a587799ff 100644 --- a/source/blender/gpu/opengl/gl_backend.cc +++ b/source/blender/gpu/opengl/gl_backend.cc @@ -524,6 +524,12 @@ static void detect_workarounds() { GCaps.use_main_context_workaround = true; } + /* Needed to avoid driver hangs on legacy AMD drivers (see #139939). */ + if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_ANY, GPU_DRIVER_OFFICIAL) && + is_AMD_between_20_11_and_22(version)) + { + GCaps.use_main_context_workaround = true; + } /* See #70187: merging vertices fail. This has been tested from `18.2.2` till `19.3.0~dev` * of the Mesa driver */ if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_UNIX, GPU_DRIVER_OPENSOURCE) &&