summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_jit.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-04-19 17:05:05 -0600
committerBrian Paul <[email protected]>2010-04-19 17:07:25 -0600
commitf4071e55dba8c0f45f3a7f59135b34e5b81fdab8 (patch)
tree09145390a1500ea50a33ed8e7a1bdaea67d47278 /src/gallium/drivers/llvmpipe/lp_jit.c
parent2cad62475b8263472f6fbd541b5b8ec2a1d40e62 (diff)
llvmpipe: get 3D texture image stride from an array rather than computing it
This fixes broken 3D texture indexing when the height of the 3D texture was less than 64 (the tile size). It's simpler to pass this as an array (as we do with the row stride) than to compute it on the fly.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_jit.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_jit.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_jit.c b/src/gallium/drivers/llvmpipe/lp_jit.c
index 7e8a117cc82..8690941a507 100644
--- a/src/gallium/drivers/llvmpipe/lp_jit.c
+++ b/src/gallium/drivers/llvmpipe/lp_jit.c
@@ -51,7 +51,7 @@ lp_jit_init_globals(struct llvmpipe_screen *screen)
/* struct lp_jit_texture */
{
- LLVMTypeRef elem_types[6];
+ LLVMTypeRef elem_types[LP_JIT_TEXTURE_NUM_FIELDS];
elem_types[LP_JIT_TEXTURE_WIDTH] = LLVMInt32Type();
elem_types[LP_JIT_TEXTURE_HEIGHT] = LLVMInt32Type();
@@ -59,6 +59,8 @@ lp_jit_init_globals(struct llvmpipe_screen *screen)
elem_types[LP_JIT_TEXTURE_LAST_LEVEL] = LLVMInt32Type();
elem_types[LP_JIT_TEXTURE_ROW_STRIDE] =
LLVMArrayType(LLVMInt32Type(), LP_MAX_TEXTURE_LEVELS);
+ elem_types[LP_JIT_TEXTURE_IMG_STRIDE] =
+ LLVMArrayType(LLVMInt32Type(), LP_MAX_TEXTURE_LEVELS);
elem_types[LP_JIT_TEXTURE_DATA] =
LLVMArrayType(LLVMPointerType(LLVMInt8Type(), 0),
LP_MAX_TEXTURE_LEVELS);
@@ -80,6 +82,9 @@ lp_jit_init_globals(struct llvmpipe_screen *screen)
LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, row_stride,
screen->target, texture_type,
LP_JIT_TEXTURE_ROW_STRIDE);
+ LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, img_stride,
+ screen->target, texture_type,
+ LP_JIT_TEXTURE_IMG_STRIDE);
LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, data,
screen->target, texture_type,
LP_JIT_TEXTURE_DATA);