diff --git a/src/gallium/drivers/asahi/agx_pipe.c b/src/gallium/drivers/asahi/agx_pipe.c index c0aa7d84a92..105a1443424 100644 --- a/src/gallium/drivers/asahi/agx_pipe.c +++ b/src/gallium/drivers/asahi/agx_pipe.c @@ -167,7 +167,6 @@ agx_resource_create(struct pipe_screen *screen, nresource->modifier = agx_select_modifier(nresource); nresource->mipmapped = (templ->last_level > 0); - nresource->internal_format = nresource->base.format; assert(templ->format != PIPE_FORMAT_Z24X8_UNORM && templ->format != PIPE_FORMAT_Z24_UNORM_S8_UINT && @@ -286,10 +285,10 @@ agx_transfer_map(struct pipe_context *pctx, if (rsrc->modifier == DRM_FORMAT_MOD_APPLE_TWIDDLED) { transfer->base.stride = - util_format_get_stride(resource->format, box->width); + util_format_get_stride(rsrc->layout.format, box->width); transfer->base.layer_stride = - util_format_get_2d_size(resource->format, transfer->base.stride, + util_format_get_2d_size(rsrc->layout.format, transfer->base.stride, box->height); transfer->map = calloc(transfer->base.layer_stride, box->depth); @@ -1143,7 +1142,7 @@ agx_resource_get_stencil(struct pipe_resource *prsrc) static enum pipe_format agx_resource_get_internal_format(struct pipe_resource *prsrc) { - return agx_resource(prsrc)->internal_format; + return agx_resource(prsrc)->layout.format; } static const struct u_transfer_vtbl transfer_vtbl = { diff --git a/src/gallium/drivers/asahi/agx_state.h b/src/gallium/drivers/asahi/agx_state.h index 862f069f070..868ef1985df 100644 --- a/src/gallium/drivers/asahi/agx_state.h +++ b/src/gallium/drivers/asahi/agx_state.h @@ -294,9 +294,6 @@ struct agx_resource { * resources. */ struct agx_resource *separate_stencil; - - /* Internal format, since many depth/stencil formats are emulated. */ - enum pipe_format internal_format; }; static inline struct agx_resource * diff --git a/src/gallium/drivers/asahi/magic.c b/src/gallium/drivers/asahi/magic.c index 6964eea8cea..722a67b2b22 100644 --- a/src/gallium/drivers/asahi/magic.c +++ b/src/gallium/drivers/asahi/magic.c @@ -116,7 +116,7 @@ asahi_pack_iogpu_attachment(void *out, struct agx_resource *rsrc, assert(surf->u.tex.first_layer == surf->u.tex.last_layer); agx_pack(out, IOGPU_ATTACHMENT, cfg) { - cfg.type = asahi_classify_attachment(rsrc->base.format); + cfg.type = asahi_classify_attachment(rsrc->layout.format); cfg.address = agx_map_surface_resource(surf, rsrc); cfg.size = rsrc->layout.size_B; cfg.percent = (100 * cfg.size) / total_size; @@ -205,7 +205,11 @@ demo_cmdbuf(uint64_t *buf, size_t size, if (framebuffer->zsbuf) { struct pipe_surface *zsbuf = framebuffer->zsbuf; const struct util_format_description *desc = - util_format_description(zsbuf->texture->format); + util_format_description(agx_resource(zsbuf->texture)->layout.format); + + assert(desc->format == PIPE_FORMAT_Z32_FLOAT || + desc->format == PIPE_FORMAT_Z32_FLOAT_S8X24_UINT || + desc->format == PIPE_FORMAT_S8_UINT); cfg.depth_width = framebuffer->width; cfg.depth_height = framebuffer->height;