From 9ddc67166fb444e5d30b8ebf97e023486b007945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Mon, 16 Jun 2025 12:44:11 +0200 Subject: [PATCH] Fix: GPU: Hang on Mesa with `--debug-gpu` on opengl Just workaround the issue. --- source/blender/gpu/intern/gpu_shader_builtin.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/blender/gpu/intern/gpu_shader_builtin.cc b/source/blender/gpu/intern/gpu_shader_builtin.cc index b960fc4d4d6..4135c61046d 100644 --- a/source/blender/gpu/intern/gpu_shader_builtin.cc +++ b/source/blender/gpu/intern/gpu_shader_builtin.cc @@ -6,6 +6,7 @@ * \ingroup gpu */ +#include "BKE_global.hh" #include "BLI_utildefines.h" #include "GPU_capabilities.hh" @@ -236,6 +237,12 @@ GPUShader *GPU_shader_get_builtin_shader(eGPUBuiltinShader shader) void GPU_shader_builtin_warm_up() { + if ((G.debug & G_DEBUG_GPU) && (GPU_backend_get_type() == GPU_BACKEND_OPENGL)) { + /* On some system (Mesa OpenGL), doing this warm up seems to breaks something related to debug + * hooks and makes the Blender application hang. */ + return; + } + if (GPU_use_subprocess_compilation() && (GPU_backend_get_type() == GPU_BACKEND_OPENGL)) { /* The overhead of creating the subprocesses at this exact moment can create bubbles during the * startup process. It is usually fast enough on OpenGL that we can skip it. */