asahi: allow compressed image stores in blits

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
This commit is contained in:
Alyssa Rosenzweig 2023-12-07 10:30:03 -04:00
parent c54502ebe0
commit 54ea408742

View file

@ -118,23 +118,27 @@ agx_set_shader_images(struct pipe_context *pctx, enum pipe_shader_type shader,
/* Images writeable with pixel granularity are incompatible with
* compression. Decompress if necessary.
*
* Driver-internal images are used by the compute blitter and are exempt
* from these transitions, as it only uses compressed images when safe.
*/
struct agx_resource *rsrc = agx_resource(image->resource);
if (!rsrc->layout.writeable_image &&
(image->shader_access & PIPE_IMAGE_ACCESS_WRITE)) {
if (!(image->access & PIPE_IMAGE_ACCESS_DRIVER_INTERNAL)) {
struct agx_resource *rsrc = agx_resource(image->resource);
if (!rsrc->layout.writeable_image &&
(image->shader_access & PIPE_IMAGE_ACCESS_WRITE)) {
agx_decompress(ctx, rsrc, "Shader image");
agx_decompress(ctx, rsrc, "Shader image");
}
/* Readable images may be compressed but are still subject to format
* reinterpretation rules.
*/
agx_legalize_compression(ctx, rsrc, image->format);
if (image->shader_access & PIPE_IMAGE_ACCESS_WRITE)
assert(rsrc->layout.writeable_image);
}
/* Readable images may be compressed but are still subject to format
* reinterpretation rules.
*/
agx_legalize_compression(ctx, rsrc, image->format);
if (image->shader_access & PIPE_IMAGE_ACCESS_WRITE)
assert(rsrc->layout.writeable_image);
/* FIXME: Decompress here once we have texture compression */
util_copy_image_view(&ctx->stage[shader].images[start_slot + i], image);
}