diff options
author | Brian <[email protected]> | 2008-02-20 11:20:25 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2008-02-20 11:20:25 -0700 |
commit | 58edb0683db45c449b219988a8715cf8fd69e42d (patch) | |
tree | 1797c58be2dfa6768673e8542a754797d37065e4 /src/mesa/state_tracker/st_atom_texture.c | |
parent | 22a0b85eaebf767f5b03bf899596e09f5cc03876 (diff) |
gallium: state tracker didn't always notify drivers of texobj data changes
Calling glTexSubImage() or glTexImage() to replace texture data didn't
reliably cause pipe->set_sampler_texture() to get called so drivers didn't
always get notified of new texture data.
The st_texture_object->pt pointer doesn't always indicate changed data so
added a dirtyData field.
Diffstat (limited to 'src/mesa/state_tracker/st_atom_texture.c')
-rw-r--r-- | src/mesa/state_tracker/st_atom_texture.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c index 2a836d630b2..9fead7e314d 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,27 +54,26 @@ 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 pipe_texture *pt; + struct st_texture_object *stObj = st_texture_object(texObj); if (texObj) { GLboolean flush, retval; 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. */ - if (st->state.sampler_texture[unit] != pt) { - st->state.sampler_texture[unit] = pt; - st->pipe->set_sampler_texture(st->pipe, unit, pt); + if (st->state.sampler_texture[unit] != stObj || + (stObj && stObj->dirtyData)) { + struct pipe_texture *pt = st_get_stobj_texture(stObj); + st->state.sampler_texture[unit] = stObj; + st->pipe->set_sampler_texture(st->pipe, unit, pt); + if (stObj) + stObj->dirtyData = GL_FALSE; } } } |