From 116553b554f501846241c9d8d1dc6e43010c85a6 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Mon, 21 Mar 2022 11:09:51 +0100 Subject: [PATCH] wgl: rename force-msaa env-var MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This env-var is not specific to the SVGA driver, so we should rename it for consistency. While we're at it, let's document the feature. Reviewed-by: Louis-Francis Ratté-Boulianne Reviewed-by: Jesse Natalie Part-of: --- docs/envvars.rst | 10 ++++++++++ src/gallium/frontends/wgl/stw_pixelformat.c | 12 +++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/docs/envvars.rst b/docs/envvars.rst index b8f5efb915a..39aea445b13 100644 --- a/docs/envvars.rst +++ b/docs/envvars.rst @@ -226,6 +226,16 @@ the :doc:`Xlib software driver page ` for details. :envvar:`MESA_GLX_ALPHA_BITS` specifies default number of bits for alpha channel. +Mesa WGL driver environment variables +------------------------------------- + +The following are only applicable to the Mesa WGL driver, which is in use +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. + Intel driver environment variables ---------------------------------------------------- diff --git a/src/gallium/frontends/wgl/stw_pixelformat.c b/src/gallium/frontends/wgl/stw_pixelformat.c index 5eabd24b42d..3994ab0766c 100644 --- a/src/gallium/frontends/wgl/stw_pixelformat.c +++ b/src/gallium/frontends/wgl/stw_pixelformat.c @@ -252,7 +252,17 @@ add_color_format_variants(const struct stw_pf_color_info *color_formats, * to force all pixel formats to have a particular number of samples. */ { - const char *samples= getenv("SVGA_FORCE_MSAA"); + const char *samples = getenv("WGL_FORCE_MSAA"); + if (!samples) { + static bool warned = false; + samples = getenv("SVGA_FORCE_MSAA"); + if (samples && !warned) { + fprintf(stderr, "*** SVGA_FORCE_MSAA is deprecated; " + "use WGL_FORCE_MSAA instead ***\n"); + warned = true; + } + } + if (samples) force_samples = atoi(samples); }