From 732f69c94e17aae8dae98cdc84fdb232fdda2484 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Mon, 23 Jan 2012 13:26:04 +0100 Subject: st/mesa: move fragment shader tgsi tokens into st_fp_variant The TGSI code may vary depending on the clamp_color bit. --- src/mesa/state_tracker/st_program.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/mesa/state_tracker/st_program.c') diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 3ae79ddbf4b..978de88f054 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -110,7 +110,8 @@ delete_fp_variant(struct st_context *st, struct st_fp_variant *fpv) cso_delete_fragment_shader(st->cso_context, fpv->driver_shader); if (fpv->parameters) _mesa_free_parameter_list(fpv->parameters); - + if (fpv->tgsi.tokens) + st_free_tokens(fpv->tgsi.tokens); FREE(fpv); } @@ -741,16 +742,16 @@ st_translate_fragment_program(struct st_context *st, fs_output_semantic_index, FALSE, key->clamp_color); - stfp->tgsi.tokens = ureg_get_tokens( ureg, NULL ); + variant->tgsi.tokens = ureg_get_tokens( ureg, NULL ); ureg_destroy( ureg ); } /* fill in variant */ - variant->driver_shader = pipe->create_fs_state(pipe, &stfp->tgsi); + variant->driver_shader = pipe->create_fs_state(pipe, &variant->tgsi); variant->key = *key; if (ST_DEBUG & DEBUG_TGSI) { - tgsi_dump( stfp->tgsi.tokens, 0/*TGSI_DUMP_VERBOSE*/ ); + tgsi_dump( variant->tgsi.tokens, 0/*TGSI_DUMP_VERBOSE*/ ); debug_printf("\n"); } -- cgit v1.2.3