i965: Account for MinLevel in texture upload fast path
authorChris Forbes <chrisf@ijw.co.nz>
Mon, 20 Jan 2014 07:19:35 +0000 (20:19 +1300)
committerChris Forbes <chrisf@ijw.co.nz>
Thu, 10 Apr 2014 06:27:41 +0000 (18:27 +1200)
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/intel_tex_subimage.c

index 7143ab79688bde38075039a6d8c63c55cb3b4e3f..287b27b02a17350e2d5bed38e2be2f0df0c2dfd0 100644 (file)
@@ -634,9 +634,11 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx,
        packing->Alignment, packing->RowLength, packing->SkipPixels,
        packing->SkipRows, for_glTexImage);
 
+   int level = texImage->Level + texImage->TexObject->MinLevel;
+
    /* Adjust x and y offset based on miplevel */
-   xoffset += image->mt->level[texImage->Level].level_x;
-   yoffset += image->mt->level[texImage->Level].level_y;
+   xoffset += image->mt->level[level].level_x;
+   yoffset += image->mt->level[level].level_y;
 
    linear_to_tiled(
       xoffset * cpp, (xoffset + width) * cpp,