Ilia Mirkin
2015-Apr-05 21:47 UTC
[Nouveau] [PATCH] nv50, nvc0: limit the y-tiling of 3d textures to the first level's tiling
For some reason we limit y-tiling to 0x20 when depth is involved. However the function is run for each miplevel, and it appears that you can't have higher tiling for a smaller miplevel than a larger miplevel. So when we detect the condtion, limit the height passed to the tiling function appropriately. Fixes: texelFetch fs sampler3D 98x129x1-98x129x9 Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu> --- This still needs a full piglit run, both on nvc0 and nv50. An alternative solution is not to limit y-tiling, but presumably it was done for a reason. joi points out it was added in 040e1d008 -- perhaps there was no good reason. src/gallium/drivers/nouveau/nv50/nv50_miptree.c | 5 ++++- src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/nouveau/nv50/nv50_miptree.c b/src/gallium/drivers/nouveau/nv50/nv50_miptree.c index 2e41091..0837698 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_miptree.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_miptree.c @@ -304,7 +304,10 @@ nv50_miptree_init_layout_tiled(struct nv50_miptree *mt) lvl->offset = mt->total_size; - lvl->tile_mode = nv50_tex_choose_tile_dims(nbx, nby, d); + if (mt->layout_3d && d == 1 && l > 0 && pt->depth0 > 1) + lvl->tile_mode = nv50_tex_choose_tile_dims(nbx, MIN2(nby, 16), d); + else + lvl->tile_mode = nv50_tex_choose_tile_dims(nbx, nby, d); tsx = NV50_TILE_SIZE_X(lvl->tile_mode); /* x is tile row pitch in bytes */ tsy = NV50_TILE_SIZE_Y(lvl->tile_mode); diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c b/src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c index 1beda7d..25ce6bd 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c @@ -211,7 +211,10 @@ nvc0_miptree_init_layout_tiled(struct nv50_miptree *mt) lvl->offset = mt->total_size; - lvl->tile_mode = nvc0_tex_choose_tile_dims(nbx, nby, d); + if (mt->layout_3d && d == 1 && l > 0 && pt->depth0 > 1) + lvl->tile_mode = nvc0_tex_choose_tile_dims(nbx, MIN2(nby, 32), d); + else + lvl->tile_mode = nvc0_tex_choose_tile_dims(nbx, nby, d); tsx = NVC0_TILE_SIZE_X(lvl->tile_mode); /* x is tile row pitch in bytes */ tsy = NVC0_TILE_SIZE_Y(lvl->tile_mode); -- 2.0.5