[Mesa-dev] [PATCH 1/3] glsl: delay optimisations on individual shaders when cache is available

Matt Turner mattst88 at gmail.com
Mon Mar 27 04:28:22 UTC 2017


On Sun, Mar 26, 2017 at 8:14 PM, Timothy Arceri <tarceri at itsqueeze.com> wrote:
> Due to a max limit of 65,536 entries on the index table that we use to
> decide if we can skip compiling individual shaders, it is very likely
> we will have collisions.
>
> To avoid doing too much work when the linked program may be in the
> cache this patch delays calling the optimisations until link time.
>
> Improves cold cache start-up times on Deus Ex by ~20 seconds.
>
> When deleting the cache index to simulate a worst case scenario
> of colisions in the index, warm cache start-up time improve by
> ~45 seconds.
> ---
>  src/compiler/glsl/glsl_parser_extras.cpp | 169 +++++++++++++++++--------------
>  src/compiler/glsl/shader_cache.cpp       |   2 +-
>  src/mesa/main/mtypes.h                   |   3 +-
>  3 files changed, 98 insertions(+), 76 deletions(-)
>
> diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp
> index 8b5df3b..7fc35df 100644
> --- a/src/compiler/glsl/glsl_parser_extras.cpp
> +++ b/src/compiler/glsl/glsl_parser_extras.cpp
> @@ -1914,20 +1914,101 @@ static void
>  do_late_parsing_checks(struct _mesa_glsl_parse_state *state)
>  {
>     if (state->stage == MESA_SHADER_COMPUTE && !state->has_compute_shader()) {
>        YYLTYPE loc;
>        memset(&loc, 0, sizeof(loc));
>        _mesa_glsl_error(&loc, state, "Compute shaders require "
>                         "GLSL 4.30 or GLSL ES 3.10");
>     }
>  }
>
> +static void
> +opt_shader_and_create_symbol_table(struct gl_context *ctx,
> +                                  struct gl_shader *shader)

Indentation is bad on the line (tabs?)


More information about the mesa-dev mailing list