summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_jit.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-03-11 14:46:06 -0700
committerBrian Paul <brianp@vmware.com>2010-03-11 14:49:01 -0700
commit53efb634a0c134feebb5a3e47fc33660694be9c3 (patch)
tree5f31c7c35a56e5fadd536f659428f406b3d4df67 /src/gallium/drivers/llvmpipe/lp_jit.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_jit.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_jit.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_jit.c b/src/gallium/drivers/llvmpipe/lp_jit.c
index 08c8f93794..5887613120 100644
--- a/src/gallium/drivers/llvmpipe/lp_jit.c
+++ b/src/gallium/drivers/llvmpipe/lp_jit.c
@@ -57,7 +57,8 @@ lp_jit_init_globals(struct llvmpipe_screen *screen)
elem_types[LP_JIT_TEXTURE_HEIGHT] = LLVMInt32Type();
elem_types[LP_JIT_TEXTURE_DEPTH] = LLVMInt32Type();
elem_types[LP_JIT_TEXTURE_LAST_LEVEL] = LLVMInt32Type();
- elem_types[LP_JIT_TEXTURE_STRIDE] = LLVMInt32Type();
+ elem_types[LP_JIT_TEXTURE_ROW_STRIDE] =
+ LLVMArrayType(LLVMInt32Type(), LP_MAX_TEXTURE_2D_LEVELS);
elem_types[LP_JIT_TEXTURE_DATA] =
LLVMArrayType(LLVMPointerType(LLVMInt8Type(), 0),
LP_MAX_TEXTURE_2D_LEVELS);
@@ -76,9 +77,9 @@ lp_jit_init_globals(struct llvmpipe_screen *screen)
LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, last_level,
screen->target, texture_type,
LP_JIT_TEXTURE_LAST_LEVEL);
- LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, stride,
+ LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, row_stride,
screen->target, texture_type,
- LP_JIT_TEXTURE_STRIDE);
+ LP_JIT_TEXTURE_ROW_STRIDE);
LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, data,
screen->target, texture_type,
LP_JIT_TEXTURE_DATA);