diff options
Diffstat (limited to 'src/mesa/state_tracker/st_atom_texture.c')
-rw-r--r-- | src/mesa/state_tracker/st_atom_texture.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c index 2a836d630b..697d2cdfb4 100644 --- a/src/mesa/state_tracker/st_atom_texture.c +++ b/src/mesa/state_tracker/st_atom_texture.c @@ -34,6 +34,7 @@ #include "st_context.h" #include "st_atom.h" +#include "st_texture.h" #include "st_cb_texture.h" #include "pipe/p_context.h" @@ -53,6 +54,7 @@ update_textures(struct st_context *st) for (unit = 0; unit < st->ctx->Const.MaxTextureCoordUnits; unit++) { const GLuint su = fprog->Base.SamplerUnits[unit]; struct gl_texture_object *texObj = st->ctx->Texture.Unit[su]._Current; + struct st_texture_object *stObj = st_texture_object(texObj); struct pipe_texture *pt; if (texObj) { @@ -60,21 +62,25 @@ update_textures(struct st_context *st) retval = st_finalize_texture(st->ctx, st->pipe, texObj, &flush); /* XXX retval indicates whether there's a texture border */ - - pt = st_get_texobj_texture(texObj); - } - else { - pt = NULL; } /* XXX: need to ensure that textures are unbound/removed from * this table before being deleted, otherwise the pointer * comparison below could fail. */ + + pt = st_get_stobj_texture(stObj); + if (st->state.sampler_texture[unit] != pt) { - st->state.sampler_texture[unit] = pt; - st->pipe->set_sampler_texture(st->pipe, unit, pt); + st->state.sampler_texture[unit] = pt; + st->pipe->set_sampler_texture(st->pipe, unit, pt); } + + if (stObj && stObj->dirtyData) { + st->pipe->texture_update(st->pipe, pt); + stObj->dirtyData = GL_FALSE; + } + } } |