summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvc0/nvc0_resource.h
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2010-12-23 15:21:36 +0100
committerChristoph Bumiller <[email protected]>2010-12-23 15:21:36 +0100
commit96def0c3147ac7b9449de00bf1306dfd1ca436fb (patch)
tree3121d715d5b5e7c9f42d4ae851151737ccbd8b77 /src/gallium/drivers/nvc0/nvc0_resource.h
parent2c20aae23393a3f6899f1775df47697ce65fc6ca (diff)
nvc0: fix layer stride state
Diffstat (limited to 'src/gallium/drivers/nvc0/nvc0_resource.h')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_resource.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_resource.h b/src/gallium/drivers/nvc0/nvc0_resource.h
index 0ff7a03198e..9384f1905d8 100644
--- a/src/gallium/drivers/nvc0/nvc0_resource.h
+++ b/src/gallium/drivers/nvc0/nvc0_resource.h
@@ -66,12 +66,17 @@ nvc0_resource_unmap(struct nvc0_resource *res)
nouveau_bo_unmap(res->bo);
}
-#define NVC0_TILE_PITCH(m) (64 << ((m) & 0xf))
-#define NVC0_TILE_HEIGHT(m) (8 << (((m) >> 4) & 0xf))
-#define NVC0_TILE_DEPTH(m) (1 << ((m) >> 8))
+#define NVC0_TILE_DIM_SHIFT(m, d) (((m) >> (d * 4)) & 0xf)
-#define NVC0_TILE_SIZE(m) \
- (NVC0_TILE_PITCH(m) * NVC0_TILE_HEIGHT(m) * NVC0_TILE_DEPTH(m))
+#define NVC0_TILE_PITCH(m) (64 << NVC0_TILE_DIM_SHIFT(m, 0))
+#define NVC0_TILE_HEIGHT(m) ( 8 << NVC0_TILE_DIM_SHIFT(m, 1))
+#define NVC0_TILE_DEPTH(m) ( 1 << NVC0_TILE_DIM_SHIFT(m, 2))
+
+#define NVC0_TILE_SIZE_2D(m) (((64 * 8) << \
+ NVC0_TILE_DIM_SHIFT(m, 0)) << \
+ NVC0_TILE_DIM_SHIFT(m, 1))
+
+#define NVC0_TILE_SIZE(m) (NVC0_TILE_SIZE_2D(m) << NVC0_TILE_DIM_SHIFT(m, 2))
struct nvc0_miptree_level {
uint32_t offset;