mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 06:48:06 +02:00
st/mesa: deduplicate code for ATI fs in st_program_string_notify
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
This commit is contained in:
parent
b596bb5b66
commit
ab843a3702
1 changed files with 9 additions and 17 deletions
|
|
@ -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])
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue