summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-05-04 17:25:33 -0600
committerBrian Paul <brianp@vmware.com>2010-05-04 17:25:36 -0600
commitc6fdb950e9fdf42fb1d6c837019df23386fffee7 (patch)
tree6d4565f643b6893dcbe03b64c506ccad8cf8acab /src/mesa/state_tracker
parent87022efb4f1e40a70d34beb30754854608a49246 (diff)
st/mesa: need to pass srcLevel to st_texture_image_copy()
Fixes a regression in mipmap setup.
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c2
-rw-r--r--src/mesa/state_tracker/st_texture.c9
-rw-r--r--src/mesa/state_tracker/st_texture.h2
3 files changed, 6 insertions, 7 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index b66630f9a6..11952a033a 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -1778,7 +1778,7 @@ copy_image_data_to_texture(struct st_context *st,
*/
st_texture_image_copy(st->pipe,
stObj->pt, dstLevel, /* dest texture, level */
- stImage->pt, /* src texture */
+ stImage->pt, stImage->level, /* src texture, level */
stImage->face);
pipe_resource_reference(&stImage->pt, NULL);
diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c
index 80135fe942..32011f294f 100644
--- a/src/mesa/state_tracker/st_texture.c
+++ b/src/mesa/state_tracker/st_texture.c
@@ -280,7 +280,7 @@ print_center_pixel(struct pipe_context *pipe, struct pipe_resource *src)
void
st_texture_image_copy(struct pipe_context *pipe,
struct pipe_resource *dst, GLuint dstLevel,
- struct pipe_resource *src,
+ struct pipe_resource *src, GLuint srcLevel,
GLuint face)
{
struct pipe_screen *screen = pipe->screen;
@@ -289,12 +289,11 @@ st_texture_image_copy(struct pipe_context *pipe,
GLuint depth = u_minify(dst->depth0, dstLevel);
struct pipe_surface *src_surface;
struct pipe_surface *dst_surface;
- const GLuint srcLevel = 0;
GLuint i;
- assert(src->width0 == width);
- assert(src->height0 == height);
- assert(src->depth0 == depth);
+ assert(u_minify(src->width0, srcLevel) == width);
+ assert(u_minify(src->height0, srcLevel) == height);
+ assert(u_minify(src->depth0, srcLevel) == depth);
/* Loop over 3D image slices */
for (i = 0; i < depth; i++) {
diff --git a/src/mesa/state_tracker/st_texture.h b/src/mesa/state_tracker/st_texture.h
index 447f091db1..ef31a1361e 100644
--- a/src/mesa/state_tracker/st_texture.h
+++ b/src/mesa/state_tracker/st_texture.h
@@ -205,7 +205,7 @@ st_texture_image_data(struct st_context *st,
extern void
st_texture_image_copy(struct pipe_context *pipe,
struct pipe_resource *dst, GLuint dstLevel,
- struct pipe_resource *src,
+ struct pipe_resource *src, GLuint srcLevel,
GLuint face);
extern void