diff --git a/src/gallium/drivers/r300/compiler/radeon_compiler.c b/src/gallium/drivers/r300/compiler/radeon_compiler.c index c1bcedd3889..992d400f199 100644 --- a/src/gallium/drivers/r300/compiler/radeon_compiler.c +++ b/src/gallium/drivers/r300/compiler/radeon_compiler.c @@ -378,7 +378,7 @@ reg_count_callback(void *userdata, struct rc_instruction *inst, rc_register_file unsigned int index, unsigned int mask) { struct rc_program_stats *s = userdata; - if (file == RC_FILE_TEMPORARY) + if (file == RC_FILE_TEMPORARY || (s->type == RC_FRAGMENT_PROGRAM && file == RC_FILE_INPUT)) (int)index > s->num_temp_regs ? s->num_temp_regs = index : 0; if (file == RC_FILE_INLINE) s->num_inline_literals++; @@ -391,6 +391,7 @@ rc_get_stats(struct radeon_compiler *c, struct rc_program_stats *s) { struct rc_instruction *tmp; memset(s, 0, sizeof(*s)); + s->type = c->type; unsigned ip = 0; int last_begintex = -1; diff --git a/src/gallium/drivers/r300/compiler/radeon_compiler.h b/src/gallium/drivers/r300/compiler/radeon_compiler.h index f02b9551801..30683ed6871 100644 --- a/src/gallium/drivers/r300/compiler/radeon_compiler.h +++ b/src/gallium/drivers/r300/compiler/radeon_compiler.h @@ -130,6 +130,7 @@ struct radeon_compiler_pass { }; struct rc_program_stats { + enum rc_program_type type; unsigned num_cycles; unsigned num_consts; unsigned num_insts;