diff options
author | Christoph Bumiller <[email protected]> | 2009-11-03 23:19:56 +0100 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2009-11-04 00:53:51 +0100 |
commit | 040e1d008f8f8258f1b0ee0fcdf4906e0979fb66 (patch) | |
tree | 0d4348bf43d94dfe423f1df2fb97377a47fed6b4 /src/gallium/drivers/nv50/nv50_context.h | |
parent | c475079ef2d901ba4506ebd53e19419cd46793ab (diff) |
nv50: add 3d texture tiling and mip-mapping
Mip-mapped 3D textures are not arrays of 2D layers
with a mip-map layout like 2D textures, therefore we
cannot use image_nr == depth for them.
Making use of "volume tiling" modes now, the allowed
modes are 0xZY where Z <= 5 and y <= 5.
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_context.h')
-rw-r--r-- | src/gallium/drivers/nv50/nv50_context.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/drivers/nv50/nv50_context.h b/src/gallium/drivers/nv50/nv50_context.h index 890defb90cb..4b0f0622953 100644 --- a/src/gallium/drivers/nv50/nv50_context.h +++ b/src/gallium/drivers/nv50/nv50_context.h @@ -69,6 +69,18 @@ struct nv50_sampler_stateobj { unsigned tsc[8]; }; +static INLINE unsigned +get_tile_height(uint32_t tile_mode) +{ + return 1 << ((tile_mode & 0xf) + 2); +} + +static INLINE unsigned +get_tile_depth(uint32_t tile_mode) +{ + return 1 << (tile_mode >> 4); +} + struct nv50_miptree_level { int *image_offset; unsigned pitch; |