From 3197ad5a56ee94773f974ac727b316c5adfe1b6f Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 27 Feb 2008 15:47:24 -0700 Subject: gallium: added file_max[] array to tgsi_shader_info Records the highest index of a declared register. --- src/gallium/auxiliary/tgsi/util/tgsi_scan.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/gallium/auxiliary/tgsi/util/tgsi_scan.c') diff --git a/src/gallium/auxiliary/tgsi/util/tgsi_scan.c b/src/gallium/auxiliary/tgsi/util/tgsi_scan.c index a973aeb62f..8c886edc65 100644 --- a/src/gallium/auxiliary/tgsi/util/tgsi_scan.c +++ b/src/gallium/auxiliary/tgsi/util/tgsi_scan.c @@ -46,10 +46,12 @@ void tgsi_scan_shader(const struct tgsi_token *tokens, struct tgsi_shader_info *info) { - uint procType; + uint procType, i; struct tgsi_parse_context parse; memset(info, 0, sizeof(*info)); + for (i = 0; i < TGSI_FILE_COUNT; i++) + info->file_max[i] = -1; /** ** Setup to begin parsing input shader @@ -97,6 +99,7 @@ tgsi_scan_shader(const struct tgsi_token *tokens, /* only first 32 regs will appear in this bitfield */ info->file_mask[file] |= (1 << i); info->file_count[file]++; + info->file_max[file] = MAX2(info->file_max[file], i); if (file == TGSI_FILE_INPUT) { info->input_semantic_name[info->num_inputs] -- cgit v1.2.3