summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2014-07-31 19:13:57 +0200
committerRoland Scheidegger <sroland@vmware.com>2014-08-01 23:31:11 +0200
commit47096fbb5d1c0ba57df642c67b34754e649778c3 (patch)
tree37280675ef9090f27ca45ae782c5f44e12f50e97
parentc860a379d2fa09da1711591b6aef4a885d224ea0 (diff)
downloadexternal_mesa3d-47096fbb5d1c0ba57df642c67b34754e649778c3.zip
external_mesa3d-47096fbb5d1c0ba57df642c67b34754e649778c3.tar.gz
external_mesa3d-47096fbb5d1c0ba57df642c67b34754e649778c3.tar.bz2
llvmpipe: get rid of impossible code in alloc_image_data
Only used for non display target resources. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
-rw-r--r--src/gallium/drivers/llvmpipe/lp_texture.c39
1 files changed, 13 insertions, 26 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c
index c07bd21..40e5815 100644
--- a/src/gallium/drivers/llvmpipe/lp_texture.c
+++ b/src/gallium/drivers/llvmpipe/lp_texture.c
@@ -757,34 +757,21 @@ alloc_image_data(struct llvmpipe_resource *lpr)
uint level;
uint offset = 0;
- if (lpr->dt) {
- /* we get the linear memory from the winsys, and it has
- * already been zeroed
- */
- struct llvmpipe_screen *screen = llvmpipe_screen(lpr->base.screen);
- struct sw_winsys *winsys = screen->winsys;
+ assert(!lpr->dt);
- assert(lpr->base.last_level == 0);
-
- lpr->tex_data =
- winsys->displaytarget_map(winsys, lpr->dt,
- PIPE_TRANSFER_READ_WRITE);
+ /* not a display target - allocate regular memory */
+ /*
+ * Offset calculation for start of a specific mip/layer is always
+ * offset = lpr->linear_mip_offsets[level] + lpr->img_stride[level] * layer
+ */
+ for (level = 0; level <= lpr->base.last_level; level++) {
+ uint buffer_size = tex_image_size(lpr, level);
+ lpr->mip_offsets[level] = offset;
+ offset += align(buffer_size, alignment);
}
- else {
- /* not a display target - allocate regular memory */
- /*
- * Offset calculation for start of a specific mip/layer is always
- * offset = lpr->linear_mip_offsets[level] + lpr->img_stride[level] * layer
- */
- for (level = 0; level <= lpr->base.last_level; level++) {
- uint buffer_size = tex_image_size(lpr, level);
- lpr->mip_offsets[level] = offset;
- offset += align(buffer_size, alignment);
- }
- lpr->tex_data = align_malloc(offset, alignment);
- if (lpr->tex_data) {
- memset(lpr->tex_data, 0, offset);
- }
+ lpr->tex_data = align_malloc(offset, alignment);
+ if (lpr->tex_data) {
+ memset(lpr->tex_data, 0, offset);
}
}