diff options
Diffstat (limited to 'lib/mesa/src/gallium/auxiliary')
-rw-r--r-- | lib/mesa/src/gallium/auxiliary/tgsi/tgsi_emulate.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_emulate.c b/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_emulate.c index 806e90c2d..59d2e4c95 100644 --- a/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_emulate.c +++ b/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_emulate.c @@ -140,6 +140,7 @@ const struct tgsi_token * tgsi_emulate(const struct tgsi_token *tokens, unsigned flags) { struct tgsi_emulation_context ctx; + struct tgsi_token *newtoks; int newlen; if (!(flags & (TGSI_EMU_CLAMP_COLOR_OUTPUTS | @@ -159,6 +160,10 @@ tgsi_emulate(const struct tgsi_token *tokens, unsigned flags) ctx.base.transform_instruction = transform_instr; newlen = tgsi_num_tokens(tokens) + 20; + newtoks = tgsi_alloc_tokens(newlen); + if (!newtoks) + return NULL; - return tgsi_transform_shader(tokens, newlen, &ctx.base); + tgsi_transform_shader(tokens, newtoks, newlen, &ctx.base); + return newtoks; } |