[Mesa-dev] [PATCH] swrast: Only avoid empty _TexEnvPrograms

Chad Versace chad.versace at linux.intel.com
Tue Feb 14 11:03:05 PST 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/14/2012 10:51 AM, Ian Romanick wrote:
> From: Ian Romanick <ian.d.romanick at intel.com>
> 
> If the generated shader for _TexEnvProgram is empty, force the use of
> the fixed-function code.  Otherwise, go ahead and use the shader.
> This works around a mysterious issue on i915 where fixed-function
> software fallbacks are not working correctly.
> 
> This isn't really the fix we want, but it works around the issue.
> 
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45872
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45876
> ---
>  src/mesa/swrast/s_fragprog.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c
> index cd20d8e..8d59371 100644
> --- a/src/mesa/swrast/s_fragprog.c
> +++ b/src/mesa/swrast/s_fragprog.c
> @@ -40,7 +40,8 @@ GLboolean
>  _swrast_use_fragment_program(struct gl_context *ctx)
>  {
>     struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
> -   return fp && fp != ctx->FragmentProgram._TexEnvProgram;
> +   return fp && !(fp == ctx->FragmentProgram._TexEnvProgram
> +                  && fp->Base.NumInstructions == 0);
>  }
>  
>  /**

In the original, uncommitted version of this utility function, I had
it check that `fp->Base.NumInstructions != 0`. So I see no problem
reintroducing that check.

Reviewed-by: Chad Versace <chad.versace at linux.intel.com>

- ----
Chad Versace
chad.versace at linux.intel.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJPOq/fAAoJEAIvNt057x8iqaIQAIIZlhpZwkLeVAvnUn8t5rcc
nzITFyvsXsRHYRWvgNuxubLNyilR8uNelsswConE0CSDRVh7ptx73S4415fckaaN
5lbJS51wRqWkPWzjYn6aVvA4xjVDRzOC4FG1uuWYfg2Te44rxxV558zIYQPv1g9Z
UvQYwadZaQB15jTq9HE7tpDTHiYIr89EgUH0AaM471rDwTU/sOuUEbO5a5UtAd+p
t5MQLsZHQa9jv7HZc3yaf0NKXR8jhPkcibJKwU5lXV0jahDZS+1UoZDiSxYqJGDx
dHZR12PBILUpQUyxIihpS1zONTPjG08tzheRtXZ/Bt8CqbXWIubp7VqdZXrSat4Z
HgOn175ysURwgpvbn50MzgTpVb0scrUGzos8jZkqP4Nt7WaBnW0ndXdjGYeyhxN7
uAe30VtlsUrrwUNGGSBTqW8wCzRYUbcpS3VvOtWXMlZbXiGxEwckT7oc3ZdRJPuV
UXJ8V3OPvWinWLou8aHoNfSir5GWjtfwvM4olnpW+Mg6znXiLSgbsIBqdmD99GsB
tuOqfep/a2nl8bCbxe/OhaTgxdvktzKtMZZGaxfl/wiZCEXCWfMUPNva8N5er/69
5RB/ctBUNPrtmShb5dnhiAfv7Brtr221pr6w8LxOOEVomHdURCeopYc2nEySl0AN
l/s3OyzFQqLYIkjO5JZH
=wCYS
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list