summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_screen.c
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2009-12-02 02:08:26 +0100
committerRoland Scheidegger <[email protected]>2009-12-02 02:08:26 +0100
commitc78748a5274e58bcbb122923edf81065be9bbe16 (patch)
tree9b22e49cfb1a1edb1a1acfd086245fbd8ac83b2b /src/gallium/drivers/r300/r300_screen.c
parentdecf6ed810eae473d043a4a399a5a84f1378a725 (diff)
gallium: adapt drivers to interface cleanups
Diffstat (limited to 'src/gallium/drivers/r300/r300_screen.c')
-rw-r--r--src/gallium/drivers/r300/r300_screen.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index 390b63007e5..032fa69ec0f 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -311,14 +311,10 @@ r300_get_tex_transfer(struct pipe_screen *screen,
trans = CALLOC_STRUCT(r300_transfer);
if (trans) {
pipe_texture_reference(&trans->transfer.texture, texture);
- trans->transfer.format = texture->format;
trans->transfer.x = x;
trans->transfer.y = y;
trans->transfer.width = w;
trans->transfer.height = h;
- trans->transfer.block = texture->block;
- trans->transfer.nblocksx = texture->nblocksx[level];
- trans->transfer.nblocksy = texture->nblocksy[level];
trans->transfer.stride = r300_texture_get_stride(tex, level);
trans->transfer.usage = usage;
@@ -344,6 +340,7 @@ static void* r300_transfer_map(struct pipe_screen* screen,
{
struct r300_texture* tex = (struct r300_texture*)transfer->texture;
char* map;
+ enum pipe_format format = tex->tex.format;
map = pipe_buffer_map(screen, tex->buffer,
pipe_transfer_buffer_flags(transfer));
@@ -353,8 +350,8 @@ static void* r300_transfer_map(struct pipe_screen* screen,
}
return map + r300_transfer(transfer)->offset +
- transfer->y / transfer->block.height * transfer->stride +
- transfer->x / transfer->block.width * transfer->block.size;
+ transfer->y / pf_get_blockheight(format) * transfer->stride +
+ transfer->x / pf_get_blockwidth(format) * pf_get_blocksize(format);
}
static void r300_transfer_unmap(struct pipe_screen* screen,