[Mesa-dev] [PATCH] st/mesa: disable the shader cache if dumping shaders

Timothy Arceri tarceri at itsqueeze.com
Sun Mar 12 21:56:50 UTC 2017


Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>

On 13/03/17 04:16, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> otherwise, cached shaders aren't dumped.
> ---
>  src/mesa/state_tracker/st_context.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
> index 5855258..a528f34 100644
> --- a/src/mesa/state_tracker/st_context.c
> +++ b/src/mesa/state_tracker/st_context.c
> @@ -323,23 +323,20 @@ st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe,
>     uint i;
>     struct st_context *st = ST_CALLOC_STRUCT( st_context );
>
>     st->options = *options;
>
>     ctx->st = st;
>
>     st->ctx = ctx;
>     st->pipe = pipe;
>
> -   /* XXX: this is one-off, per-screen init: */
> -   st_debug_init();
> -
>     /* state tracker needs the VBO module */
>     _vbo_CreateContext(ctx);
>
>     st->dirty = ST_ALL_STATES_MASK;
>
>     st->has_user_constbuf =
>        screen->get_param(screen, PIPE_CAP_USER_CONSTANT_BUFFERS);
>
>     /* Drivers still have to upload zero-stride vertex attribs manually
>      * with the GL core profile, but they don't have to deal with any complex
> @@ -529,21 +526,24 @@ struct st_context *st_create_context(gl_api api, struct pipe_context *pipe,
>
>     ctx = calloc(1, sizeof(struct gl_context));
>     if (!ctx)
>        return NULL;
>
>     if (!_mesa_initialize_context(ctx, api, visual, shareCtx, &funcs)) {
>        free(ctx);
>        return NULL;
>     }
>
> -   if (pipe->screen->get_disk_shader_cache)
> +   st_debug_init();
> +
> +   if (pipe->screen->get_disk_shader_cache &&
> +       !(ST_DEBUG & DEBUG_TGSI))
>        ctx->Cache = pipe->screen->get_disk_shader_cache(pipe->screen);
>
>     st_init_driver_flags(&ctx->DriverFlags);
>
>     /* XXX: need a capability bit in gallium to query if the pipe
>      * driver prefers DP4 or MUL/MAD for vertex transformation.
>      */
>     if (debug_get_option_mesa_mvp_dp4())
>        ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].OptimizeForAOS = GL_TRUE;
>
>


More information about the mesa-dev mailing list