drm_intel_bo_reference(intelObj->mt->region->bo);
i915->state.tex_buffer[unit] = intelObj->mt->region->bo;
- i915->state.tex_offset[unit] = 0; /* Always the origin of the miptree */
+ i915->state.tex_offset[unit] = intelObj->mt->offset;
format = translate_texture_format(firstImage->TexFormat,
sampler->DepthMode);
sampler->sRGBDecode) <<
BRW_SURFACE_FORMAT_SHIFT));
- surf[1] = intelObj->mt->region->bo->offset; /* reloc */
+ surf[1] = intelObj->mt->region->bo->offset + intelObj->mt->offset; /* reloc */
surf[2] = ((intelObj->_MaxLevel - tObj->BaseLevel) << BRW_SURFACE_LOD_SHIFT |
(width - 1) << BRW_SURFACE_WIDTH_SHIFT |
/* Emit relocation to surface contents */
drm_intel_bo_emit_reloc(brw->intel.batch.bo,
brw->wm.surf_offset[surf_index] + 4,
- intelObj->mt->region->bo, 0,
+ intelObj->mt->region->bo,
+ intelObj->mt->offset,
I915_GEM_DOMAIN_SAMPLER, 0);
}
* - render_cache_read_write (exists on gen6 but ignored here)
*/
- surf->ss1.base_addr = intelObj->mt->region->bo->offset; /* reloc */
+ surf->ss1.base_addr =
+ intelObj->mt->region->bo->offset + intelObj->mt->offset; /* reloc */
surf->ss2.width = width - 1;
surf->ss2.height = height - 1;
drm_intel_bo_emit_reloc(brw->intel.batch.bo,
brw->wm.surf_offset[surf_index] +
offsetof(struct gen7_surface_state, ss1),
- intelObj->mt->region->bo, 0,
+ intelObj->mt->region->bo, intelObj->mt->offset,
I915_GEM_DOMAIN_SAMPLER, 0);
gen7_check_surface_setup(surf, false /* is_render_target */);
mt->total_width,
mt->total_height,
expect_accelerated_upload);
+ mt->offset = 0;
if (!mt->region) {
intel_miptree_release(&mt);
*/
struct intel_region *region;
+ /* Offset into region bo where miptree starts:
+ */
+ uint32_t offset;
+
/**
* \brief HiZ miptree
*
struct intel_region *region,
GLenum target,
GLenum internalFormat,
- gl_format format)
+ gl_format format,
+ uint32_t offset)
{
struct intel_context *intel = intel_context(ctx);
struct intel_texture_image *intel_image = intel_texture_image(image);
if (intel_image->mt == NULL)
return;
+ intel_image->mt->offset = offset;
intel_image->base.RowStride = region->pitch;
/* Immediately validate the image to the object. */
_mesa_lock_texture(&intel->ctx, texObj);
texImage = _mesa_get_tex_image(ctx, texObj, target, level);
intel_set_texture_image_region(ctx, texImage, rb->mt->region, target,
- internalFormat, texFormat);
+ internalFormat, texFormat, 0);
_mesa_unlock_texture(&intel->ctx, texObj);
}
return;
intel_set_texture_image_region(ctx, texImage, image->region,
- target, image->internal_format, image->format);
+ target, image->internal_format,
+ image->format, 0);
}
#endif