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

Ian Romanick idr at freedesktop.org
Fri Mar 15 12:33:39 PDT 2013


On 03/15/2013 12:04 PM, Eric Anholt wrote:
> This was taking 5% of CPU on TF2's load time.

Crap... I thought we already only did this in debug mode.  The series is

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

> ---
>   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;
>



More information about the mesa-dev mailing list