summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_texture.h
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-04-19 17:05:05 -0600
committerBrian Paul <brianp@vmware.com>2010-04-19 17:07:25 -0600
commitf4071e55dba8c0f45f3a7f59135b34e5b81fdab8 (patch)
tree09145390a1500ea50a33ed8e7a1bdaea67d47278 /src/gallium/drivers/llvmpipe/lp_texture.h
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_texture.h')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_texture.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_texture.h b/src/gallium/drivers/llvmpipe/lp_texture.h
index 57f3e0f72c..5862f979da 100644
--- a/src/gallium/drivers/llvmpipe/lp_texture.h
+++ b/src/gallium/drivers/llvmpipe/lp_texture.h
@@ -92,7 +92,9 @@ struct llvmpipe_resource
struct pipe_resource base;
/** Row stride in bytes */
- unsigned stride[LP_MAX_TEXTURE_LEVELS];
+ unsigned row_stride[LP_MAX_TEXTURE_LEVELS];
+ /** Image stride (for cube maps or 3D textures) in bytes */
+ unsigned img_stride[LP_MAX_TEXTURE_LEVELS];
unsigned tiles_per_row[LP_MAX_TEXTURE_LEVELS];
unsigned tiles_per_image[LP_MAX_TEXTURE_LEVELS];
/** Number of 3D slices or cube faces per level */
@@ -164,7 +166,7 @@ llvmpipe_resource_stride(struct pipe_resource *resource,
{
struct llvmpipe_resource *lpr = llvmpipe_resource(resource);
assert(level < LP_MAX_TEXTURE_2D_LEVELS);
- return lpr->stride[level];
+ return lpr->row_stride[level];
}