st/mesa: need to pass srcLevel to st_texture_image_copy()
authorBrian Paul <brianp@vmware.com>
Tue, 4 May 2010 23:25:33 +0000 (17:25 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 4 May 2010 23:25:36 +0000 (17:25 -0600)
Fixes a regression in mipmap setup.

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

index b66630f9a6ae910f0ecb197a6b3406d4e3dbf233..11952a033a58a905f8a59f8fb9b57a1115eb4d61 100644 (file)
@@ -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);
index 80135fe942056a827b906e6f59f54bd616366e05..32011f294faffbbe29c3ebc2fdba27f8a9061b82 100644 (file)
@@ -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++) {
index 447f091db1fde51a21d229fd0d41892732a91193..ef31a1361e3ed4868cf350cb502f9d9fbfb78b73 100644 (file)
@@ -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