From c393753daa4de92f3a5937cc4abd53881efa098a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Ondra=C4=8Dka?= Date: Fri, 18 Feb 2022 11:48:23 +0100 Subject: [PATCH] r300: add predicate instructions to statistics of vertex shaders MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All of IF, ELSE, ENDIF, BREAK and CONTINUE were already translated to the predication instructions in rc_vert_fc so all the flow control we count at the moment is just BGNLOOP and ENDLOOP. Signed-off-by: Pavel Ondračka Reviewed-by: Ian Romanick Part-of: --- src/gallium/drivers/r300/compiler/radeon_compiler.c | 10 ++++++++-- src/gallium/drivers/r300/compiler/radeon_compiler.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/r300/compiler/radeon_compiler.c b/src/gallium/drivers/r300/compiler/radeon_compiler.c index 1c1232f2e45..481b10e6dfe 100644 --- a/src/gallium/drivers/r300/compiler/radeon_compiler.c +++ b/src/gallium/drivers/r300/compiler/radeon_compiler.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "util/u_debug.h" #include "pipe/p_state.h" @@ -354,6 +355,11 @@ void rc_get_stats(struct radeon_compiler *c, struct rc_program_stats *s) if (info->Opcode == RC_OPCODE_BGNLOOP) s->num_loops++; } + /* VS flow control was already translated to the predicate instructions */ + if (c->type == RC_VERTEX_PROGRAM) + if (strstr(info->Name, "PRED") != NULL) + s->num_pred_insts++; + if (info->HasTexture) s->num_tex_insts++; s->num_insts++; @@ -373,9 +379,9 @@ static void print_stats(struct radeon_compiler * c) * only the FS has, becasue shader-db's report.py wants all shaders to * have the same set. */ - pipe_debug_message(c->debug, SHADER_INFO, "%s shader: %u inst, %u vinst, %u sinst, %u flowcontrol, %u loops, %u tex, %u presub, %u omod, %u temps, %u consts, %u lits", + pipe_debug_message(c->debug, SHADER_INFO, "%s shader: %u inst, %u vinst, %u sinst, %u predicate, %u flowcontrol, %u loops, %u tex, %u presub, %u omod, %u temps, %u consts, %u lits", c->type == RC_VERTEX_PROGRAM ? "VS" : "FS", - s.num_insts, s.num_rgb_insts, s.num_alpha_insts, + s.num_insts, s.num_rgb_insts, s.num_alpha_insts, s.num_pred_insts, s.num_fc_insts, s.num_loops, s.num_tex_insts, s.num_presub_ops, s.num_omod_ops, s.num_temp_regs, s.num_consts, s.num_inline_literals); } diff --git a/src/gallium/drivers/r300/compiler/radeon_compiler.h b/src/gallium/drivers/r300/compiler/radeon_compiler.h index 3d15cb45f71..3e6029fcad7 100644 --- a/src/gallium/drivers/r300/compiler/radeon_compiler.h +++ b/src/gallium/drivers/r300/compiler/radeon_compiler.h @@ -152,6 +152,7 @@ struct rc_program_stats { unsigned num_tex_insts; unsigned num_rgb_insts; unsigned num_alpha_insts; + unsigned num_pred_insts; unsigned num_presub_ops; unsigned num_temp_regs; unsigned num_omod_ops;