summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/tgsi/tgsi_parse.c
diff options
context:
space:
mode:
authorMichal Krol <michal@vmware.com>2009-12-23 18:33:44 +0100
committerMichal Krol <michal@vmware.com>2010-01-05 09:27:10 +0100
commitff56a12051a91c5c69db9afb85e4a3ebdb17ef96 (patch)
tree6769ddb415d181f6cdbfc841590e76c7c26bd788 /src/gallium/auxiliary/tgsi/tgsi_parse.c
parentb1c55e80aa600c88a20117cdca4bde2a46f79730 (diff)
tgsi: Support signed/unsigned integer immediate types.
Diffstat (limited to 'src/gallium/auxiliary/tgsi/tgsi_parse.c')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_parse.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_parse.c b/src/gallium/auxiliary/tgsi/tgsi_parse.c
index fa65ecb997..8c7062d850 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_parse.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_parse.c
@@ -119,17 +119,29 @@ tgsi_parse_token(
case TGSI_TOKEN_TYPE_IMMEDIATE:
{
struct tgsi_full_immediate *imm = &ctx->FullToken.FullImmediate;
+ uint imm_count;
memset(imm, 0, sizeof *imm);
copy_token(&imm->Immediate, &token);
+ imm_count = imm->Immediate.NrTokens - 1;
+
switch (imm->Immediate.DataType) {
case TGSI_IMM_FLOAT32:
- {
- uint imm_count = imm->Immediate.NrTokens - 1;
- for (i = 0; i < imm_count; i++) {
- next_token(ctx, &imm->u[i]);
- }
+ for (i = 0; i < imm_count; i++) {
+ next_token(ctx, &imm->u[i].Float);
+ }
+ break;
+
+ case TGSI_IMM_UINT32:
+ for (i = 0; i < imm_count; i++) {
+ next_token(ctx, &imm->u[i].Uint);
+ }
+ break;
+
+ case TGSI_IMM_INT32:
+ for (i = 0; i < imm_count; i++) {
+ next_token(ctx, &imm->u[i].Int);
}
break;