diff options
author | Roland Scheidegger <[email protected]> | 2014-07-01 03:09:44 +0200 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2014-07-02 01:55:59 +0200 |
commit | aa1ab8173dfe73692cf65af401e7345ec78bb313 (patch) | |
tree | 0d6240f91f011253574677478e547174da46a39f /src/gallium/drivers/llvmpipe/lp_setup.c | |
parent | 90abdc15414f44862a82fe2e53e5419f8182b9ac (diff) |
llvmpipe: get rid of llvmpipe_get_texture_image_all
Once used for invoking swizzled->linear conversion for all needed images.
But we now have a single allocation for all images in a resource, thus looping
through all slices is rather pointless, conversion doesn't happen neither.
Also simplify the sampling setup code to use the mip_offsets array in the
resource directly - if the (non display target) resource exists its memory
will already be allocated as well.
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_setup.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_setup.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index cbf465e65d1..d728e85dcb6 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -802,7 +802,6 @@ lp_setup_set_fragment_sampler_views(struct lp_setup_context *setup, if (!lp_tex->dt) { /* regular texture - setup array of mipmap level offsets */ - void *mip_ptr; int j; unsigned first_level = 0; unsigned last_level = 0; @@ -812,22 +811,14 @@ lp_setup_set_fragment_sampler_views(struct lp_setup_context *setup, last_level = view->u.tex.last_level; assert(first_level <= last_level); assert(last_level <= res->last_level); - - /* - * The complexity here should no longer be necessary. - */ - mip_ptr = llvmpipe_get_texture_image_all(lp_tex, first_level, - LP_TEX_USAGE_READ); jit_tex->base = lp_tex->tex_data; } else { - mip_ptr = lp_tex->data; - jit_tex->base = mip_ptr; + jit_tex->base = lp_tex->data; } - if ((LP_PERF & PERF_TEX_MEM) || !mip_ptr) { - /* out of memory - use dummy tile memory */ - /* Note if using PERF_TEX_MEM will also skip tile conversion */ + if (LP_PERF & PERF_TEX_MEM) { + /* use dummy tile memory */ jit_tex->base = lp_dummy_tile; jit_tex->width = TILE_SIZE/8; jit_tex->height = TILE_SIZE/8; @@ -847,14 +838,7 @@ lp_setup_set_fragment_sampler_views(struct lp_setup_context *setup, if (llvmpipe_resource_is_texture(res)) { for (j = first_level; j <= last_level; j++) { - mip_ptr = llvmpipe_get_texture_image_all(lp_tex, j, - LP_TEX_USAGE_READ); - jit_tex->mip_offsets[j] = (uint8_t *)mip_ptr - (uint8_t *)jit_tex->base; - /* - * could get mip offset directly but need call above to - * invoke tiled->linear conversion. - */ - assert(lp_tex->mip_offsets[j] == jit_tex->mip_offsets[j]); + jit_tex->mip_offsets[j] = lp_tex->mip_offsets[j]; jit_tex->row_stride[j] = lp_tex->row_stride[j]; jit_tex->img_stride[j] = lp_tex->img_stride[j]; } |