.format = ISL_FORMAT_${format.name},
.name = "ISL_FORMAT_${format.name}",
.bpb = ${format.bpb},
- .bs = ${format.bpb // 8},
.bw = ${format.bw},
.bh = ${format.bh},
.bd = ${format.bd},
* being used to determine whether additional pages need to be defined.
*/
assert(phys_slice0_sa->w % fmtl->bw == 0);
- row_pitch = MAX(row_pitch, fmtl->bs * (phys_slice0_sa->w / fmtl->bw));
+ const uint32_t bs = fmtl->bpb / 8;
+ row_pitch = MAX(row_pitch, bs * (phys_slice0_sa->w / fmtl->bw));
/* From the Broadwel PRM >> Volume 2d: Command Reference: Structures >>
* RENDER_SURFACE_STATE Surface Pitch (p349):
*/
if (info->usage & ISL_SURF_USAGE_RENDER_TARGET_BIT) {
if (isl_format_is_yuv(info->format)) {
- row_pitch = isl_align_npot(row_pitch, 2 * fmtl->bs);
+ row_pitch = isl_align_npot(row_pitch, 2 * bs);
} else {
- row_pitch = isl_align_npot(row_pitch, fmtl->bs);
+ row_pitch = isl_align_npot(row_pitch, bs);
}
}
base_alignment = MAX(1, info->min_alignment);
if (info->usage & ISL_SURF_USAGE_RENDER_TARGET_BIT) {
if (isl_format_is_yuv(info->format)) {
- base_alignment = MAX(base_alignment, 2 * fmtl->bs);
+ base_alignment = MAX(base_alignment, fmtl->bpb / 4);
} else {
- base_alignment = MAX(base_alignment, fmtl->bs);
+ base_alignment = MAX(base_alignment, fmtl->bpb / 8);
}
}
} else {
const char *name;
uint16_t bpb; /**< Bits per block */
- uint8_t bs; /**< Block size, in bytes, rounded towards 0 */
uint8_t bw; /**< Block width, in pixels */
uint8_t bh; /**< Block height, in pixels */
uint8_t bd; /**< Block depth, in pixels */
{
const struct isl_format_layout *fmtl = isl_format_get_layout(surf->format);
- assert(surf->row_pitch % fmtl->bs == 0);
- return surf->row_pitch / fmtl->bs;
+ assert(surf->row_pitch % (fmtl->bpb / 8) == 0);
+ return surf->row_pitch / (fmtl->bpb / 8);
}
/**
assert(isl_tiling_is_std_y(tiling));
- const uint32_t bs = fmtl->bs;
+ const uint32_t bpb = fmtl->bpb;
const uint32_t is_Ys = tiling == ISL_TILING_Ys;
switch (info->dim) {
* Layout and Tiling > 1D Surfaces > 1D Alignment Requirements.
*/
*align_sa = (struct isl_extent3d) {
- .w = 1 << (12 - (ffs(bs) - 1) + (4 * is_Ys)),
+ .w = 1 << (12 - (ffs(bpb) - 4) + (4 * is_Ys)),
.h = 1,
.d = 1,
};
* Requirements.
*/
*align_sa = (struct isl_extent3d) {
- .w = 1 << (6 - ((ffs(bs) - 1) / 2) + (4 * is_Ys)),
- .h = 1 << (6 - ((ffs(bs) - 0) / 2) + (4 * is_Ys)),
+ .w = 1 << (6 - ((ffs(bpb) - 4) / 2) + (4 * is_Ys)),
+ .h = 1 << (6 - ((ffs(bpb) - 3) / 2) + (4 * is_Ys)),
.d = 1,
};
* Layout and Tiling > 1D Surfaces > 1D Alignment Requirements.
*/
*align_sa = (struct isl_extent3d) {
- .w = 1 << (4 - ((ffs(bs) + 1) / 3) + (4 * is_Ys)),
- .h = 1 << (4 - ((ffs(bs) - 1) / 3) + (2 * is_Ys)),
- .d = 1 << (4 - ((ffs(bs) - 0) / 3) + (2 * is_Ys)),
+ .w = 1 << (4 - ((ffs(bpb) - 2) / 3) + (4 * is_Ys)),
+ .h = 1 << (4 - ((ffs(bpb) - 4) / 3) + (2 * is_Ys)),
+ .d = 1 << (4 - ((ffs(bpb) - 3) / 3) + (2 * is_Ys)),
};
return;
}
isl_surf_get_image_offset_el(surf, view->base_level, view->base_array_layer,
0, ¶m->offset[0], ¶m->offset[1]);
- const int cpp = isl_format_get_layout(surf->format)->bs;
+ const int cpp = isl_format_get_layout(surf->format)->bpb / 8;
param->stride[0] = cpp;
param->stride[1] = surf->row_pitch / cpp;
{
*param = image_param_defaults;
- param->stride[0] = isl_format_layouts[format].bs;
+ param->stride[0] = isl_format_layouts[format].bpb / 8;
param->size[0] = size / param->stride[0];
}
anv_fill_buffer_surface_state(device, view->surface_state,
view->format,
view->offset, view->range,
- isl_format_get_layout(view->format)->bs);
+ isl_format_get_layout(view->format)->bpb / 8);
} else {
view->surface_state = (struct anv_state){ 0 };
}
storage_format,
view->offset, view->range,
(storage_format == ISL_FORMAT_RAW ? 1 :
- isl_format_get_layout(storage_format)->bs));
+ isl_format_get_layout(storage_format)->bpb / 8));
isl_buffer_fill_image_param(&device->isl_dev,
&view->storage_image_param,
.bo = image->bo,
.tiling = surf->isl.tiling,
.base_offset = image->offset + surf->offset,
- .bs = isl_format_get_layout(surf->isl.format)->bs,
+ .bs = isl_format_get_layout(surf->isl.format)->bpb / 8,
.pitch = isl_surf_get_row_pitch(&surf->isl),
};
}
.bo = buffer->bo,
.tiling = ISL_TILING_LINEAR,
.base_offset = buffer->offset + pRegions[r].bufferOffset,
- .bs = isl_format_get_layout(buf_format)->bs,
+ .bs = isl_format_get_layout(buf_format)->bpb / 8,
.pitch = buf_extent_el.width * buf_bsurf.bs,
};