From 6d50148742512606f2abd76a2dcef6c87a5c7471 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Thu, 29 Nov 2012 04:08:32 +0100 Subject: llvmpipe: support array textures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds array (1d,2d) texture support to llvmpipe. Though probably should do something about 1d array textures requiring gobs of memory (this issue is not strictly limited to arrays but it is probably worse there). Initial code by Jakob Bornecrantz Reviewed-by: José Fonseca --- src/gallium/drivers/llvmpipe/lp_setup.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/gallium/drivers/llvmpipe/lp_setup.c') diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index a06acb27b83..84defc65054 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -653,10 +653,16 @@ lp_setup_set_fragment_sampler_views(struct lp_setup_context *setup, jit_tex = &setup->fs.current.jit_context.textures[i]; jit_tex->width = tex->width0; jit_tex->height = tex->height0; - jit_tex->depth = tex->depth0; jit_tex->first_level = view->u.tex.first_level; jit_tex->last_level = tex->last_level; + if (tex->target == PIPE_TEXTURE_3D) { + jit_tex->depth = tex->depth0; + } + else { + jit_tex->depth = tex->array_size; + } + /* We're referencing the texture's internal data, so save a * reference to it. */ -- cgit v1.2.3