diff options
author | Brian Paul <[email protected]> | 2011-10-23 10:44:47 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2011-10-23 10:44:47 -0600 |
commit | 6e0f9001fe3fb191c2928bd09aa9e9d05ddf4ea9 (patch) | |
tree | 4e2089a6790e76a4210ffc9d0f9aebf5c28adb40 /src/mesa/drivers/dri/intel/intel_tex_validate.c | |
parent | 33abbd4fbdb3149df5ecc296b04a79225962e433 (diff) |
mesa: move gl_texture_image::Data, RowStride, ImageOffsets to swrast
Only swrast and the drivers that fall back to swrast need these fields now.
This removes the last of the fields related to software rendering from
gl_texture_image.
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_tex_validate.c')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_tex_validate.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c b/src/mesa/drivers/dri/intel/intel_tex_validate.c index 40124009437..6639de9c2af 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_validate.c +++ b/src/mesa/drivers/dri/intel/intel_tex_validate.c @@ -147,40 +147,29 @@ intel_tex_map_image_for_swrast(struct intel_context *intel, mt->target == GL_TEXTURE_1D_ARRAY) { int i; - if (mt->target == GL_TEXTURE_2D_ARRAY || - mt->target == GL_TEXTURE_1D_ARRAY) { - /* Mesa only allocates one entry for these, but we really do have an - * offset per depth. - */ - free(intel_image->base.Base.ImageOffsets); - intel_image->base.Base.ImageOffsets = malloc(mt->level[level].depth * - sizeof(GLuint)); - } - /* ImageOffsets[] is only used for swrast's fetch_texel_3d, so we can't * share code with the normal path. */ for (i = 0; i < mt->level[level].depth; i++) { intel_miptree_get_image_offset(mt, level, face, i, &x, &y); - intel_image->base.Base.ImageOffsets[i] = x + y * mt->region->pitch; + intel_image->base.ImageOffsets[i] = x + y * mt->region->pitch; } DBG("%s \n", __FUNCTION__); - intel_image->base.Base.Data = intel_region_map(intel, mt->region, mode); + intel_image->base.Data = intel_region_map(intel, mt->region, mode); } else { assert(mt->level[level].depth == 1); intel_miptree_get_image_offset(mt, level, face, 0, &x, &y); - intel_image->base.Base.ImageOffsets[0] = 0; DBG("%s: (%d,%d) -> (%d, %d)/%d\n", __FUNCTION__, face, level, x, y, mt->region->pitch * mt->cpp); - intel_image->base.Base.Data = intel_region_map(intel, mt->region, mode) + + intel_image->base.Data = intel_region_map(intel, mt->region, mode) + (x + y * mt->region->pitch) * mt->cpp; } - intel_image->base.Base.RowStride = mt->region->pitch; + intel_image->base.RowStride = mt->region->pitch; } static void @@ -189,7 +178,7 @@ intel_tex_unmap_image_for_swrast(struct intel_context *intel, { if (intel_image && intel_image->mt) { intel_region_unmap(intel, intel_image->mt->region); - intel_image->base.Base.Data = NULL; + intel_image->base.Data = NULL; } } |