summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/tgsi/tgsi_transform.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2014-03-14 14:49:33 -0600
committerBrian Paul <[email protected]>2014-09-22 16:56:23 -0600
commitb16bb3f50f0d71f7e720c4feefcb86e15090d52f (patch)
treefc8288e79f28b9a348961e953b55622e6e6042ee /src/gallium/auxiliary/tgsi/tgsi_transform.c
parent2826212dc79b90fcb008b72e5c1fdc34e8a1ac71 (diff)
tgsi: add prolog() method to tgsi_transform_context
Called when the user can insert new decls, instructions. This could be used in a few places in the 'draw' module. Reviewed-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/tgsi/tgsi_transform.c')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_transform.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_transform.c b/src/gallium/auxiliary/tgsi/tgsi_transform.c
index b16d29661f3..93e5b98c915 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_transform.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_transform.c
@@ -109,6 +109,7 @@ tgsi_transform_shader(const struct tgsi_token *tokens_in,
struct tgsi_transform_context *ctx)
{
uint procType;
+ boolean first_instruction = TRUE;
/* input shader */
struct tgsi_parse_context parse;
@@ -166,10 +167,16 @@ tgsi_transform_shader(const struct tgsi_token *tokens_in,
struct tgsi_full_instruction *fullinst
= &parse.FullToken.FullInstruction;
+ if (first_instruction && ctx->prolog) {
+ ctx->prolog(ctx);
+ }
+
if (ctx->transform_instruction)
ctx->transform_instruction(ctx, fullinst);
else
ctx->emit_instruction(ctx, fullinst);
+
+ first_instruction = FALSE;
}
break;