i965: use mt->offset in intel_miptree_map_movntdqa()
authorHaixia Shi <hshi@chromium.org>
Wed, 3 Aug 2016 00:03:32 +0000 (17:03 -0700)
committerChad Versace <chad@kiwitree.net>
Wed, 3 Aug 2016 15:28:52 +0000 (08:28 -0700)
We need to include mt->offset in the calculation of src pointer because its
value may be non-zero, for example in a cubemap texture.

Signed-off-by: Haixia Shi <hshi@chromium.org>
Cc: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Chad Versace <chad@kiwitree.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Change-Id: I461ad5b204626d5a1c45611fc6b63735dcf29f63

src/mesa/drivers/dri/i965/intel_mipmap_tree.c

index a988221a005e65e59e62f0d23890d2ac983eb0f1..8e7c44c96a9201406caa73602f10e42c92242131 100644 (file)
@@ -2462,6 +2462,9 @@ intel_miptree_map_movntdqa(struct brw_context *brw,
    void *src = intel_miptree_map_raw(brw, mt);
    if (!src)
       return;
+
+   src += mt->offset;
+
    src += image_y * mt->pitch;
    src += image_x * mt->cpp;