}
static enum agx_layout
-agx_translate_layout(uint64_t modifier)
+agx_translate_layout(enum ail_tiling tiling)
{
- switch (modifier) {
- case DRM_FORMAT_MOD_APPLE_TWIDDLED:
+ switch (tiling) {
+ case AIL_TILING_TWIDDLED:
return AGX_LAYOUT_TWIDDLED;
- case DRM_FORMAT_MOD_LINEAR:
+ case AIL_TILING_LINEAR:
return AGX_LAYOUT_LINEAR;
- default:
- unreachable("Invalid modifier");
}
+
+ unreachable("Invalid tiling");
}
static enum agx_texture_dimension
assert(state->u.tex.first_layer == 0);
/* Must tile array textures */
- assert((rsrc->modifier != DRM_FORMAT_MOD_LINEAR) ||
+ assert((rsrc->layout.tiling != AIL_TILING_LINEAR) ||
(state->u.tex.last_layer == state->u.tex.first_layer));
/* Pack the descriptor into GPU memory */
agx_pack(&so->desc, TEXTURE, cfg) {
cfg.dimension = agx_translate_texture_dimension(state->target);
- cfg.layout = agx_translate_layout(rsrc->modifier);
+ cfg.layout = agx_translate_layout(rsrc->layout.tiling);
cfg.channels = agx_pixel_format[state->format].channels;
cfg.type = agx_pixel_format[state->format].type;
cfg.swizzle_r = agx_channel_from_pipe(out_swizzle[0]);
cfg.depth = layers;
}
- if (rsrc->modifier == DRM_FORMAT_MOD_LINEAR) {
+ if (rsrc->layout.tiling == AIL_TILING_LINEAR) {
cfg.stride = ail_get_linear_stride_B(&rsrc->layout, 0) - 16;
} else {
- assert(rsrc->modifier == DRM_FORMAT_MOD_APPLE_TWIDDLED);
+ assert(rsrc->layout.tiling == AIL_TILING_TWIDDLED);
cfg.unk_tiled = true;
}
}
assert(surf->u.tex.last_layer == layer);
agx_pack(ctx->render_target[i], RENDER_TARGET, cfg) {
- cfg.layout = agx_translate_layout(tex->modifier);
+ cfg.layout = agx_translate_layout(tex->layout.tiling);
cfg.channels = agx_pixel_format[surf->format].channels;
cfg.type = agx_pixel_format[surf->format].type;
if (tex->mipmapped)
cfg.unk_55 = 0x8;
- if (tex->modifier == DRM_FORMAT_MOD_LINEAR) {
+ if (tex->layout.tiling == AIL_TILING_LINEAR) {
cfg.stride = ail_get_linear_stride_B(&tex->layout, level) - 4;
} else {
cfg.unk_tiled = true;
* arrays and cube maps, we map a single layer as a 2D image.
*/
cfg.dimension = AGX_TEXTURE_DIMENSION_2D;
- cfg.layout = agx_translate_layout(rsrc->modifier);
+ cfg.layout = agx_translate_layout(rsrc->layout.tiling);
cfg.channels = agx_pixel_format[surf->format].channels;
cfg.type = agx_pixel_format[surf->format].type;
cfg.swizzle_r = agx_channel_from_pipe(desc->swizzle[0]);
cfg.srgb = (desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB);
cfg.address = agx_map_texture_gpu(rsrc, layer);
- if (rsrc->modifier == DRM_FORMAT_MOD_LINEAR)
+ if (rsrc->layout.tiling == AIL_TILING_LINEAR)
cfg.stride = ail_get_linear_stride_B(&rsrc->layout, surf->u.tex.level) - 16;
else
cfg.unk_tiled = true;