summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Krol <michal@tungstengraphics.com>2008-07-15 10:56:30 +0200
committerMichal Krol <michal@tungstengraphics.com>2008-07-15 10:58:17 +0200
commitc60e009a9138a573d2219ee2ad85e3203b09a7ae (patch)
treeafecab1e30bca091426f6d3262f67e9a3547b038
parent6eb7f763fbbbb7a32640760cd5d122020866fea1 (diff)
tgsi: Numerical label before an instruction is optional.
-rw-r--r--src/gallium/auxiliary/tgsi/util/tgsi_text.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/tgsi/util/tgsi_text.c b/src/gallium/auxiliary/tgsi/util/tgsi_text.c
index 1b283feb4c8..6cab475b889 100644
--- a/src/gallium/auxiliary/tgsi/util/tgsi_text.c
+++ b/src/gallium/auxiliary/tgsi/util/tgsi_text.c
@@ -740,7 +740,10 @@ static const char *texture_names[TGSI_TEXTURE_COUNT] =
"SHADOWRECT"
};
-static boolean parse_instruction( struct translate_ctx *ctx )
+static boolean
+parse_instruction(
+ struct translate_ctx *ctx,
+ boolean has_label )
{
uint i;
uint saturate = TGSI_SAT_NONE;
@@ -767,7 +770,10 @@ static boolean parse_instruction( struct translate_ctx *ctx )
}
}
if (i == TGSI_OPCODE_LAST) {
- report_error( ctx, "Unknown opcode" );
+ if (has_label)
+ report_error( ctx, "Unknown opcode" );
+ else
+ report_error( ctx, "Expected `DCL', `IMM' or a label" );
return FALSE;
}
info = &opcode_info[i];
@@ -1025,7 +1031,7 @@ static boolean translate( struct translate_ctx *ctx )
}
if (parse_label( ctx, &label_val )) {
- if (!parse_instruction( ctx ))
+ if (!parse_instruction( ctx, TRUE ))
return FALSE;
}
else if (str_match_no_case( &ctx->cur, "DCL" )) {
@@ -1036,8 +1042,7 @@ static boolean translate( struct translate_ctx *ctx )
if (!parse_immediate( ctx ))
return FALSE;
}
- else {
- report_error( ctx, "Expected `DCL', `IMM' or a label" );
+ else if (!parse_instruction( ctx, FALSE )) {
return FALSE;
}
}