summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_texture.c
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2014-07-01 15:37:56 +0200
committerRoland Scheidegger <sroland@vmware.com>2014-07-02 01:55:59 +0200
commita7ee842acd30578f4170f69124c3986ee35a6df8 (patch)
treeffc49d15843e795dea644faae82ebc6e0a1eacb1 /src/gallium/drivers/llvmpipe/lp_texture.c
parenta4d0758d9d3383cf1411a65e76180f5302cfc3cd (diff)
llvmpipe: get rid of llvmpipe_get_texture_tile_linear
Because the layout is always linear this didn't really do much any longer - at some point this triggered per-tile swizzled->linear conversion. The x/y coords were ignored too. Apart from triggering conversion, this also invoked alloc_image_data(), which could only actually trigger mapping of display target resources. So, instead just call resource_map in the callers (which also gives the ability to unmap again). Note that mapping/unmapping of display target resources still isn't really all that clean (map/unmap may be unmatched, and all such mappings use the same pointer thus usage flags are a lie). Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_texture.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_texture.c32
1 files changed, 2 insertions, 30 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c
index 3cb421cd823..c07bd21bf12 100644
--- a/src/gallium/drivers/llvmpipe/lp_texture.c
+++ b/src/gallium/drivers/llvmpipe/lp_texture.c
@@ -735,6 +735,8 @@ llvmpipe_get_texture_image_address(struct llvmpipe_resource *lpr,
{
unsigned offset;
+ assert(llvmpipe_resource_is_texture(&lpr->base));
+
offset = lpr->mip_offsets[level];
if (face_slice > 0)
@@ -788,36 +790,6 @@ alloc_image_data(struct llvmpipe_resource *lpr)
/**
- * Get pointer to a linear image (not the tile!) at tile (x,y).
- * \return pointer to start of image/face (not the tile)
- */
-ubyte *
-llvmpipe_get_texture_tile_linear(struct llvmpipe_resource *lpr,
- unsigned face_slice, unsigned level,
- enum lp_texture_usage usage,
- unsigned x, unsigned y)
-{
- uint8_t *linear_image;
-
- assert(llvmpipe_resource_is_texture(&lpr->base));
- assert(x % TILE_SIZE == 0);
- assert(y % TILE_SIZE == 0);
-
- if (!lpr->tex_data) {
- /* allocate memory for the linear image now */
- /* XXX should probably not do that here? */
- alloc_image_data(lpr);
- }
- assert(lpr->tex_data);
-
- /* compute address of the slice/face of the image that contains the tile */
- linear_image = llvmpipe_get_texture_image_address(lpr, face_slice, level);
-
- return linear_image;
-}
-
-
-/**
* Return size of resource in bytes
*/
unsigned