[Mesa-dev] [PATCH 1/2] mesa: Don't validate IR trees on non-debug builds.

Jordan Justen jljusten at gmail.com
Fri Mar 15 17:26:03 PDT 2013


On Fri, Mar 15, 2013 at 12:04 PM, Eric Anholt <eric at anholt.net> wrote:
> This was taking 5% of CPU on TF2's load time.

Seems like a candidate for stable.

-Jordan

> ---
>  src/mesa/program/ir_to_mesa.cpp |    4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
> index 2cb5f02..ae9c0cd 100644
> --- a/src/mesa/program/ir_to_mesa.cpp
> +++ b/src/mesa/program/ir_to_mesa.cpp
> @@ -3114,7 +3114,9 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader)
>        _mesa_ast_to_hir(shader->ir, state);
>
>     if (!state->error && !shader->ir->is_empty()) {
> +#ifdef DEBUG
>        validate_ir_tree(shader->ir);
> +#endif
>
>        /* Do some optimization at compile time to reduce shader IR size
>         * and reduce later work if the same shader is linked multiple times
> @@ -3122,7 +3124,9 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader)
>        while (do_common_optimization(shader->ir, false, false, 32))
>          ;
>
> +#ifdef DEBUG
>        validate_ir_tree(shader->ir);
> +#endif
>     }
>
>     shader->symbols = state->symbols;
> --
> 1.7.10.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list