asahi: Add software-defined field to texture desc

We use this for buffer textures.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25498>
This commit is contained in:
Alyssa Rosenzweig 2023-10-01 19:44:29 -04:00 committed by Marge Bot
parent eecd8390d0
commit 8ef7eec246
2 changed files with 5 additions and 4 deletions

View file

@ -314,6 +314,9 @@
<!-- If layout is linear, stride has the minus 1 encoded -->
<field name="Depth (linear)" size="11" start="128" type="uint" modifier="minus(1)" default="1"/>
<field name="Layer stride (linear)" size="27" start="139" type="uint" modifier="shr(7)"/>
<!-- Buffer texture size -->
<field name="Software-defined" size="64" start="128" type="hex"/>
</struct>
<enum name="Wrap">

View file

@ -666,10 +666,8 @@ agx_pack_texture(void *out, struct agx_resource *rsrc,
cfg.height = DIV_ROUND_UP(size_el, cfg.width);
cfg.first_level = cfg.last_level = 0;
/* Stash the actual size in an unused part of the texture descriptor,
* which we'll read later to implement txs.
*/
cfg.acceleration_buffer = (size_el << 4);
/* Stash the actual size in the software-defined section for txs */
cfg.software_defined = size_el;
} else {
cfg.width = rsrc->base.width0;
cfg.height = rsrc->base.height0;