summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/intel_copy_image.c
diff options
context:
space:
mode:
authorNanley Chery <nanley.g.chery@intel.com>2015-05-21 14:27:55 -0700
committerNanley Chery <nanley.g.chery@intel.com>2015-08-26 14:36:43 -0700
commita6877341358e1534e74dd9e5fc72934a20b78228 (patch)
tree97b61a8c18f4bba93622b187f675d1ab9aac2f03 /src/mesa/drivers/dri/i965/intel_copy_image.c
parent1a9ceed4ba764cf73a643f8f2135b5b84cfe4581 (diff)
downloadexternal_mesa3d-a6877341358e1534e74dd9e5fc72934a20b78228.zip
external_mesa3d-a6877341358e1534e74dd9e5fc72934a20b78228.tar.gz
external_mesa3d-a6877341358e1534e74dd9e5fc72934a20b78228.tar.bz2
i965: change the meaning of cpp for compressed textures
An ASTC block takes up 16 bytes for all block width and height configurations. This size is not integrally divisible by all ASTC block widths. Therefore cpp is changed to mean bytes per block if the texture is compressed. Because the original definition was bytes per block divided by block width, all references to the mipmap width must be divided the block width. This keeps the address calculation formulas consistent. For example, the units for miptree_level x_offset and miptree total_width has changed from pixels to blocks. v2: reuse preexisting ALIGN_NPOT macro located in an i965 driver file. v3: move ALIGN_NPOT into seperate commit. simplify cpp assignment in copy_image_with_blitter(). update miptree width and offset variables in: intel_miptree_copy_slice(), intel_miptree_map_gtt(), and brw_miptree_layout_texture_3d(). Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/intel_copy_image.c')
-rw-r--r--src/mesa/drivers/dri/i965/intel_copy_image.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_copy_image.c b/src/mesa/drivers/dri/i965/intel_copy_image.c
index 3706704..ac2738f 100644
--- a/src/mesa/drivers/dri/i965/intel_copy_image.c
+++ b/src/mesa/drivers/dri/i965/intel_copy_image.c
@@ -41,7 +41,6 @@ copy_image_with_blitter(struct brw_context *brw,
{
GLuint bw, bh;
uint32_t src_image_x, src_image_y, dst_image_x, dst_image_y;
- int cpp;
/* The blitter doesn't understand multisampling at all. */
if (src_mt->num_samples > 0 || dst_mt->num_samples > 0)
@@ -86,16 +85,6 @@ copy_image_with_blitter(struct brw_context *brw,
src_y /= (int)bh;
src_width /= (int)bw;
src_height /= (int)bh;
-
- /* Inside of the miptree, the x offsets are stored in pixels while
- * the y offsets are stored in blocks. We need to scale just the x
- * offset.
- */
- src_image_x /= bw;
-
- cpp = _mesa_get_format_bytes(src_mt->format);
- } else {
- cpp = src_mt->cpp;
}
src_x += src_image_x;
src_y += src_image_y;
@@ -111,18 +100,12 @@ copy_image_with_blitter(struct brw_context *brw,
dst_x /= (int)bw;
dst_y /= (int)bh;
-
- /* Inside of the miptree, the x offsets are stored in pixels while
- * the y offsets are stored in blocks. We need to scale just the x
- * offset.
- */
- dst_image_x /= bw;
}
dst_x += dst_image_x;
dst_y += dst_image_y;
return intelEmitCopyBlit(brw,
- cpp,
+ src_mt->cpp,
src_mt->pitch,
src_mt->bo, src_mt->offset,
src_mt->tiling,