[Mesa-dev] [PATCH] radeonsi: Add additional information to shader dumps
Marek Olšák
maraeo at gmail.com
Fri Feb 27 06:07:45 PST 2015
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Marek
On Fri, Feb 27, 2015 at 3:30 AM, Tom Stellard <thomas.stellard at amd.com> wrote:
> This adds SGPR count, VGPR count, shader size, LDS size, and scratch
> usage to shader dumps.
> ---
> src/gallium/drivers/radeonsi/si_shader.c | 18 ++++++++++++------
> 1 file changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
> index e6849ad..c71bdf0 100644
> --- a/src/gallium/drivers/radeonsi/si_shader.c
> +++ b/src/gallium/drivers/radeonsi/si_shader.c
> @@ -2604,17 +2604,23 @@ int si_shader_binary_read(struct si_screen *sscreen,
> bool dump = r600_can_dump_shader(&sscreen->b,
> shader->selector ? shader->selector->tokens : NULL);
>
> - if (dump && !binary->disassembled) {
> - fprintf(stderr, "SI CODE:\n");
> - for (i = 0; i < binary->code_size; i+=4 ) {
> - fprintf(stderr, "@0x%x: %02x%02x%02x%02x\n", i, binary->code[i + 3],
> + si_shader_binary_read_config(sscreen, shader, 0);
> +
> + if (dump) {
> + if (!binary->disassembled) {
> + fprintf(stderr, "SI CODE:\n");
> + for (i = 0; i < binary->code_size; i+=4 ) {
> + fprintf(stderr, "@0x%x: %02x%02x%02x%02x\n", i, binary->code[i + 3],
> binary->code[i + 2], binary->code[i + 1],
> binary->code[i]);
> + }
> }
> + fprintf(stderr, "SGPRS: %d\nVGPRS: %d\nCode Size: %d bytes\nLDS: %d blocks\n"
> + "Scratch: %d bytes per wave\n",
> + shader->num_sgprs, shader->num_vgprs, binary->code_size,
> + shader->lds_size, shader->scratch_bytes_per_wave);
> }
>
> - si_shader_binary_read_config(sscreen, shader, 0);
> -
> /* copy new shader */
> code_size = binary->code_size + binary->rodata_size;
> r600_resource_reference(&shader->bo, NULL);
> --
> 1.8.5.5
>
> _______________________________________________
> 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