From 82ca8a707eba4aa0955fc682efec3dd28ed8fb6b Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Mon, 21 Mar 2022 11:49:27 +0100 Subject: [PATCH] wgl: do not disable error-dialogs by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We don't know if an application developer wants error-dialog by default or not, even when using a Mesa OpenGL driver. So let's not assume this is a good thing, and instead make an option for this behavior that we can enable for CI testing. Reviewed-by: Louis-Francis Ratté-Boulianne Reviewed-by: Jesse Natalie Part-of: --- docs/envvars.rst | 3 +++ src/gallium/drivers/d3d12/ci/gitlab-ci.yml | 1 + src/gallium/frontends/wgl/stw_device.c | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/envvars.rst b/docs/envvars.rst index 39aea445b13..9ad6932fd17 100644 --- a/docs/envvars.rst +++ b/docs/envvars.rst @@ -235,6 +235,9 @@ on Windows. :envvar:`WGL_FORCE_MSAA` if set to a positive value, specifies the number of MSAA samples to force when choosing the display configuration. +:envvar:`WGL_DISABLE_ERROR_DIALOGS` + if set to 1, true or yes, disables Win32 error dialogs. Useful for + automated test-runs. Intel driver environment variables ---------------------------------------------------- diff --git a/src/gallium/drivers/d3d12/ci/gitlab-ci.yml b/src/gallium/drivers/d3d12/ci/gitlab-ci.yml index 4a93cb20972..52b5bfdf0f9 100644 --- a/src/gallium/drivers/d3d12/ci/gitlab-ci.yml +++ b/src/gallium/drivers/d3d12/ci/gitlab-ci.yml @@ -12,6 +12,7 @@ variables: GIT_STRATEGY: none # testing doesn't build anything from source GALLIUM_DRIVER: d3d12 + WGL_DISABLE_ERROR_DIALOGS: "true" .d3d12-test-piglit: extends: diff --git a/src/gallium/frontends/wgl/stw_device.c b/src/gallium/frontends/wgl/stw_device.c index 0ef057bce2f..8d3b7951f3a 100644 --- a/src/gallium/frontends/wgl/stw_device.c +++ b/src/gallium/frontends/wgl/stw_device.c @@ -28,6 +28,7 @@ #include #include "glapi/glapi.h" +#include "util/debug.h" #include "util/u_debug.h" #include "util/u_math.h" #include "util/u_memory.h" @@ -120,7 +121,8 @@ stw_init(const struct stw_winsys *stw_winsys) { static struct stw_device stw_dev_storage; - debug_disable_win32_error_dialogs(); + if (env_var_as_boolean("WGL_DISABLE_ERROR_DIALOGS", false)) + debug_disable_win32_error_dialogs(); assert(!stw_dev);