mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-17 13:30:20 +01:00
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 <charmainel@vmware.com>
This commit is contained in:
parent
2826212dc7
commit
b16bb3f50f
2 changed files with 13 additions and 0 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -56,6 +56,12 @@ struct tgsi_transform_context
|
|||
void (*transform_property)(struct tgsi_transform_context *ctx,
|
||||
struct tgsi_full_property *prop);
|
||||
|
||||
/**
|
||||
* Called after last declaration, before first instruction. This is
|
||||
* where the user might insert new declarations and/or instructions.
|
||||
*/
|
||||
void (*prolog)(struct tgsi_transform_context *ctx);
|
||||
|
||||
/**
|
||||
* Called at end of input program to allow caller to append extra
|
||||
* instructions. Return number of tokens emitted.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue