#include "nv50/nv50_resource.h"
uint32_t
-nv50_tex_choose_tile_dims_helper(unsigned nx, unsigned ny, unsigned nz)
+nv50_tex_choose_tile_dims_helper(unsigned nx, unsigned ny, unsigned nz,
+ boolean is_3d)
{
uint32_t tile_mode = 0x000;
else
if (ny > 8) tile_mode = 0x010; /* height 16 tiles */
- if (nz == 1)
+ if (!is_3d)
return tile_mode;
else
if (tile_mode > 0x020)
if (nz > 8) return tile_mode | 0x400; /* depth 16 tiles */
if (nz > 4) return tile_mode | 0x300; /* depth 8 tiles */
if (nz > 2) return tile_mode | 0x200; /* depth 4 tiles */
+ if (nz > 1) return tile_mode | 0x100; /* depth 2 tiles */
- return tile_mode | 0x100;
+ return tile_mode;
}
static uint32_t
-nv50_tex_choose_tile_dims(unsigned nx, unsigned ny, unsigned nz)
+nv50_tex_choose_tile_dims(unsigned nx, unsigned ny, unsigned nz, boolean is_3d)
{
- return nv50_tex_choose_tile_dims_helper(nx, ny * 2, nz);
+ return nv50_tex_choose_tile_dims_helper(nx, ny * 2, nz, is_3d);
}
static uint32_t
lvl->offset = mt->total_size;
- lvl->tile_mode = nv50_tex_choose_tile_dims(nbx, nby, d);
+ lvl->tile_mode = nv50_tex_choose_tile_dims(nbx, nby, d, mt->layout_3d);
tsx = NV50_TILE_SIZE_X(lvl->tile_mode); /* x is tile row pitch in bytes */
tsy = NV50_TILE_SIZE_Y(lvl->tile_mode);
#endif /* __NVC0_RESOURCE_H__ */
uint32_t
-nv50_tex_choose_tile_dims_helper(unsigned nx, unsigned ny, unsigned nz);
+nv50_tex_choose_tile_dims_helper(unsigned nx, unsigned ny, unsigned nz,
+ boolean is_3d);
struct nv50_miptree_level {
uint32_t offset;
#include "nvc0/nvc0_resource.h"
static uint32_t
-nvc0_tex_choose_tile_dims(unsigned nx, unsigned ny, unsigned nz)
+nvc0_tex_choose_tile_dims(unsigned nx, unsigned ny, unsigned nz, boolean is_3d)
{
- return nv50_tex_choose_tile_dims_helper(nx, ny, nz);
+ return nv50_tex_choose_tile_dims_helper(nx, ny, nz, is_3d);
}
static uint32_t
lvl->offset = mt->total_size;
- lvl->tile_mode = nvc0_tex_choose_tile_dims(nbx, nby, d);
+ lvl->tile_mode = nvc0_tex_choose_tile_dims(nbx, nby, d, mt->layout_3d);
tsx = NVC0_TILE_SIZE_X(lvl->tile_mode); /* x is tile row pitch in bytes */
tsy = NVC0_TILE_SIZE_Y(lvl->tile_mode);