We need to take account the offset from original bo when using glTexSubImage()
and other functions that manipulate the subregion of an exported texture.
Offsets are appended to mapped region address and when blitting from a source
region.

Signed-off-by: Abdiel Janulgue <abdiel.janul...@linux.intel.com>
---
 src/mesa/drivers/dri/intel/intel_mipmap_tree.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c 
b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index 435f12f..ceb5322 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -1126,7 +1126,7 @@ intel_miptree_map_gtt(struct intel_context *intel,
    assert(y % bh == 0);
    y /= bh;
 
-   base = intel_region_map(intel, mt->region, map->mode);
+   base = intel_region_map(intel, mt->region, map->mode) + mt->offset;
 
    if (base == NULL)
       map->ptr = NULL;
@@ -1186,7 +1186,7 @@ intel_miptree_map_blit(struct intel_context *intel,
    if (!intelEmitCopyBlit(intel,
                          mt->region->cpp,
                          mt->region->pitch, mt->region->bo,
-                         0, mt->region->tiling,
+                         mt->offset, mt->region->tiling,
                          map->stride / mt->region->cpp, map->bo,
                          0, I915_TILING_NONE,
                          x, y,
-- 
1.7.9.5

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to