Commit Graph

180049 Commits

Author SHA1 Message Date
Eric Engestrom
a5cb331c64 gitlab_gql: strip newline at the end of the token file
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26075>
2023-11-07 06:06:22 +00:00
Alyssa Rosenzweig
ea6502d7cc asahi: Implement ARB_base_instance
Now that load_base_instance is wired up (as part of the indirect GS
implementation), this is really easy. Validated with Piglit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Mary Guillemard
643428bd7f agx: Emit stack_adjust in the entrypoint
Allocate space to fit scratch space.

Signed-off-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Mary Guillemard
a5cdc86da0 agx: Add stack adjust opcode
Signed-off-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Mary Guillemard
588fd6dfd6 agx: Implement scratch load/store
Signed-off-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Mary Guillemard
c15115de6b agx: Add stack load and store opcodes
Signed-off-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
67d0f035ae docs: Mark timer queries as done on asahi
Strictly needs uapi support that's not upstream, but so does the rest of the
driver (-:

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
49225db140 asahi: Implement timer queries
Everything but the uapi piece.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Mary Guillemard
bc8232c4a2 asahi: clc: Handle doorbell and stack mapping intrinsics
Also move nir_interleave_agx definition to libagx.h

Signed-off-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Mary Guillemard
514d432e50 agx: Handle doorbell and stack mapping intrinsics
Signed-off-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Mary Guillemard
ee0e7b8347 agx: Add doorbell and stack mapping opcodes
Signed-off-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Mary Guillemard
0aa4148978 nir: Add AGX-specific doorbell and stack mapping opcodes
Signed-off-by: Mary Guillemard <mary@mary.zone>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
5d279ecd04 asahi: Advertise ARB_clip_control
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
c5dddd1d53 asahi: Plumb clip_halfz bit from RS
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
fdb995c204 asahi: Don't use OpenGL clip bit
This lets us implement clip control.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
695aef7f5a asahi: rm unused deqp debug flag
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
3270556eaa asahi: Advertise geometry shaders
and cube arrays.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
c6a118b654 asahi: Wire up geometry shaders
- Compile GS with linked VS and auxiliary programs
- Dispatch GS as compute programs + an indirect draw with the GS copy program
- Use passthrough GS to implement XFB, replacing old XFB impl.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
fe7650bcf7 asahi: Add GS lowering pass
The big monster.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
43e134b106 asahi: Add helpers for lowering GS
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
6a67e220b8 asahi: Add data structures for geometry shaders
Shared between GPU and CPU.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
0b96b62348 asahi: Make encoder_allocate public
In order to enqueue CDM and VDM to the same queue.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
c9dd59fef3 asahi: Factor out agx_launch
For launching compute kernels on particular batches without dirtying state.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
212f71734e asahi: Refactor encoder data structure
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
82e3eb4b74 asahi: Don't hazard track fake resources
Convenient for meta, which we use for implementing GS.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
949741d4c3 asahi: Upload tex/samplers properly with merged shaders
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
21d3c1e0af asahi: Use the sampler heap
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
dc44619c62 asahi: Add sampler heap data structure
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
9c575eb18a asahi: Handle load_sampler_handle
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
df2c145c91 agx: Handle bindless samplers
Unified encoding.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
ca42562c7f agx: Lower LOD bias earlier
To make the extra descriptor accesses explicit for drivers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
972f289740 asahi: Lower samplers to bindless if needed
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
111e526f19 agx: Allow drivers to lower texture handles
Rather than hardcoding u0_u1, this lets drivers map texture handles in whatever
way is convenient. In particular, this makes textures work properly with merged
shader stages (provided one of the stages is forced to use bindless access), by
giving each stage an independent texture heap.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
b69ab37bdc asahi: Pack non-border colour sampler desc
Apparently custom border colours don't work properly with bindless. Needs
investigation. Patch this out so we don't fault.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
a74fbb3840 agx: Translate simple subgroup ops
We'll use these for optimizing parallel prefix sums.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
77bb446e90 agx: Add scaffolding for subgroup ops
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
5b754410da agx: Require 32-bit alignment for EOT offset
Fixes piles of brokenness.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
7d7f5013f8 agx: Cleanup 8-bit math before lowering
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
3b84f371a8 docs/features: Mark ARB_mdi done on asahi
Sync with reality.

I think all gallium drivers support, it's a cpu-only thing unlike gl4.6's
indirect multidraws or the similarly named vk feature.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
b18181d924 agx: Check for spilling in release builds
Don't smash stack -- explain to the user what happened.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
7b92c63105 agx: Fix fragment side effects scheduling
We can't move discards across side effects, or the side effect might not happen.

Fixes KHR-GLES31.core.shader_image_load_store.basic-allFormats-load-fs
regression. Sigh.

CI is up next.

Fixes: 119e5b9719 ("agx: Schedule for register pressure")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Christian Gmeiner
e928f45735 agx: Re-index nir defs to reduce memory usage
nir_index_ssa_defs(..) will re-index the function impl and will
update ssa_alloc. In almost all cases this will result in a lower
ctx->alloc number which reduces memory usage in compiler passes
that are using ctx-alloc to allocate memory.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:54 +00:00
Alyssa Rosenzweig
b6b01aa1f2 agx: Legalize image MS index
Fix 2D MSAA Array tests in arb_shader_image_load_store-max-size

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:54 +00:00
Alyssa Rosenzweig
019a52fff0 asahi: Clamp 8-bit integer RTs
Fixes gl-3.0-render-integer.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:54 +00:00
Alyssa Rosenzweig
8d9d9d0207 nir/print: handle adjacency
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:54 +00:00
Alyssa Rosenzweig
d0a4a8cda0 nir: Add intrinsics for lowering bindless textures/samplers
Needed for merged stages to work properly.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:54 +00:00
Alyssa Rosenzweig
33e80918de nir: Add intrinsics for lowering GS
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:54 +00:00
Alyssa Rosenzweig
cc3f20ca6c nir: Also gather decomposed primitive count
Simple extension.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:54 +00:00
Alyssa Rosenzweig
b65636ca40 nir/lower_gs_intrinsics: Count decomposed primitives too
We need both: decomposed primitives for transform feedback and regular
primitives for the sizing the index buffer.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:54 +00:00
Alyssa Rosenzweig
0a35aa3a2b nir/lower_gs_intrinsics: Append EndPrimitive
This is simpler for generic GS lowering.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:54 +00:00