asahi: Rework system value lowering
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Sat, 25 Feb 2023 16:44:36 +0000 (11:44 -0500)
committerMarge Bot <emma+marge@anholt.net>
Sun, 5 Mar 2023 19:40:43 +0000 (19:40 +0000)
commitc086f2770bd9f8714aef7b1c5814e5a38f4b55b5
tree578882fc67bc6bf03b5a991abdc2eab5fabd97e0
parentf92738eaaabb0ce9ca34f6cbe34824cb7925bb77
asahi: Rework system value lowering

The previous lowering was insufficient in two areas:

* No support for indirection. This is required for dynamically indexing into
  UBOs, SSBOS, etc in OpenGL ES 3.2

* Only a single table supported. Multiple tables are required to implement
  indirect dispatch/draws efficiently, in order to bind the indirect buffer as
  uniforms.

The first problem is addressed here by reworking the lowering of
system values to happen in NIR, decoupled from the uniform register assignment
details, such that we can handle 1:n lowerings in a straightforward way.
Namely, indirect sysvals are lowered to indirect memory loads relative to the
base address of the sysval table, where the table address is itself pushed as a
(direct) sysval.

The second problem is addressed in this patch by generalizing to multiple
uniform tables.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21703>
docs/features.txt
src/gallium/drivers/asahi/agx_nir_lower_sysvals.c
src/gallium/drivers/asahi/agx_state.c
src/gallium/drivers/asahi/agx_state.h
src/gallium/drivers/asahi/agx_uniforms.c