aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_gen_mipmap.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-02-22 13:55:31 +0000
committermarha <marha@users.sourceforge.net>2011-02-22 13:55:31 +0000
commit9273afeeb4499a0493f120b7525e17b6ae51113e (patch)
tree404ae2c5f693be6ea2c0d6eb55e2c68b9d177e00 /mesalib/src/mesa/state_tracker/st_gen_mipmap.c
parent248adea786d4a5a9d2c71679722eda734d4e7be7 (diff)
downloadvcxsrv-9273afeeb4499a0493f120b7525e17b6ae51113e.tar.gz
vcxsrv-9273afeeb4499a0493f120b7525e17b6ae51113e.tar.bz2
vcxsrv-9273afeeb4499a0493f120b7525e17b6ae51113e.zip
xserver libX11 pixman mesa git update 22 Feb 2011
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_gen_mipmap.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_gen_mipmap.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_gen_mipmap.c b/mesalib/src/mesa/state_tracker/st_gen_mipmap.c
index 18eb3be68..4bf682808 100644
--- a/mesalib/src/mesa/state_tracker/st_gen_mipmap.c
+++ b/mesalib/src/mesa/state_tracker/st_gen_mipmap.c
@@ -336,6 +336,11 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target,
if (lastLevel == 0)
return;
+ /* The texture isn't in a "complete" state yet so set the expected
+ * lastLevel here, since it won't get done in st_finalize_texture().
+ */
+ stObj->lastLevel = lastLevel;
+
if (pt->last_level < lastLevel) {
/* The current gallium texture doesn't have space for all the
* mipmap levels we need to generate. So allocate a new texture.
@@ -353,11 +358,6 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target,
oldTex->array_size,
oldTex->bind);
- /* The texture isn't in a "complete" state yet so set the expected
- * lastLevel here, since it won't get done in st_finalize_texture().
- */
- stObj->lastLevel = lastLevel;
-
/* This will copy the old texture's base image into the new texture
* which we just allocated.
*/
@@ -366,8 +366,6 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target,
/* release the old tex (will likely be freed too) */
pipe_resource_reference(&oldTex, NULL);
pipe_sampler_view_reference(&stObj->sampler_view, NULL);
-
- pt = stObj->pt;
}
else {
/* Make sure that the base texture image data is present in the
@@ -376,6 +374,8 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target,
st_finalize_texture(ctx, st->pipe, texObj);
}
+ pt = stObj->pt;
+
assert(pt->last_level >= lastLevel);
/* Try to generate the mipmap by rendering/texturing. If that fails,