summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_setup.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-03-11 14:46:06 -0700
committerBrian Paul <[email protected]>2010-03-11 14:49:01 -0700
commit53efb634a0c134feebb5a3e47fc33660694be9c3 (patch)
tree5f31c7c35a56e5fadd536f659428f406b3d4df67 /src/gallium/drivers/llvmpipe/lp_setup.c
parent272f399434ad6b33a8444c287c5126987a222864 (diff)
gallivm/llvmpipe: replace 'int stride' with 'int row_stride[MAX_LEVELS]'
The stride depends on the mipmap level. Rename to row_stride to distinguish from img_stride for 3D textures. Fixes incorrect texel addressing in small mipmap levels.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_setup.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_setup.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c
index d6d37c48090..c870f89d01d 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup.c
@@ -471,13 +471,13 @@ lp_setup_set_sampler_textures( struct setup_context *setup,
jit_tex->height = tex->height0;
jit_tex->depth = tex->depth0;
jit_tex->last_level = tex->last_level;
- jit_tex->stride = lp_tex->stride[0];
if (!lp_tex->dt) {
/* regular texture - setup array of mipmap level pointers */
int j;
for (j = 0; j <= tex->last_level; j++) {
jit_tex->data[j] =
(ubyte *) lp_tex->data + lp_tex->level_offset[j];
+ jit_tex->row_stride[j] = lp_tex->stride[j];
}
}
else {
@@ -490,6 +490,7 @@ lp_setup_set_sampler_textures( struct setup_context *setup,
struct sw_winsys *winsys = screen->winsys;
jit_tex->data[0] = winsys->displaytarget_map(winsys, lp_tex->dt,
PIPE_BUFFER_USAGE_CPU_READ);
+ jit_tex->row_stride[0] = lp_tex->stride[0];
assert(jit_tex->data[0]);
}