From 040e1d008f8f8258f1b0ee0fcdf4906e0979fb66 Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Tue, 3 Nov 2009 23:19:56 +0100 Subject: 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. --- src/gallium/drivers/nv50/nv50_context.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/gallium/drivers/nv50/nv50_context.h') diff --git a/src/gallium/drivers/nv50/nv50_context.h b/src/gallium/drivers/nv50/nv50_context.h index 890defb90c..4b0f062295 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; -- cgit v1.2.3