[Mesa-dev] [PATCH] softpipe: Calculate slice_stride field in get_transfer().

Keith Whitwell keithw at vmware.com
Tue May 18 04:42:19 PDT 2010


On Tue, 2010-05-18 at 04:37 -0700, Michal Krol wrote:
> From eaba49550f92af708499f22dbaa7cf4d99f4109f Mon Sep 17 00:00:00 2001
> From: Michal Krol <michal at vmware.com>
> Date: Tue, 18 May 2010 12:39:01 +0200
> Subject: [PATCH] softpipe: Calculate slice_stride field in get_transfer().
> 
> ---
>  src/gallium/drivers/softpipe/sp_texture.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/src/gallium/drivers/softpipe/sp_texture.c b/src/gallium/drivers/softpipe/sp_texture.c
> index 7aa8555..4e6123f 100644
> --- a/src/gallium/drivers/softpipe/sp_texture.c
> +++ b/src/gallium/drivers/softpipe/sp_texture.c
> @@ -343,11 +343,15 @@ softpipe_get_transfer(struct pipe_context *pipe,
>     if (spt) {
>        struct pipe_transfer *pt = &spt->base;
>        enum pipe_format format = resource->format;
> +      const unsigned hgt = u_minify(spr->base.height0, sr.level);
> +      const unsigned nblocksy = util_format_get_nblocksy(format, hgt);
> +
>        pipe_resource_reference(&pt->resource, resource);
>        pt->sr = sr;
>        pt->usage = usage;
>        pt->box = *box;
>        pt->stride = spr->stride[sr.level];
> +      pt->slice_stride = pt->stride * nblocksy;
>  
>        spt->offset = sp_get_tex_image_offset(spr, sr.level, sr.face, box->z);
>   

Looks good Michal.

Keith



More information about the mesa-dev mailing list