summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/tgsi/tgsi_parse.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-12-07 14:12:28 -0700
committerBrian Paul <brianp@vmware.com>2009-12-08 08:14:14 -0700
commitbc7567d9665924650c43c661d07ae9a922554bee (patch)
tree941a455ad065db88568ba2e98d479e31799009d6 /src/gallium/auxiliary/tgsi/tgsi_parse.c
parent629a648b059d8a2653b6a9cdf7f460533de0e1da (diff)
tgsi: fix some off-by-one errors in shader length, instruction length
The ureg and/or tgsi-simplification work introduced some inconsistencies between the ureg and traditional TGSI construction code. Now the tgsi_instruction::NrTokens field is consistant and the tgsi_header::BodySize field isn't off by one. Fixes bug 25455.
Diffstat (limited to 'src/gallium/auxiliary/tgsi/tgsi_parse.c')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_parse.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_parse.c b/src/gallium/auxiliary/tgsi/tgsi_parse.c
index 356b4473d9..8f2b6a307d 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_parse.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_parse.c
@@ -60,7 +60,7 @@ tgsi_parse_end_of_tokens(
struct tgsi_parse_context *ctx )
{
return ctx->Position >=
- 1 + ctx->FullHeader.Header.HeaderSize + ctx->FullHeader.Header.BodySize;
+ ctx->FullHeader.Header.HeaderSize + ctx->FullHeader.Header.BodySize;
}
@@ -232,8 +232,7 @@ tgsi_num_tokens(const struct tgsi_token *tokens)
struct tgsi_parse_context ctx;
if (tgsi_parse_init(&ctx, tokens) == TGSI_PARSE_OK) {
unsigned len = (ctx.FullHeader.Header.HeaderSize +
- ctx.FullHeader.Header.BodySize +
- 1);
+ ctx.FullHeader.Header.BodySize);
return len;
}
return 0;