r300: Add consts (uniforms) count to the shader-db output.

This is one of the critical metrics for this driver.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14600>
This commit is contained in:
Emma Anholt 2021-12-26 09:23:39 -08:00 committed by Marge Bot
parent cd7b260eeb
commit 5f0bf2113e
2 changed files with 5 additions and 2 deletions

View File

@ -309,6 +309,8 @@ static void reg_count_callback(void * userdata, struct rc_instruction * inst,
(int)index > s->num_temp_regs ? s->num_temp_regs = index : 0;
if (file == RC_FILE_INLINE)
s->num_inline_literals++;
if (file == RC_FILE_CONSTANT)
s->num_consts = MAX2(s->num_consts, index + 1);
}
void rc_get_stats(struct radeon_compiler *c, struct rc_program_stats *s)
@ -368,11 +370,11 @@ 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: %d inst, %d vinst, %d sinst, %d flowcontrol, %d tex, %d presub, %d omod, %d temps, %d lits",
pipe_debug_message(c->debug, SHADER_INFO, "%s shader: %d inst, %d vinst, %d sinst, %d flowcontrol, %d tex, %d presub, %d omod, %d temps, %d consts, %d lits",
c->type == RC_VERTEX_PROGRAM ? "VS" : "FS",
s.num_insts, s.num_rgb_insts, s.num_alpha_insts,
s.num_fc_insts, s.num_tex_insts, s.num_presub_ops,
s.num_omod_ops, s.num_temp_regs, s.num_inline_literals);
s.num_omod_ops, s.num_temp_regs, s.num_consts, s.num_inline_literals);
}
static const char *shader_name[RC_NUM_PROGRAM_TYPES] = {

View File

@ -146,6 +146,7 @@ struct radeon_compiler_pass {
};
struct rc_program_stats {
unsigned num_consts;
unsigned num_insts;
unsigned num_fc_insts;
unsigned num_tex_insts;