summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaciej Cencora <[email protected]>2010-01-18 23:00:36 +0100
committerMaciej Cencora <[email protected]>2010-01-19 23:38:34 +0100
commit0aed44f8a36d4974d42f643c5065f2a4d96fc619 (patch)
treed3b6e0ee1ce196b7fe2f5ab8e6046eb9bdd03e40
parent0174dac5f3bd47c0a2dcd40319bff288c83ee96a (diff)
r600: align to r300 changes in the blit code
Pitch here means aligned width, not aligned width * bpp.
-rw-r--r--src/mesa/drivers/dri/r600/r600_blit.c11
-rw-r--r--src/mesa/drivers/dri/r600/r600_texcopy.c5
2 files changed, 7 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/r600/r600_blit.c b/src/mesa/drivers/dri/r600/r600_blit.c
index 58eb91ec615..0205a438cc7 100644
--- a/src/mesa/drivers/dri/r600/r600_blit.c
+++ b/src/mesa/drivers/dri/r600/r600_blit.c
@@ -90,16 +90,15 @@ static unsigned is_blit_supported(gl_format mesa_format)
static inline void
set_render_target(context_t *context, struct radeon_bo *bo, gl_format mesa_format,
- int pitch, int w, int h, intptr_t dst_offset)
+ int nPitchInPixel, int w, int h, intptr_t dst_offset)
{
uint32_t cb_color0_base, cb_color0_size = 0, cb_color0_info = 0, cb_color0_view = 0;
- int nPitchInPixel, id = 0;
- uint32_t comp_swap, format, bpp = _mesa_get_format_bytes(mesa_format);
+ int id = 0;
+ uint32_t comp_swap, format;
BATCH_LOCALS(&context->radeon);
cb_color0_base = dst_offset / 256;
- nPitchInPixel = pitch/bpp;
SETfield(cb_color0_size, (nPitchInPixel / 8) - 1,
PITCH_TILE_MAX_shift, PITCH_TILE_MAX_mask);
SETfield(cb_color0_size, ((nPitchInPixel * h) / 64) - 1,
@@ -556,11 +555,9 @@ set_vtx_resource(context_t *context)
static inline void
set_tex_resource(context_t * context,
gl_format mesa_format, struct radeon_bo *bo, int w, int h,
- int pitch, intptr_t src_offset)
+ int TexelPitch, intptr_t src_offset)
{
uint32_t sq_tex_resource0, sq_tex_resource1, sq_tex_resource2, sq_tex_resource4, sq_tex_resource6;
- int bpp = _mesa_get_format_bytes(mesa_format);
- int TexelPitch = pitch/bpp;
sq_tex_resource0 = sq_tex_resource1 = sq_tex_resource2 = sq_tex_resource4 = sq_tex_resource6 = 0;
BATCH_LOCALS(&context->radeon);
diff --git a/src/mesa/drivers/dri/r600/r600_texcopy.c b/src/mesa/drivers/dri/r600/r600_texcopy.c
index 12b34030512..21bf840e86f 100644
--- a/src/mesa/drivers/dri/r600/r600_texcopy.c
+++ b/src/mesa/drivers/dri/r600/r600_texcopy.c
@@ -81,10 +81,11 @@ do_copy_texsubimage(GLcontext *ctx,
/* blit from src buffer to texture */
- return r600_blit(ctx, rrb->bo, src_offset, rrb->base.Format, rrb->pitch,
+ return r600_blit(ctx, rrb->bo, src_offset, rrb->base.Format, rrb->pitch/rrb->cpp,
rrb->base.Width, rrb->base.Height, x, y,
timg->mt->bo, dst_offset, timg->base.TexFormat,
- timg->mt->levels[level].rowstride, timg->base.Width, timg->base.Height,
+ timg->mt->levels[level].rowstride / _mesa_get_format_bytes(timg->base.TexFormat),
+ timg->base.Width, timg->base.Height,
dstx, dsty, width, height, 1);
}