[Mesa-dev] [PATCH 3/3] mesa: Stop calling ProgramStringNotify when SamplerUnits changes.

Marek Olšák maraeo at gmail.com
Wed Jan 11 03:25:12 PST 2012


I actually made this change locally when I found the issue with shader
recompilations, so this is:

Tested-by: Marek Olšák <maraeo at gmail.com>

On Wed, Jan 11, 2012 at 10:55 AM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> This rather rudely told the driver the moral equivalent of "Your shader
> code changed in an unimaginable way---don't assume anything; recompile!"
>
> The i965 driver used to rely on this in order to recompile the program
> when SamplerUnits changed.  It now properly listens to _NEW_PROGRAM and
> _NEW_TEXTURE, which this code flags, and does the right thing.
>
> According to Marek, st/mesa doesn't need nor want a ProgramStringNotify
> here.  The classic radeon, r200, and nouveau drivers don't use the
> SamplerUnits array, so they should be unaffected.
>
> (Unfortunately I think i915 may still rely on this :( Ian/Eric, can you
>  confirm or deny that?  It doesn't seem to have any of the program
>  caching, which seems rather horrible...)
>
> Cc: Eric Anholt <eric at anholt.net>
> Cc: Ian Romanick <idr at freedesktop.org>
> Cc: Marek Olšák <maraeo at gmail.com>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/mesa/main/uniform_query.cpp |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
>
> This has survived a piglit run on Sandybridge, as well as basic openarena
> and Cogs functionality.  It hasn't received testing on other platforms.
>
> diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
> index f3d6a16..8c96117 100644
> --- a/src/mesa/main/uniform_query.cpp
> +++ b/src/mesa/main/uniform_query.cpp
> @@ -729,7 +729,6 @@ _mesa_uniform(struct gl_context *ctx, struct gl_shader_program *shProg,
>                   sizeof(shProg->SamplerUnits));
>
>            _mesa_update_shader_textures_used(prog);
> -           (void) ctx->Driver.ProgramStringNotify(ctx, prog->Target, prog);
>         }
>       }
>    }
> --
> 1.7.7.5
>


More information about the mesa-dev mailing list