On 16.02.2016 08:59, Marek Olšák wrote:
> From: Marek Olšák <marek.ol...@amd.com>

[...]

> @@ -4199,13 +4200,27 @@ static void si_shader_dump_stats(struct si_screen 
> *sscreen,
>  void si_shader_dump(struct si_screen *sscreen, struct si_shader *shader,
>                   struct pipe_debug_callback *debug, unsigned processor)
>  {
> -     if (r600_can_dump_shader(&sscreen->b, processor))
> -             if (!(sscreen->b.debug_flags & DBG_NO_ASM))
> -                     si_shader_dump_disassembly(&shader->binary, debug);
> +     unsigned code_size =
> +             (shader->prolog ? shader->prolog->binary.code_size : 0) +
> +             shader->binary.code_size +
> +             (shader->epilog ? shader->epilog->binary.code_size : 0);

This code is a bit messy and duplicated in at least two places. I'd
suggest factoring this out into a helper function which uses normal if
statements instead of ternary operators.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to