gallium: fix update_textures() bug in pipe_texture binding logic
authorBrian Paul <brian.paul@tungstengraphics.com>
Fri, 29 Feb 2008 22:38:43 +0000 (15:38 -0700)
committerBrian Paul <brian.paul@tungstengraphics.com>
Fri, 29 Feb 2008 22:38:43 +0000 (15:38 -0700)
The 'st' pointer might not have changed, but st->pt might have.  The dirtyData flag
will indicate when that's happened, so check it.

src/mesa/state_tracker/st_atom_texture.c

index a4ac72681608f85eb0974205d60d4f961c99ea76..0e1c396aeb210787c1766482bd563425411bcec5 100644 (file)
@@ -67,7 +67,9 @@ update_textures(struct st_context *st)
        * this table before being deleted, otherwise the pointer
        * comparison below could fail.
        */
-      if (st->state.sampler_texture[unit] != stObj) {
+      if (st->state.sampler_texture[unit] != stObj ||
+          (stObj && stObj->dirtyData)) {
+         /* should really test if the bound 'pt' is changing */
          struct pipe_texture *pt = st_get_stobj_texture(stObj);
          st->state.sampler_texture[unit] = stObj;
          st->pipe->set_sampler_texture(st->pipe, unit, pt);