Alyssa Rosenzweig
da59672e2b
asahi: derive ht
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28056 >
2024-03-12 19:41:49 +00:00
Alyssa Rosenzweig
a3f647fde1
asahi: precompile helper program
...
1. avoids cluttering shaders,internal print
2. reduces screen create overhead. this cuts average "glxinfo" runtime by about
25%, and seems to shave maybe 0.5% off the CTS job.
3. enforces helper program builds successfully as a build-time assertion
4. reduces the libagx generated blob for now, since g13 binaries are more
compact than serialized NIR
Closes https://gitlab.freedesktop.org/asahi/mesa/-/issues/37
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:32 +00:00
Alyssa Rosenzweig
4a3b905bb8
agx: move texture lowering into lib
...
This is a bit annoying, but it gets rid of the libagx dep which is preventing
precompiling helper programs.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:32 +00:00
Alyssa Rosenzweig
1f465d72dd
asahi: split out genxml/ directory
...
src/asahi/lib is creating dependency hell, let's start splitting it up so we can
ease some of the clc related pains.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:32 +00:00
Alyssa Rosenzweig
35c671ecef
asahi: clean up format table renderability
...
infer renderability from whether we specify a renderable format. nfc now that
rgb9e5 is fixed.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:32 +00:00
Alyssa Rosenzweig
3333c2cdeb
asahi/lib: use #pragma once
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:32 +00:00
Alyssa Rosenzweig
b39de8bb4a
asahi: Implement ARB_texture_barrier by decompression
...
Your perf goes not stonks, sorry. Passes
KHR-GL40.texture_barrier_ARB.*.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:32 +00:00
Alyssa Rosenzweig
2dc1189a9c
agx: rm unused backend nr_samples
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:32 +00:00
Alyssa Rosenzweig
27ddcea2b3
agx: call agx_nir_lower_sample_mask earlier
...
A given sample needs depth testing to happen before writing its colour, which
requires shuffling pass order.
To do so, merge agx_nir_opt_ixor_bcsel into regular late alg pass
now that we can, which is actually a small shader-db win.
Closes https://gitlab.freedesktop.org/asahi/mesa/-/issues/30
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:32 +00:00
Alyssa Rosenzweig
0eb9b62199
asahi: rm ia key
...
fully dynamic in GS now.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:32 +00:00
Alyssa Rosenzweig
beb7ddba2b
asahi: always support ARB_clip_control
...
perf impact has been neglible.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:32 +00:00
Alyssa Rosenzweig
6673924b7e
asahi: make gs topology dynamic
...
even with shobjs, we know the class of topology statically, so we just need to
select between the (up to) 3 compatible topologies, and luckily there are common
subexpressions we can factor out when calculating all 3 at once.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:32 +00:00
Alyssa Rosenzweig
049434f89c
asahi: make provoking vertex dynamic
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:32 +00:00
Alyssa Rosenzweig
dbb2b25ef9
asahi: eliminate tri fan %
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:32 +00:00
Alyssa Rosenzweig
43dd8b87cb
asahi: simplify expressions involving xfb
...
post-invert cleanup
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:32 +00:00
Alyssa Rosenzweig
b44630aa94
asahi: rm dead
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:32 +00:00
Alyssa Rosenzweig
86782156e7
asahi: invert geometry shaders
...
instead of dumping GS outputs to memory and using a GS copy vertex shader,
invert the GS to get a hardware vertex shader to use directly. theoretically,
reduces mem bandwidth at the cost of repeated work if we don't optimze well.
perhaps more importantly, it should reduce heap usage.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:32 +00:00
Alyssa Rosenzweig
1ac3e48fcc
asahi: fix vertex out size calc
...
expression underallocates if var31 is actually used!
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:31 +00:00
Alyssa Rosenzweig
141e084f55
asahi: use load_instance_id in gs lowering
...
it will lower differently in the prepass vs the rast shader
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:31 +00:00
Alyssa Rosenzweig
17896f1699
nir: rm load_vert_id_in_prim_agx
...
now unused since we separate vs/gs
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:31 +00:00
Alyssa Rosenzweig
e13d001160
asahi: rm arrayed output lowering
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:31 +00:00
Alyssa Rosenzweig
d96fbd4618
asahi: separate GS from VS
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:31 +00:00
Alyssa Rosenzweig
0b30777028
asahi: add geometry parameters for separable GS
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:31 +00:00
Alyssa Rosenzweig
cdd1b012e9
asahi: simplify IA mode handling
...
we'll solve the IA variants problem a different way, for now make more
straightforward.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:31 +00:00
Alyssa Rosenzweig
e1783fc083
libagx: generalize vertex_id_for_topology
...
so we can use it in separable GS
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:31 +00:00
Alyssa Rosenzweig
c9f55166dc
libagx: static assert some sizes
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:31 +00:00
Alyssa Rosenzweig
aaa609f030
libagx: use real PACKED macro
...
hopefully end these alignment bugs for good
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:31 +00:00
Alyssa Rosenzweig
fc929d9318
libagx: use native static_assert on host
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:31 +00:00
Alyssa Rosenzweig
bfaa3691e1
asahi: make GS flatshade_first more dynamic
...
baby step
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:31 +00:00
Alyssa Rosenzweig
4036c710bd
libagx: fix buggy align macro
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:31 +00:00
Alyssa Rosenzweig
784323cf0f
asahi: rip out existing MDI+GS implementation
...
I don't love deleting working code without a working replacement. But this impl
is deeply questionable as-is, and will only balloon in complexity for shader
objects. We need to go back to the drawing board with MDI and lower to real
draws, possibly with control stream looping.
Good news is that this is GL so we can prototype all this.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:31 +00:00
Alyssa Rosenzweig
bb37b072a5
asahi,agx: use intrinsics pass
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:31 +00:00
Alyssa Rosenzweig
8ab443d549
asahi: enable compblit behind dbg flag
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:30 +00:00
Alyssa Rosenzweig
7eac18b1bc
asahi: force inline ppp update logic
...
benefits a lot from constant folding.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:30 +00:00
Alyssa Rosenzweig
c6c8262ce1
asahi: implement pipeline stats as a checkbox
...
real impl is blocked on uapi to plumb thru hw perf counters.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:30 +00:00
Asahi Lina
fa475c1b56
asahi: scratch: Add feature to debug core IDs
...
Define SCRATCH_DEBUG_CORES to a raw core count to bypass the mapping
machinery and allocate memory for many cores, so we can work out how the
core IDs are mapped.
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:30 +00:00
Asahi Lina
494399c65c
asahi: Implement scratch allocation
...
Implement our helper program to map scratch blocks into stack memory,
and the driver side that allocates these blocks as necessary.
Alloction is grow-only right now. Drivers are expected to instantiate
scratch memory managers for each shader type (VS, FS, CS) and the same
buffers are reused across commands for each one, growing as necessary.
Signed-off-by: Asahi Lina <lina@asahilina.net>
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:29 +00:00
Asahi Lina
da9677f14b
asahi: cmdbuf: Fix scratch bucket offset/size
...
This is 4 bits. It is an opaque value that gets passed to the
helper, except 0 means no scratch.
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:29 +00:00
Asahi Lina
d6cc820d1a
asahi: libagx: Move PACKED and GLOBAL macros to libagx.h
...
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:29 +00:00
Asahi Lina
b89da92a5e
agx: compiler: Add fence_helper_exit_agx barrier
...
This is used by the helper program on exit.
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:29 +00:00
Asahi Lina
c406ce793b
agx: Add scaffolding to build the helper shader at device init
...
Add the scaffolding to compile our helper program, and load it at device
init time.
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:29 +00:00
Asahi Lina
05c8b59f5b
agx: Hook up helper intrinsics into CL
...
So we can use these intrinsicts from libagx.
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:29 +00:00
Asahi Lina
28d34f6352
asahi: libagx: introduce AGX_STATIC_ASSERT
...
Using the array size trick, this works in both OpenCL and C.
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:29 +00:00
Alyssa Rosenzweig
877c180677
asahi: plug glsl type leak
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:29 +00:00
Alyssa Rosenzweig
1e973dd5a9
asahi: rework meta shader infra
...
this fixes the leaks, and is also a lot more pleasant to work with.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:29 +00:00
Alyssa Rosenzweig
5261962186
asahi: fix prim restart unrolling with indirects
...
need to account for draw->start.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:29 +00:00
Alyssa Rosenzweig
6f7511b522
asahi: decode uniform_high records
...
print them like low uniforms.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:29 +00:00
Alyssa Rosenzweig
1ee9b8b668
asahi: optimize more when linking libagx
...
Otherwise we get spurious scratch from lower_vars_to_explicit_types on dead
vars.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:29 +00:00
Alyssa Rosenzweig
5dc0f5ccba
asahi: implement VBO robustness
...
GL semantics. GLES (weaker) and VK (stronger) semantics are left as a todo, with
explanations given. Enabled always to deal with null VBOs, this should be
optimized once we have soft fault.
This necessitates a rework of VBO keys, but hopefully for the best.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:29 +00:00
Alyssa Rosenzweig
4aadf67523
asahi: fix metadata for images with VS lowered to GS
...
KHR-GL46.shader_image_load_store.basic-allTargets-atomicVS
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616 >
2024-02-14 21:02:28 +00:00