diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/state_tracker/st_atom_shader.c | 4 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_program.c | 22 |
2 files changed, 22 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c index 46f2bd7e3bf..b5ba33a4884 100644 --- a/src/mesa/state_tracker/st_atom_shader.c +++ b/src/mesa/state_tracker/st_atom_shader.c @@ -108,7 +108,9 @@ st_update_fp( struct st_context *st ) if (st->shader_has_one_variant[MESA_SHADER_FRAGMENT] && !stfp->ati_fs && /* ATI_fragment_shader always has multiple variants */ !stfp->Base.ExternalSamplersUsed && /* external samplers need variants */ - stfp->variants) { + stfp->variants && + !stfp->variants->key.drawpixels && + !stfp->variants->key.bitmap) { shader = stfp->variants->driver_shader; } else { memset(&key, 0, sizeof(key)); diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 6b6d41536cf..41ebfa9003f 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -1248,9 +1248,25 @@ st_get_fp_variant(struct st_context *st, /* create new */ fpv = st_create_fp_variant(st, stfp, key); if (fpv) { - /* insert into list */ - fpv->next = stfp->variants; - stfp->variants = fpv; + if (key->bitmap || key->drawpixels) { + /* Regular variants should always come before the + * bitmap & drawpixels variants, (unless there + * are no regular variants) so that + * st_update_fp can take a fast path when + * shader_has_one_variant is set. + */ + if (!stfp->variants) { + stfp->variants = fpv; + } else { + /* insert into list after the first one */ + fpv->next = stfp->variants->next; + stfp->variants->next = fpv; + } + } else { + /* insert into list */ + fpv->next = stfp->variants; + stfp->variants = fpv; + } } } |