r300: add predicate instructions to statistics of vertex shaders

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 <pavel.ondracka@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15077>
This commit is contained in:
Pavel Ondračka 2022-02-18 11:48:23 +01:00 committed by Marge Bot
parent 8eb9bffdfc
commit c393753daa
2 changed files with 9 additions and 2 deletions

View file

@ -25,6 +25,7 @@
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#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);
}

View file

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