summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMichal Krol <[email protected]>2010-05-18 12:39:01 +0200
committerMichal Krol <[email protected]>2010-05-19 08:23:33 +0200
commit5a5a82d7e88c2971acad026b94e90588b2367a22 (patch)
tree06b22d52935f467a24f1540a17b52fd4a74b5b78 /src/gallium
parent83826dac9b83a167b224282327105ccd67306c53 (diff)
softpipe: Calculate slice_stride field in get_transfer().
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/softpipe/sp_texture.c4
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 7aa85559b23..4e6123fbd07 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);