diff options
author | Jeroen Bakker <jeroen@blender.org> | 2021-07-06 14:24:08 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-07-06 15:24:42 +0300 |
commit | 7af40ccf5f22795da4122ac20c966a352cae4eaf (patch) | |
tree | 49234e92e1e846099acaa9624212cd4b04db3969 | |
parent | 8f5a4a2453887e37b51bb131176b0efbd0e9b42e (diff) |
GPU: Fix crash when using EGL with --gpu-debug flag.
During initialization of the platform a debug message is generated and
interpreted by de callback. Here the platform is checked what requires
an initialized platform.
Fixed by giving the platform check less priority in the check.
-rw-r--r-- | source/blender/gpu/opengl/gl_debug.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/gpu/opengl/gl_debug.cc b/source/blender/gpu/opengl/gl_debug.cc index ac42a950945..3e259235515 100644 --- a/source/blender/gpu/opengl/gl_debug.cc +++ b/source/blender/gpu/opengl/gl_debug.cc @@ -81,9 +81,11 @@ static void APIENTRY debug_callback(GLenum UNUSED(source), return; } - if (TRIM_NVIDIA_BUFFER_INFO && - GPU_type_matches(GPU_DEVICE_NVIDIA, GPU_OS_ANY, GPU_DRIVER_OFFICIAL) && - STRPREFIX(message, "Buffer detailed info")) { + /* NOTE: callback function can be triggered during before the platform is initialized. + * In this case invoking `GPU_type_matches` would fail and + * therefore the message is checked before the platform matching. */ + if (TRIM_NVIDIA_BUFFER_INFO && STRPREFIX(message, "Buffer detailed info") && + GPU_type_matches(GPU_DEVICE_NVIDIA, GPU_OS_ANY, GPU_DRIVER_OFFICIAL)) { /** Suppress buffer infos flooding the output. */ return; } |