summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/tgsi/tgsi_scan.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-01-12 12:01:09 -0700
committerBrian Paul <[email protected]>2009-01-19 08:51:58 -0700
commit1907135235a684872706d1a28ea8e2b4e1b6e7d3 (patch)
tree19c4fd5a5544b9ed331e8e400045f8a7274bb600 /src/gallium/auxiliary/tgsi/tgsi_scan.c
parentd3866f026a91b5aeb618dcafc311aaeff118bc3e (diff)
tgsi: change an if to an else-if, added const qual, added comments
Diffstat (limited to 'src/gallium/auxiliary/tgsi/tgsi_scan.c')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_scan.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c
index 1239f6c0765..d02205a63ef 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_scan.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c
@@ -43,6 +43,9 @@
/**
+ * Scan the given TGSI shader to collect information such as number of
+ * registers used, special instructions used, etc.
+ * \return info the result of the scan
*/
void
tgsi_scan_shader(const struct tgsi_token *tokens,
@@ -115,7 +118,7 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
{
const struct tgsi_full_declaration *fulldecl
= &parse.FullToken.FullDeclaration;
- uint file = fulldecl->Declaration.File;
+ const uint file = fulldecl->Declaration.File;
uint reg;
for (reg = fulldecl->DeclarationRange.First;
reg <= fulldecl->DeclarationRange.Last;
@@ -131,8 +134,7 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
info->input_semantic_index[reg] = (ubyte)fulldecl->Semantic.SemanticIndex;
info->num_inputs++;
}
-
- if (file == TGSI_FILE_OUTPUT) {
+ else if (file == TGSI_FILE_OUTPUT) {
info->output_semantic_name[reg] = (ubyte)fulldecl->Semantic.SemanticName;
info->output_semantic_index[reg] = (ubyte)fulldecl->Semantic.SemanticIndex;
info->num_outputs++;