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:
parent
c54502ebe0
commit
54ea408742
1 changed files with 17 additions and 13 deletions
|
|
@ -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
|
/* Images writeable with pixel granularity are incompatible with
|
||||||
* compression. Decompress if necessary.
|
* 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 (!(image->access & PIPE_IMAGE_ACCESS_DRIVER_INTERNAL)) {
|
||||||
if (!rsrc->layout.writeable_image &&
|
struct agx_resource *rsrc = agx_resource(image->resource);
|
||||||
(image->shader_access & PIPE_IMAGE_ACCESS_WRITE)) {
|
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);
|
util_copy_image_view(&ctx->stage[shader].images[start_slot + i], image);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue