summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian <brian@i915.localnet.net>2008-02-27 15:47:24 -0700
committerBrian <brian@i915.localnet.net>2008-02-27 15:47:24 -0700
commit3197ad5a56ee94773f974ac727b316c5adfe1b6f (patch)
treed5865b46cfeeb350cdf94609596c7b5daf9b841b
parent0e1e1f12f47d5b1d49f68930b05eadf1143e1396 (diff)
gallium: added file_max[] array to tgsi_shader_info
Records the highest index of a declared register.
-rw-r--r--src/gallium/auxiliary/tgsi/util/tgsi_scan.c5
-rw-r--r--src/gallium/auxiliary/tgsi/util/tgsi_scan.h1
2 files changed, 5 insertions, 1 deletions
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]
diff --git a/src/gallium/auxiliary/tgsi/util/tgsi_scan.h b/src/gallium/auxiliary/tgsi/util/tgsi_scan.h
index d10d300c4d..563ee900fa 100644
--- a/src/gallium/auxiliary/tgsi/util/tgsi_scan.h
+++ b/src/gallium/auxiliary/tgsi/util/tgsi_scan.h
@@ -51,6 +51,7 @@ struct tgsi_shader_info
uint file_mask[TGSI_FILE_COUNT]; /**< bitmask of declared registers */
uint file_count[TGSI_FILE_COUNT]; /**< number of declared registers */
+ int file_max[TGSI_FILE_COUNT]; /**< highest index of declared registers */
uint immediate_count; /**< number of immediates declared */