summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_gen_mipmap.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-12-06 11:01:19 -0700
committerBrian Paul <brianp@vmware.com>2010-12-06 11:01:21 -0700
commitcae2bb76c1147d48f75ddd7a058a48d11e72ba03 (patch)
tree9c65072a0397a846338232de1ddee721b1a93fc6 /src/mesa/state_tracker/st_gen_mipmap.c
parentc1095f0b0c636832acdfeb5dbf5595cb9b8bf513 (diff)
st/mesa: fix mipmap generation bug
In st_finalize_texture() we were looking at the st_texture_object:: lastLevel field instead of the pipe_resource::last_level field to determine which resource to store the mipmap in. Then, in st_generate_mipmap() we need to call st_finalize_texture() to make sure the destination resource is properly allocated. These changes fix the broken piglit fbo-generatemipmap-formats test.
Diffstat (limited to 'src/mesa/state_tracker/st_gen_mipmap.c')
-rw-r--r--src/mesa/state_tracker/st_gen_mipmap.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c
index 2472c0bcf1..c5f6008a22 100644
--- a/src/mesa/state_tracker/st_gen_mipmap.c
+++ b/src/mesa/state_tracker/st_gen_mipmap.c
@@ -370,6 +370,12 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target,
pt = stObj->pt;
}
+ else {
+ /* Make sure that the base texture image data is present in the
+ * texture buffer.
+ */
+ st_finalize_texture(ctx, st->pipe, texObj);
+ }
assert(pt->last_level >= lastLevel);