diff options
author | Brian Paul <brianp@vmware.com> | 2010-04-20 17:19:30 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2010-04-20 17:19:30 -0600 |
commit | 1cb80d31d37e77d955923b4f21e8bac2642baece (patch) | |
tree | cd831327ad71e93934165f19c3dd86a036658f18 | |
parent | 7688a4749e9266fe6c5f86b62e19d3a0975c3f57 (diff) | |
download | external_mesa3d-1cb80d31d37e77d955923b4f21e8bac2642baece.zip external_mesa3d-1cb80d31d37e77d955923b4f21e8bac2642baece.tar.gz external_mesa3d-1cb80d31d37e77d955923b4f21e8bac2642baece.tar.bz2 |
llvmpipe: remove debug code and simplify
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_texture.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c index cd1dddc..a33b3f8 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture.c +++ b/src/gallium/drivers/llvmpipe/lp_texture.c @@ -1111,12 +1111,12 @@ llvmpipe_get_texture_tile(struct llvmpipe_resource *lpr, enum lp_texture_usage usage, unsigned x, unsigned y) { - const unsigned width = u_minify(lpr->base.width0, level); struct llvmpipe_texture_image *tiled_img = &lpr->tiled[level]; enum lp_texture_layout cur_layout, new_layout; const unsigned tx = x / TILE_SIZE, ty = y / TILE_SIZE; boolean convert; uint8_t *tiled_image, *linear_image; + unsigned tile_offset; assert(x % TILE_SIZE == 0); assert(y % TILE_SIZE == 0); @@ -1145,20 +1145,10 @@ llvmpipe_get_texture_tile(struct llvmpipe_resource *lpr, llvmpipe_set_texture_tile_layout(lpr, face_slice, level, tx, ty, new_layout); /* compute, return address of the 64x64 tile */ - { - unsigned tiles_per_row, tile_offset; - - tiles_per_row = align(width, TILE_SIZE) / TILE_SIZE; - - assert(tiles_per_row == lpr->tiles_per_row[level]); + tile_offset = (ty * lpr->tiles_per_row[level] + tx) + * TILE_SIZE * TILE_SIZE * 4; - tile_offset = ty * tiles_per_row + tx; - tile_offset *= TILE_SIZE * TILE_SIZE * 4; - - assert(tiled_img->data); - - return (ubyte *) tiled_image + tile_offset; - } + return (ubyte *) tiled_image + tile_offset; } |