[Mesa-dev] [RFC PATCH] mesa: Add MESA_SHADER_CAPTURE_PATH for writing .shader_test files.

Kenneth Graunke kenneth at whitecape.org
Mon Jan 18 07:09:01 PST 2016


On Monday, January 18, 2016 7:05:21 AM PST Kenneth Graunke wrote:
> diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
> index 126786c..030d9a1 100644
> --- a/src/mesa/main/shaderapi.c
> +++ b/src/mesa/main/shaderapi.c
> @@ -96,6 +96,20 @@ _mesa_get_shader_flags(void)
>     return flags;
>  }
>  
> +/**
> + * Memoized version of getenv("MESA_SHADER_CAPTURE_PATH").
> + */
> +const char *
> +_mesa_get_shader_capture_path(void)
> +{
> +   static bool read_env_var = false;
> +   static const char *path = NULL;
> +
> +   if (!read_env_var)
> +      path = getenv("MESA_SHADER_CAPTURE_PATH");

This should of course be

   if (!read_env_var) {
      path = getenv("MESA_SHADER_CAPTURE_PATH");
      read_env_var = true;
   }

Fixed in v7 (in the 'dumptofiles' branch of ~kwg/mesa).

> +
> +   return path;
> +}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20160118/e120c7d9/attachment-0001.sig>


More information about the mesa-dev mailing list