Alyssa Rosenzweig
76e8a68249
asahi: link libagx before lowering mem access widths
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
c688db1fd7
asahi: add missing GS line strip (+adj) handling
...
How did this pass GLES CTS?!
GTF-GL46.gtf31.GL3Tests.primitive_restart.primitive_restart_mode
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
5eae46d9ea
asahi: rm agx_vbufs wrapper
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
9192d8367b
asahi: rm vbuf.count from key
...
Unused and causing piles of shader variants in STK. Yikes.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
97f9f7ab0a
asahi: implement point sprites w/o shader key
...
we can replace varyings with point sprites, we just need to fix up .zw
appropriately. do that with some bcsels, ALU is cheap.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
ba0f28ad8b
asahi: rm layered bit from shader key
...
Just always use layered, like AGXV. This was a pointless bit of optimization
that only affects render target spilling with neglible impact.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
a20c693b7f
agx: fix xfb of invalid var
...
KHR-Single-GL44.enhanced_layouts.xfb_capture_struct
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
e0c1776187
agx: fix xfb of invalid comp
...
KHR-Single-GL44.enhanced_layouts.xfb_capture_inactive_output_component
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
4071baf1b3
agx: const fold after discard lowering
...
to avoid silly xor op with an unconditional discard.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
1006e27627
asahi: implement xfb overflow queries
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
33229d4ace
agx: handle imm inlining into phis
...
allows better coalescing
total instructions in shared programs: 1881875 -> 1881745 (<.01%)
instructions in affected programs: 169787 -> 169657 (-0.08%)
helped: 288
HURT: 234
Instructions are helped.
total bytes in shared programs: 12332916 -> 12323788 (-0.07%)
bytes in affected programs: 1958846 -> 1949718 (-0.47%)
helped: 778
HURT: 108
Bytes are helped.
total halfregs in shared programs: 498490 -> 498126 (-0.07%)
halfregs in affected programs: 6960 -> 6596 (-5.23%)
helped: 102
HURT: 28
Halfregs are helped.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
efeed6a6fc
agx: prepare for immediates in phis
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
b7585851d0
agx: allow phis with 16bit imms
...
could do 32-bit too..
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
d8391860d9
agx: use mov imm for pcopies
...
allows bigger imms. no shaderdb changes.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
6102c866d1
agx: use custom assert when packing
...
so it dumps out the context of what we're packing. much friendly for debug.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
b8c80c5e80
agx: mv agx_read/write_regs to validator
...
since agx_index::channels is now always correct.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
b7da198274
agx: trust in agx_index size
...
validated.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
75d911f0ee
agx: add index size helper
...
to replace the switches.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
8e938d48f5
agx: rm outdated comment
...
no more logical ends
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
a65f17bfea
agx: rm silly todo
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
7f1ec658e9
agx: validate post-RA
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
f0b8d933fc
agx: make vec widths explicit in IR
...
no functional changes.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:38 -04:00
Asahi Lina
caee8a3114
agx: Add scoreboarding to stack instructions
...
These are basically device loads/stores and behave similarly.
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/26963 >
2024-01-10 08:44:38 -04:00
Asahi Lina
f5ea767625
agx: Fix packing of stack map/unmap
...
We got the register indices wrong...
Signed-off-by: Asahi Lina <lina@asahilina.nt>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
5009e48748
agx: skip scoreboard bit in builder for !wait
...
it's supposed to be set late, not at build-time.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:38 -04:00
Asahi Lina
7fff5a128b
asahi: Implement BO alignment
...
The stack/scratch blocks need to be aligned to greater than the page
size in some cases. Add support for allocating BOs with a given
alignment in GPU VA space.
To avoid having to touch all callers, this adds a new function
agx_bo_create_aligned() for this purpose.
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:37 -04:00
Asahi Lina
4dcb0d40d2
asahi: Add .editorconfig for CL files
...
These are formatted with 3-space indents like our C code, so tell
editors about it.
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:37 -04:00
i509VCB
d30b0adddb
agx: remove internal agx_device queue
...
The internal queue is unusued by agxv. An earlier commit changed the gallium driver to initialize it's own queue.
Signed-off-by: i509VCB <git@i509.me>
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
43fc09a0d8
agx: implement query_levels
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
65789854c5
agx: lower votes to ballots
...
not optimal but passes the tests.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
c037fa376d
agx: wire up some ballots
...
lots of possibly optimizations but that's for another day
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
93d15c2bd2
agx: optimize fcmp like fcmpsel
...
total instructions in shared programs: 1810310 -> 1807236 (-0.17%)
instructions in affected programs: 269043 -> 265969 (-1.14%)
helped: 1553
HURT: 17
Instructions are helped.
total bytes in shared programs: 11851492 -> 11834830 (-0.14%)
bytes in affected programs: 1786394 -> 1769732 (-0.93%)
helped: 1540
HURT: 37
Bytes are helped.
total halfregs in shared programs: 474698 -> 474333 (-0.08%)
halfregs in affected programs: 6239 -> 5874 (-5.85%)
helped: 146
HURT: 22
Inconclusive result (%-change mean confidence interval includes 0).
total threads in shared programs: 19012032 -> 19012096 (<.01%)
threads in affected programs: 768 -> 832 (8.33%)
helped: 1
HURT: 0
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
210c6931ff
agx: fix early-z + discard together
...
don't trigger tests twice.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
eab145e223
agx: use more mem->tex barriers even on g13g
...
fixes KHR-GLES31.core.texture_buffer.texture_buffer_atomic_functions
with bigger subgroups on g13g.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
2feea36b37
asahi: allow multiple compute dispatches in a batch
...
glmark2 terrain 50% faster. yes, really.
requires setting more barriers to fix flakes.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
c455a27f54
agx: allow bindful arrays if not clamping
...
for blit shaders mostly.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
611fcfc5ca
asahi: do not use compression blits for uncompressed levels
...
pointless, it's much faster to just twiddle on the cpu. use the helpers to
detect compression per-level the right way.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
11a180c6e1
ail: add ail_is_level_twiddled_uncompressed
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
8dcdf5040b
ail: use is_level_compressed
...
to get unit testing coverage. identified several bugs!
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
67d92e0bb6
ail: add is_level_compressed query
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
2728995f12
asahi: fix eMRT + background load interaction
...
for when some render targets are spilled only. prevents regression in
KHR-GLES31.core.draw_buffers_indexed.color_masks
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963 >
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
e7f3112eb9
asahi: Implement lod queries
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26861 >
2024-01-04 01:51:07 +00:00
Daniel Schürmann
bdbf873b0f
nir: remove redundant passes from nir_opt_if()
...
These are now covered by nir_opt_loop():
- opt_if_loop_last_continue()
- opt_merge_breaks()
- opt_if_loop_terminator()
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24940 >
2024-01-03 20:48:05 +00:00
Yonggang Luo
0210b554d6
treewide: Replace the include of nir_types.h with glsl_types.h
...
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26753 >
2023-12-30 15:08:11 +00:00
Alyssa Rosenzweig
d11c9f9836
asahi: clamp draw count for mdi
...
spec req. KHR-GL43.indirect_parameters_tests.MultiDrawArraysIndirectCount
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614 >
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
982e644d18
agx: don't produce split of immediate
...
can't be consumed, affects KHR-GL42.shader_image_load_store.basic-allTargets-load-ms
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614 >
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
6e2c71dc3b
agx: Lower 64-bit I/O to 32-bit
...
Fixes KHR-GL42.vertex_attrib_64bit.*
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614 >
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
d6474be46b
agx: fix fp64 lowering options
...
we have no fp64 whatsoever.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614 >
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
8d451fe9f2
asahi: fix integer RT clamping
...
fixes the rest of KHR-GL33.packed_pixels.*
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614 >
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
6d05bf8761
asahi: fix dupe rgb65 formats
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614 >
2023-12-09 12:08:39 -04:00