[Mesa-dev] [PATCH 10/25] radeonsi: add code for dumping all shader parts together
Michel Dänzer
michel at daenzer.net
Tue Feb 16 03:12:09 UTC 2016
On 16.02.2016 08:59, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at 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
More information about the mesa-dev
mailing list