llvmpipe: fix loop over mipmap levels
authorBrian Paul <brianp@vmware.com>
Wed, 10 Mar 2010 22:11:49 +0000 (15:11 -0700)
committerBrian Paul <brianp@vmware.com>
Thu, 11 Mar 2010 01:09:49 +0000 (18:09 -0700)
src/gallium/drivers/llvmpipe/lp_setup.c

index fbe14924cb10628acd2ac4ff4dc7800dc505b488..d6d37c4809011299a22c73c970cb0e8e40c109ae 100644 (file)
@@ -475,7 +475,7 @@ lp_setup_set_sampler_textures( struct setup_context *setup,
          if (!lp_tex->dt) {
             /* regular texture - setup array of mipmap level pointers */
             int j;
-            for (j = 0; j < LP_MAX_TEXTURE_2D_LEVELS; j++) {
+            for (j = 0; j <= tex->last_level; j++) {
                jit_tex->data[j] =
                   (ubyte *) lp_tex->data + lp_tex->level_offset[j];
             }