summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Krol <michal@tungstengraphics.com>2008-05-02 11:13:58 +0200
committerMichal Krol <michal@tungstengraphics.com>2008-05-02 11:13:58 +0200
commita1cb0c2b915532e934b5d37bd0c550b1bfcc77ba (patch)
tree90b3851ac7be6a459a3d2404ad0f68638e9bd7ec
parent36f93c5e5159ebd99a5a4504efccdf6c5bf40716 (diff)
tgsi: Do not assume IN and OUT registers are declared sequentially.
-rw-r--r--src/gallium/auxiliary/tgsi/util/tgsi_scan.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/gallium/auxiliary/tgsi/util/tgsi_scan.c b/src/gallium/auxiliary/tgsi/util/tgsi_scan.c
index ea4a72967d..65650ed22a 100644
--- a/src/gallium/auxiliary/tgsi/util/tgsi_scan.c
+++ b/src/gallium/auxiliary/tgsi/util/tgsi_scan.c
@@ -103,18 +103,14 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
info->file_max[file] = MAX2(info->file_max[file], (int)i);
if (file == TGSI_FILE_INPUT) {
- info->input_semantic_name[info->num_inputs]
- = (ubyte)fulldecl->Semantic.SemanticName;
- info->input_semantic_index[info->num_inputs]
- = (ubyte)fulldecl->Semantic.SemanticIndex;
+ info->input_semantic_name[i] = (ubyte)fulldecl->Semantic.SemanticName;
+ info->input_semantic_index[i] = (ubyte)fulldecl->Semantic.SemanticIndex;
info->num_inputs++;
}
if (file == TGSI_FILE_OUTPUT) {
- info->output_semantic_name[info->num_outputs]
- = (ubyte)fulldecl->Semantic.SemanticName;
- info->output_semantic_index[info->num_outputs]
- = (ubyte)fulldecl->Semantic.SemanticIndex;
+ info->output_semantic_name[i] = (ubyte)fulldecl->Semantic.SemanticName;
+ info->output_semantic_index[i] = (ubyte)fulldecl->Semantic.SemanticIndex;
info->num_outputs++;
}
@@ -137,6 +133,9 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
}
}
+ assert( info->file_max[TGSI_FILE_INPUT] + 1 == info->num_inputs );
+ assert( info->file_max[TGSI_FILE_OUTPUT] + 1 == info->num_outputs );
+
info->uses_kill = (info->opcode_count[TGSI_OPCODE_KIL] ||
info->opcode_count[TGSI_OPCODE_KILP]);