mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 02:00:12 +01:00
tgsi: fix tgsi transform's epilog callback
We want to call the caller's epilog callback when we find the TGSI END instruction, not after it. Reviewed-by: Charmaine Lee <charmainel@vmware.com>
This commit is contained in:
parent
b16bb3f50f
commit
9e0160fc58
1 changed files with 15 additions and 7 deletions
|
|
@ -171,10 +171,22 @@ tgsi_transform_shader(const struct tgsi_token *tokens_in,
|
|||
ctx->prolog(ctx);
|
||||
}
|
||||
|
||||
if (ctx->transform_instruction)
|
||||
ctx->transform_instruction(ctx, fullinst);
|
||||
else
|
||||
/* XXX Note: we may also want to look for a main/top-level
|
||||
* TGSI_OPCODE_RET instruction in the future.
|
||||
*/
|
||||
if (fullinst->Instruction.Opcode == TGSI_OPCODE_END
|
||||
&& ctx->epilog) {
|
||||
/* Emit caller's epilog */
|
||||
ctx->epilog(ctx);
|
||||
/* Emit END */
|
||||
ctx->emit_instruction(ctx, fullinst);
|
||||
}
|
||||
else {
|
||||
if (ctx->transform_instruction)
|
||||
ctx->transform_instruction(ctx, fullinst);
|
||||
else
|
||||
ctx->emit_instruction(ctx, fullinst);
|
||||
}
|
||||
|
||||
first_instruction = FALSE;
|
||||
}
|
||||
|
|
@ -220,10 +232,6 @@ tgsi_transform_shader(const struct tgsi_token *tokens_in,
|
|||
}
|
||||
}
|
||||
|
||||
if (ctx->epilog) {
|
||||
ctx->epilog(ctx);
|
||||
}
|
||||
|
||||
tgsi_parse_free (&parse);
|
||||
|
||||
return ctx->ti;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue