gallium: Reallocate pipe_texture in st_TexImage if the texture object was used.
authorMichel Dänzer <michel@tungstengraphics.com>
Fri, 2 May 2008 15:22:20 +0000 (16:22 +0100)
committerMichel Dänzer <michel@tungstengraphics.com>
Fri, 2 May 2008 15:22:20 +0000 (16:22 +0100)
Fixes problems with interleaved glTexImage and rendering calls.

src/mesa/state_tracker/st_atom_texture.c
src/mesa/state_tracker/st_cb_texture.c
src/mesa/state_tracker/st_texture.h

index f42b2f8d662d659e5ead788175c0ce70d1219473..767654f3d0ff9a940ad5c32253fc058eaf3bde96 100644 (file)
@@ -90,6 +90,8 @@ update_textures(struct st_context *st)
             }
 
             st->state.num_textures = su + 1;
+
+            stObj->teximage_realloc = TRUE;
          }
 
          pt = st_get_stobj_texture(stObj);
index 5fd192a8b801411c9df815f09533dae0164e57c8..80122546fce6a162b26a1366077ecb03658fd3e8 100644 (file)
@@ -556,15 +556,17 @@ st_TexImage(GLcontext * ctx,
     * waiting on any outstanding fences.
     */
    if (stObj->pt &&
-       /*stObj->pt->first_level == level &&*/
-       stObj->pt->last_level == level &&
-       stObj->pt->target != PIPE_TEXTURE_CUBE &&
-       !st_texture_match_image(stObj->pt, &stImage->base,
-                                  stImage->face, stImage->level)) {
+       (stObj->teximage_realloc ||
+        (/*stObj->pt->first_level == level &&*/
+         stObj->pt->last_level == level &&
+         stObj->pt->target != PIPE_TEXTURE_CUBE &&
+         !st_texture_match_image(stObj->pt, &stImage->base,
+                                 stImage->face, stImage->level)))) {
 
       DBG("release it\n");
       pipe_texture_release(&stObj->pt);
       assert(!stObj->pt);
+      stObj->teximage_realloc = FALSE;
    }
 
    if (!stObj->pt) {
index 7abccb3a69faa1bd9db34616d0f58afad354fd97..b05762113ccf20b1c181757b584a0fff774adbbd 100644 (file)
@@ -68,9 +68,7 @@ struct st_texture_object
     */
    struct pipe_texture *pt;
 
-   GLboolean imageOverride;
-   GLint depthOverride;
-   GLuint pitchOverride;
+   GLboolean teximage_realloc;
 };