/* When this layout is used the horizontal alignment is fixed at 64 and the
* hardware ignores the value given in the surface state
*/
- const unsigned int align_w = 64;
+ const unsigned int halign = 64;
mt->total_height = mt->physical_height0;
mt->total_width = 0;
intel_miptree_set_level_info(mt, level, x, 0, depth);
- img_width = ALIGN(width, align_w);
+ img_width = ALIGN(width, halign);
mt->total_width = MAX2(mt->total_width, x + img_width);
unsigned mip1_width;
if (mt->compressed) {
- mip1_width = ALIGN_NPOT(minify(mt->physical_width0, 1), mt->align_w) +
+ mip1_width = ALIGN_NPOT(minify(mt->physical_width0, 1), mt->halign) +
ALIGN_NPOT(minify(mt->physical_width0, 2), bw);
} else {
- mip1_width = ALIGN_NPOT(minify(mt->physical_width0, 1), mt->align_w) +
+ mip1_width = ALIGN_NPOT(minify(mt->physical_width0, 1), mt->halign) +
minify(mt->physical_width0, 2);
}
intel_miptree_set_level_info(mt, level, x, y, depth);
- img_height = ALIGN_NPOT(height, mt->align_h);
+ img_height = ALIGN_NPOT(height, mt->valign);
if (mt->compressed)
img_height /= bh;
/* Layout_below: step right after second mipmap.
*/
if (level == mt->first_level + 1) {
- x += ALIGN_NPOT(width, mt->align_w) / bw;
+ x += ALIGN_NPOT(width, mt->halign) / bw;
} else {
y += img_height;
}
{
if ((brw->gen < 9 && mt->target == GL_TEXTURE_3D) ||
(brw->gen == 4 && mt->target == GL_TEXTURE_CUBE_MAP)) {
- return ALIGN_NPOT(minify(mt->physical_width0, level), mt->align_w);
+ return ALIGN_NPOT(minify(mt->physical_width0, level), mt->halign);
} else {
return 0;
}
} else if (mt->target == GL_TEXTURE_3D ||
(brw->gen == 4 && mt->target == GL_TEXTURE_CUBE_MAP) ||
mt->array_layout == ALL_SLICES_AT_EACH_LOD) {
- return ALIGN_NPOT(minify(mt->physical_height0, level), mt->align_h);
+ return ALIGN_NPOT(minify(mt->physical_height0, level), mt->valign);
} else {
- const unsigned h0 = ALIGN_NPOT(mt->physical_height0, mt->align_h);
- const unsigned h1 = ALIGN_NPOT(minify(mt->physical_height0, 1), mt->align_h);
+ const unsigned h0 = ALIGN_NPOT(mt->physical_height0, mt->valign);
+ const unsigned h1 = ALIGN_NPOT(minify(mt->physical_height0, 1), mt->valign);
- return h0 + h1 + (brw->gen >= 7 ? 12 : 11) * mt->align_h;
+ return h0 + h1 + (brw->gen >= 7 ? 12 : 11) * mt->valign;
}
}
for (unsigned level = mt->first_level; level <= mt->last_level; level++) {
unsigned img_height;
- img_height = ALIGN_NPOT(height, mt->align_h);
+ img_height = ALIGN_NPOT(height, mt->valign);
if (mt->compressed)
- img_height /= mt->align_h;
+ img_height /= mt->valign;
for (unsigned q = 0; q < mt->level[level].depth; q++) {
if (mt->array_layout == ALL_SLICES_AT_EACH_LOD) {
unsigned WL = MAX2(mt->physical_width0 >> level, 1);
unsigned HL = MAX2(mt->physical_height0 >> level, 1);
unsigned DL = MAX2(mt->physical_depth0 >> level, 1);
- unsigned wL = ALIGN_NPOT(WL, mt->align_w);
- unsigned hL = ALIGN_NPOT(HL, mt->align_h);
+ unsigned wL = ALIGN_NPOT(WL, mt->halign);
+ unsigned hL = ALIGN_NPOT(HL, mt->valign);
if (mt->target == GL_TEXTURE_CUBE_MAP)
DL = 6;
* to know that ahead of time. And besides, since we use a vertical
* alignment of 4 as often as we can, this shouldn't happen very often.
*/
- if (brw->gen == 7 && mt->align_h == 2 &&
+ if (brw->gen == 7 && mt->valign == 2 &&
brw->format_supported_as_render_target[mt->format]) {
return I915_TILING_X;
}
/* Stencil uses W tiling, so we force W tiling alignment for the
* ALL_SLICES_AT_EACH_LOD miptree layout.
*/
- mt->align_w = 64;
- mt->align_h = 64;
+ mt->halign = 64;
+ mt->valign = 64;
assert((layout_flags & MIPTREE_LAYOUT_FORCE_HALIGN16) == 0);
} else {
/* Depth uses Y tiling, so we force need Y tiling alignment for the
* ALL_SLICES_AT_EACH_LOD miptree layout.
*/
- mt->align_w = 128 / mt->cpp;
- mt->align_h = 32;
+ mt->halign = 128 / mt->cpp;
+ mt->valign = 32;
}
} else if (mt->compressed) {
/* The hardware alignment requirements for compressed textures
* happen to match the block boundaries.
*/
- _mesa_get_format_block_size(mt->format, &mt->align_w, &mt->align_h);
+ _mesa_get_format_block_size(mt->format, &mt->halign, &mt->valign);
/* On Gen9+ we can pick our own alignment for compressed textures but it
* has to be a multiple of the block size. The minimum alignment we can
* size
*/
if (brw->gen >= 9) {
- mt->align_w *= 4;
- mt->align_h *= 4;
+ mt->halign *= 4;
+ mt->valign *= 4;
}
} else if (mt->format == MESA_FORMAT_S_UINT8) {
- mt->align_w = 8;
- mt->align_h = brw->gen >= 7 ? 8 : 4;
+ mt->halign = 8;
+ mt->valign = brw->gen >= 7 ? 8 : 4;
} else if (brw->gen >= 9 && mt->tr_mode != INTEL_MIPTREE_TRMODE_NONE) {
/* XY_FAST_COPY_BLT doesn't support horizontal alignment < 32 or
* vertical alignment < 64. */
- mt->align_w = MAX2(tr_mode_horizontal_texture_alignment(brw, mt), 32);
- mt->align_h = MAX2(tr_mode_vertical_texture_alignment(brw, mt), 64);
+ mt->halign = MAX2(tr_mode_horizontal_texture_alignment(brw, mt), 32);
+ mt->valign = MAX2(tr_mode_vertical_texture_alignment(brw, mt), 64);
} else {
- mt->align_w =
+ mt->halign =
intel_horizontal_texture_alignment_unit(brw, mt, layout_flags);
- mt->align_h = intel_vertical_texture_alignment_unit(brw, mt);
+ mt->valign = intel_vertical_texture_alignment_unit(brw, mt);
}
}
if (brw->gen >= 9) {
unsigned int i, j;
_mesa_get_format_block_size(mt->format, &i, &j);
- mt->align_w /= i;
- mt->align_h /= j;
+ mt->halign /= i;
+ mt->valign /= j;
}
if ((layout_flags & MIPTREE_LAYOUT_FOR_BO) == 0)