From: Marek Olšák Date: Mon, 30 Sep 2019 20:39:23 +0000 (-0400) Subject: st/mesa: deduplicate code for ATI fs in st_program_string_notify X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ab843a3702742977f51c9dea42d55c8ed805f8b9;p=mesa.git st/mesa: deduplicate code for ATI fs in st_program_string_notify Reviewed-by: Timothy Arceri --- diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c index f1c62187a95..2d47af9b363 100644 --- a/src/mesa/state_tracker/st_cb_program.c +++ b/src/mesa/state_tracker/st_cb_program.c @@ -163,9 +163,17 @@ st_program_string_notify( struct gl_context *ctx, struct st_context *st = st_context(ctx); gl_shader_stage stage = _mesa_program_enum_to_shader_stage(target); - if (target == GL_FRAGMENT_PROGRAM_ARB) { + if (target == GL_FRAGMENT_PROGRAM_ARB || + target == GL_FRAGMENT_SHADER_ATI) { struct st_fragment_program *stfp = (struct st_fragment_program *) prog; + if (target == GL_FRAGMENT_SHADER_ATI) { + assert(stfp->ati_fs); + assert(stfp->ati_fs->Program == prog); + + st_init_atifs_prog(ctx, prog); + } + st_release_fp_variants(st, stfp); if (!st_translate_fragment_program(st, stfp)) return false; @@ -229,22 +237,6 @@ st_program_string_notify( struct gl_context *ctx, if (st->cp == stcp) st->dirty |= stcp->affected_states; } - else if (target == GL_FRAGMENT_SHADER_ATI) { - assert(prog); - - struct st_fragment_program *stfp = (struct st_fragment_program *) prog; - assert(stfp->ati_fs); - assert(stfp->ati_fs->Program == prog); - - st_init_atifs_prog(ctx, prog); - - st_release_fp_variants(st, stfp); - if (!st_translate_fragment_program(st, stfp)) - return false; - - if (st->fp == stfp) - st->dirty |= stfp->affected_states; - } if (ST_DEBUG & DEBUG_PRECOMPILE || st->shader_has_one_variant[stage])