asahi: Identify more shader-related fields
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Fri, 14 Oct 2022 03:08:11 +0000 (23:08 -0400)
committerAlyssa Rosenzweig <alyssa@rosenzweig.io>
Sat, 22 Oct 2022 18:58:37 +0000 (14:58 -0400)
commit06cb242a54ccb9b200c8a4b00a17417732ee152a
treea2cf06db33866929a77424e64115b884fc657488
parent24bfa5af88d4227d254e4be29442c44f05bfad69
asahi: Identify more shader-related fields

The big discovery is the "number of uniform registers" field. I learned
about this one accidentally when my preamble shaders weren't working
right, because we had inadvertently hardcoded "at most 32 registers" :-)

In the course of identifying that field, I found that the pipeline
address is used as a tagged pointer, with some unknown field in the
bottom bits and alignment demanded. The XML is updated to account for
this.

I later found that there's also a "number of general purpose registers
used by the preamble shader" field. I missed this one first, because the
encoding is slightly different from the usual "number of general purpose
registers in the main shader" field. The specification is slightly
coarser. I don't know why the hardware needs that
information anyway -- occupancy of the preamble shader should be
irrelevant -- but it's not a big deal.

Finally I found that the "more than 4 textures?" bit is... not that. I
do not yet know what it is, but it is... not that.

These all use the new groups() modifier for GenXML

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18813>
src/asahi/lib/cmdbuf.xml
src/asahi/lib/gen_pack.py
src/gallium/drivers/asahi/agx_state.c