gallium: Reallocate pipe_texture in st_TexImage if the texture object was used.

Fixes problems with interleaved glTexImage and rendering calls.
This commit is contained in:
Michel Dänzer
2008-05-02 16:22:20 +01:00
parent be8a42b4fc
commit d4074c509b
3 changed files with 10 additions and 8 deletions

View File

@@ -90,6 +90,8 @@ update_textures(struct st_context *st)
} }
st->state.num_textures = su + 1; st->state.num_textures = su + 1;
stObj->teximage_realloc = TRUE;
} }
pt = st_get_stobj_texture(stObj); pt = st_get_stobj_texture(stObj);

View File

@@ -556,15 +556,17 @@ st_TexImage(GLcontext * ctx,
* waiting on any outstanding fences. * waiting on any outstanding fences.
*/ */
if (stObj->pt && if (stObj->pt &&
/*stObj->pt->first_level == level &&*/ (stObj->teximage_realloc ||
stObj->pt->last_level == level && (/*stObj->pt->first_level == level &&*/
stObj->pt->target != PIPE_TEXTURE_CUBE && stObj->pt->last_level == level &&
!st_texture_match_image(stObj->pt, &stImage->base, stObj->pt->target != PIPE_TEXTURE_CUBE &&
stImage->face, stImage->level)) { !st_texture_match_image(stObj->pt, &stImage->base,
stImage->face, stImage->level)))) {
DBG("release it\n"); DBG("release it\n");
pipe_texture_release(&stObj->pt); pipe_texture_release(&stObj->pt);
assert(!stObj->pt); assert(!stObj->pt);
stObj->teximage_realloc = FALSE;
} }
if (!stObj->pt) { if (!stObj->pt) {

View File

@@ -68,9 +68,7 @@ struct st_texture_object
*/ */
struct pipe_texture *pt; struct pipe_texture *pt;
GLboolean imageOverride; GLboolean teximage_realloc;
GLint depthOverride;
GLuint pitchOverride;
}; };