Alyssa Rosenzweig
9854079d59
asahi/decode: Fix up high word
...
Not sure what's happening here, there's some magic for sure.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11815 >
2021-07-10 12:34:40 -04:00
Alyssa Rosenzweig
d5580ee805
asahi: Identify more unknown fields in the memmap
...
From validating the memory map of a Metal sample and seeing what goes wrong.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11815 >
2021-07-10 12:05:34 -04:00
Alyssa Rosenzweig
a9b8731fa1
asahi/decode: Check fewer zeroes after a command buffer
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11815 >
2021-07-10 11:23:50 -04:00
Alyssa Rosenzweig
0b35a8f81a
asahi: Make track_free safer
...
Ensure that we don't free the same BO multiple times, which can lead to later
segfaults in decode.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11815 >
2021-07-10 11:16:56 -04:00
Alyssa Rosenzweig
9b6ca87672
asahi/decode: Only dump mapped allocations
...
This matches the hardware's view of memory and helps catch spurious reads. (One
symptom of messing this up -- besides broken rendering -- is a kernel warning
about a "bogus texture handle 0".)
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11815 >
2021-07-10 11:04:45 -04:00
Alyssa Rosenzweig
ea7892a74c
asahi: Remove unused bo_access property
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11815 >
2021-07-10 11:01:25 -04:00
Alyssa Rosenzweig
1d0008734c
agx: Ensure we don't overallocate registers
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11751 >
2021-07-07 03:31:43 +00:00
Alyssa Rosenzweig
7e65e47d19
agx: Pipe in nir_register
...
This is kind of lazy...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11751 >
2021-07-07 03:31:43 +00:00
Alyssa Rosenzweig
85e18deb18
agx: Assign registers locally
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11751 >
2021-07-07 03:31:43 +00:00
Alyssa Rosenzweig
15b49a6795
agx: Count read registers as well
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11751 >
2021-07-07 03:31:43 +00:00
Alyssa Rosenzweig
f03cecf05f
agx: Don't choke on registers in the optimizer
...
Just skip over them.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11751 >
2021-07-07 03:31:43 +00:00
Alyssa Rosenzweig
01174fcec8
asahi: Use XML for interpolation packet
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730 >
2021-07-06 13:44:50 +00:00
Alyssa Rosenzweig
4c99510d3b
asahi: Identify attachment length field
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730 >
2021-07-06 13:44:50 +00:00
Alyssa Rosenzweig
b8bc5ed297
asahi: Use GenXML for main bind fragment
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730 >
2021-07-06 13:44:50 +00:00
Alyssa Rosenzweig
19bb9d278f
asahi: Extend IOGPU header to contain encoder
...
Let's squash together all the resulting zeroes. Trying to discern some structure out of this.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730 >
2021-07-06 13:44:50 +00:00
Alyssa Rosenzweig
c1d8ed1bc2
asahi: Move IOGPU header to XML
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730 >
2021-07-06 13:44:50 +00:00
Alyssa Rosenzweig
0b9e8181da
asahi: Identify "command buffer" size field in map
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730 >
2021-07-06 13:44:50 +00:00
Alyssa Rosenzweig
8e3f81ccc4
asahi: Add XML for the attachment structure
...
We need a lot more control over these magic structures to get Z/S attachments working correctly. This is an early start.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730 >
2021-07-06 13:44:50 +00:00
Alyssa Rosenzweig
18a34dc47e
asahi: Implement the stencil test
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730 >
2021-07-06 13:44:50 +00:00
Alyssa Rosenzweig
dc968a9bec
asahi: Prepack rasterizer faces
...
A bit more efficient and will allow easy implementation of the stencil test.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730 >
2021-07-06 13:44:50 +00:00
Alyssa Rosenzweig
0266cf86e9
asahi: Fix meson dependency on packing in compiler
...
Closes : #5030
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Fixes: 6a657b17b9
("agx: Remap fragment shader varyings explicitly")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730 >
2021-07-06 13:44:50 +00:00
Alyssa Rosenzweig
bee077f5e2
asahi: Identify vertex texture/sampler counts
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig
50f012542f
agx: Handle txl
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig
8361e24604
agx: Legalize LOD sources to be 16-bit only
...
I'm not convinced this is /right/ but it's a step.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig
4891e51bf3
agx: Fix lod_mode shift
...
Was zero before so didn't notice the bug.
Fixes: 9f55538834
("agx: Pack texture ops")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig
edd30fa1bd
agx: Pack LOD descriptors
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig
e847bffbcc
agx: Fix LOD_MIN enum
...
Fixes: 2470a080d2
("agx: Stub NIR backend compiler")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig
c99dfe6a0c
agx: Fix 32-bit bitwise shifts
...
Fixes dEQP-GLES2.functional.shaders.functions.qualifiers.const_int_fragment
Fixes: e50bae00f4
("agx: Add 32-bit bitwise shifts")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig
8ea262f508
asahi: Add ASAHI_MESA_DEBUG=no16 option
...
A lot of dEQP failures go away with 32-bit forced...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig
5228be45b6
asahi: Generalize varying linking
...
Handles matrices now. Fixes
dEQP-GLES2.functional.shaders.matrix.add.dynamic_mediump_mat4_float_fragment
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig
5049907ae1
asahi: Implement colour buffer reloads
...
Gets glmark2 -bdesktop working.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig
0e0448d8df
asahi: Add internal (renderable) formats to the table
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig
2ad59fc9ec
asahi: Handle Z16_UNORM textures
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig
a1f732e67b
agx: Track logical control flow graph
...
Logic lifted from the Bifrost compiler, which was a copypaste of the Midgard
compiler, which was based on a faulty understanding of the v3d compiler,
which...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig
a207c77314
agx: Lift agx_block_add_successor from Panfrost
...
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig
2e1ba82060
agx: Count write registers, not components
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig
0ef93554e1
agx: Mark sources that kill
...
Trivially computed during liveness analysis (already a byproduct!) and required
for efficient register allocation.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig
7972e74f40
agx: Add liveness analysis pass
...
Based on the Panfrost one, scalarized and with some silly things fixed.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig
ec40620f86
agx: Add agx_exit_block helper
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig
ebd25e7ee7
agx: Pull out agx_write_components
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig
f49ba0874a
asahi: Unify varying linking code with vertex shaders
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig
6a657b17b9
agx: Remap fragment shader varyings explicitly
...
Needed to handle fragcoord.z correctly, for example. Step 1, at least.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig
32f4be5dd7
agx: Rename agx_pack to agx_pack_binary
...
Conflicts with GenXML.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig
bf8d1734fd
agx: Implement ld_vary_flat
...
Not clear what any of this is for but let's be nice and match the blob.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig
3eab648d6b
agx: Implement nir_intrinsic_load_frag_coord
...
Depends on matching ABI.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:03 +00:00
Alyssa Rosenzweig
8457524238
agx: Rename remap_varyings -> remap_varyings_vs
...
Want to do the same for fragment shaders.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:03 +00:00
Alyssa Rosenzweig
eabcf9f31e
asahi: Identify varying descriptor fields
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:03 +00:00
Alyssa Rosenzweig
3d3e4928b2
agx: Add ld_vary_flat opcode
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:03 +00:00
Alyssa Rosenzweig
10b8563966
agx: Update ld_vary encoding mask
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:03 +00:00
Alyssa Rosenzweig
99b67ab355
agx: Add perspective bit to ld_var
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:03 +00:00
Alyssa Rosenzweig
ef808205c6
agx: Add agx_immediate_f helper
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:03 +00:00
Alyssa Rosenzweig
be4d88a6ba
agx: Mark components as ASSERTED
...
Prevents a release build warning.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718 >
2021-07-05 20:56:03 +00:00
Vinson Lee
6fe82e6c1e
asahi: Fix macOS macro.
...
Fixes: 26b19bda30
("asahi: Add device abstraction")
Fixes: 55c0956fd0
("asahi: Add (clean room) IOKit uABI header")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11569 >
2021-06-24 13:49:40 +00:00
Rhys Perry
1cbcfb8b38
nir, nir/algebraic: add byte/word insertion instructions
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3151 >
2021-06-08 08:57:42 +00:00
Alyssa Rosenzweig
0e2293a52b
agx: Handle load_back_face_agx
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11199 >
2021-06-05 20:38:22 +00:00
Alyssa Rosenzweig
c21168a26c
agx: Lower front face to back face
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11199 >
2021-06-05 20:38:22 +00:00
Alyssa Rosenzweig
75cafd8472
agx: Pack SR immediate
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11199 >
2021-06-05 20:38:22 +00:00
Alyssa Rosenzweig
307b8f1b2f
agx: List sr enum in Python
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11199 >
2021-06-05 20:38:22 +00:00
Alyssa Rosenzweig
cc8fec8b74
agx: Generate enums from Python
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11199 >
2021-06-05 20:38:22 +00:00
Alyssa Rosenzweig
223476aff3
agx: Model get_sr
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11199 >
2021-06-05 20:38:22 +00:00
Alyssa Rosenzweig
6899f002fa
asahi: Add mipmapping state to the XML
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11086 >
2021-06-01 01:31:02 +00:00
Alyssa Rosenzweig
bf42d17a16
asahi: Flesh out the formats table
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11086 >
2021-06-01 01:31:02 +00:00
Alyssa Rosenzweig
1b24a3e9e9
asahi: Add "hacks for dEQP" flag
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11086 >
2021-06-01 01:31:02 +00:00
Alyssa Rosenzweig
e2e1d8160f
asahi: Add ETC2 formats to table
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11086 >
2021-06-01 01:31:02 +00:00
Alyssa Rosenzweig
f690d1f7ab
asahi: Use pixel table in is_format_supported
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11086 >
2021-06-01 01:31:02 +00:00
Alyssa Rosenzweig
8b1e273cb5
asahi: Scaffold format table
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11086 >
2021-06-01 01:31:02 +00:00
Alyssa Rosenzweig
6bb7172622
asahi: Hide pixel formats behind an opaque type
...
Convenient for mapping a format table.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11086 >
2021-06-01 01:31:02 +00:00
Alyssa Rosenzweig
022e482eaa
asahi: Add format enums
...
Split it up into the underlying parts. Now we can decode every format
accessible in Metal.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11086 >
2021-06-01 01:31:02 +00:00
Alyssa Rosenzweig
eb5983b48e
asahi: Print unknown enum values
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11086 >
2021-06-01 01:31:02 +00:00
Alyssa Rosenzweig
bfd5e52f16
asahi: Note that "render target" lacks an sRGB bit
...
sRGB is handled through other mechanisms.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11086 >
2021-06-01 01:31:02 +00:00
Alyssa Rosenzweig
118682dd83
asahi: Identify line stride in texture/RT XML
...
The off-by-four is concerning.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11086 >
2021-06-01 01:31:02 +00:00
Alyssa Rosenzweig
9c0ef01c68
asahi: Add layout enum to XML
...
Used for textures and render targets. There are more values here, probably for
other tiling schemes and compression.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11086 >
2021-06-01 01:31:02 +00:00
Alyssa Rosenzweig
5c97d1c837
asahi: Implement wide lines
...
Identify line width field and route through the Gallium line width.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11086 >
2021-06-01 01:31:02 +00:00
Alyssa Rosenzweig
6fbc1cb52a
asahi: Update viewport descriptor depth fields
...
Acts like a translate/scale pair more generally, not specific to near/far
planes.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11084 >
2021-05-30 23:32:02 +00:00
Alyssa Rosenzweig
9392e2b275
asahi: Add unknown bits seen with the GL driver
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11084 >
2021-05-30 23:32:02 +00:00
Alyssa Rosenzweig
5de49375ec
asahi: Expose PIPE_CAP_CLIP_HALFZ
...
Use the Zink lowering pass to handle the non-halfz case. Metal, like Vulkan,
uses half-z (and Metal is not configurable, making r/e tricky).
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11084 >
2021-05-30 23:32:01 +00:00
Alyssa Rosenzweig
f99f7e70d7
asahi: Add scissor enable bit
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11084 >
2021-05-30 23:32:01 +00:00
Alyssa Rosenzweig
d7cbfd4f6c
asahi: Add "set scissor" command
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11084 >
2021-05-30 23:32:01 +00:00
Alyssa Rosenzweig
f170b8357b
asahi: Fix scissor descriptor definition
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11084 >
2021-05-30 23:32:01 +00:00
Alyssa Rosenzweig
e9483110d2
agx: Zero r0l before first use of control flow
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11023 >
2021-05-31 01:23:35 +05:30
Alyssa Rosenzweig
839fff846a
agx: Add break/continue support
...
Following Dougall's notes closely.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11023 >
2021-05-31 01:23:35 +05:30
Alyssa Rosenzweig
dd06e6af34
agx: Implement loops in the simplest way
...
Again, optimizations are possible, but for now go for conformance.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11023 >
2021-05-31 01:23:35 +05:30
Alyssa Rosenzweig
11705488ed
agx: Optimize out empty else blocks
...
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11023 >
2021-05-31 01:23:35 +05:30
Alyssa Rosenzweig
cf43206e76
agx: Implement emit_if the simplest way
...
Lots of optimizations are possible from here.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11023 >
2021-05-31 01:23:35 +05:30
Alyssa Rosenzweig
3def66e8aa
agx: Fix up branch offsets at pack time
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11023 >
2021-05-31 01:23:35 +05:30
Alyssa Rosenzweig
4fb964ccb8
agx: Model jump instructions
...
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11023 >
2021-05-31 01:23:35 +05:30
Alyssa Rosenzweig
6efd00336b
agx: Pack control flow instructions
...
Nearly ALU.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11023 >
2021-05-31 01:23:35 +05:30
Alyssa Rosenzweig
44dd5edae9
agx: Add push_exec alias
...
Use the same canonical form as Metal, so the disassembler can alias it
back.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11023 >
2021-05-31 01:23:35 +05:30
Alyssa Rosenzweig
4eb8fbf780
agx: Model pop_exec
...
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11023 >
2021-05-31 01:23:35 +05:30
Alyssa Rosenzweig
a270665a9e
agx: Model control flow instructions
...
Thankfully the encoding is regular, if a bit complicated.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11023 >
2021-05-31 01:23:35 +05:30
Alyssa Rosenzweig
4fe03cf97c
agx: Add inner loop nesting count field
...
Needed for proper handling of break/continue with nested if-else.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11023 >
2021-05-31 01:23:35 +05:30
Alyssa Rosenzweig
8454d08aa3
agx: Add branch target to IR
...
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11023 >
2021-05-31 01:23:35 +05:30
Alyssa Rosenzweig
ad4dfb3321
agx: Add invert_cond (ccn) to IR
...
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11023 >
2021-05-31 01:23:35 +05:30
Alyssa Rosenzweig
21cf528e76
agx: Add nest field to IR
...
Needed to model control flow instructions.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11023 >
2021-05-31 01:23:35 +05:30
Alyssa Rosenzweig
6f54385b0a
agx: Track block offsets
...
For fixing branch offsets.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11023 >
2021-05-31 01:23:35 +05:30
Alyssa Rosenzweig
f7918ebc82
agx: Track current_block
...
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11023 >
2021-05-31 01:23:35 +05:30
Alyssa Rosenzweig
0a7a6f0558
agx: Implement boolean mov
...
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11023 >
2021-05-31 01:23:35 +05:30
Alyssa Rosenzweig
a1a8ee9b11
agx: Enable 1-bit load_const
...
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11023 >
2021-05-31 01:23:35 +05:30
Alyssa Rosenzweig
2d1390392f
agx: Pack ld_var Dx
...
In the expected place.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11023 >
2021-05-31 01:23:35 +05:30
Alyssa Rosenzweig
1f2d1423bb
agx: Drop cmdline version back to ES3.0
...
The patch needed for this to work was dropped. Fixes the standalone
compiler.
Fixes: 972409dacb
("asahi: Stub command-line compiler for AGX G13B")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11023 >
2021-05-31 01:23:35 +05:30
Alyssa Rosenzweig
15b5573194
agx: Set reads_tib appropriately
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720 >
2021-05-09 23:29:45 -04:00
Alyssa Rosenzweig
d0f566a90d
agx: Implement load_output
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720 >
2021-05-09 23:29:45 -04:00
Alyssa Rosenzweig
1b9b2f9046
agx: Condition writeout ops on already being emitted
...
There's a lot of r/e waiting here, but will be needed for ld_tile. Match
the Metal blob.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720 >
2021-05-09 23:29:45 -04:00
Alyssa Rosenzweig
41d8db33a2
agx: Assume lower_fragcolor has been called
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720 >
2021-05-09 23:29:45 -04:00
Alyssa Rosenzweig
1164c992cf
agx: Add ld_tile opcode
...
Variant of st_tile.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720 >
2021-05-09 23:29:45 -04:00
Alyssa Rosenzweig
07fdc0015e
agx: Rename blend -> st_tile
...
For symmetry.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720 >
2021-05-09 23:29:45 -04:00
Alyssa Rosenzweig
06fe6651b3
agx: Implement blend constant color sysvals
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720 >
2021-05-09 23:29:45 -04:00
Alyssa Rosenzweig
5fd489a6bd
agx: Return agx_instr* from emit_intrinsic
...
Aesthetically useful.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720 >
2021-05-09 23:29:45 -04:00
Alyssa Rosenzweig
dd64463d5f
asahi: Pass through "reads tilebuffer?" bit
...
To be determined if there's more to this, but it's the only bit I see
varying with Metal when blending is enabled.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720 >
2021-05-09 23:29:45 -04:00
Alyssa Rosenzweig
d76ab2b5d6
asahi: Add blend constant system value
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720 >
2021-05-09 23:18:19 -04:00
Alyssa Rosenzweig
0ad6bacb73
asahi: Add vertex formats table
...
This all gets lowers anyway so it's not entirely clear if this is the
best approach, but these map formats that have native device_load
encodings. (and don't need shader unpack code)
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:22 -04:00
Alyssa Rosenzweig
c6cde558b5
asahi: Add pool data structure
...
Lifted from Panfrost.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:22 -04:00
Alyssa Rosenzweig
26b19bda30
asahi: Add device abstraction
...
Over IOKit or DRM, primarily for memory allocation. Common between
Gallium and Vulkan.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:21 -04:00
Alyssa Rosenzweig
67dd70395f
asahi: Add tiling routines
...
For the 64x64 Morton order pattern we know how to use for textures and
framebuffers. (AGX also supports a framebuffer compression scheme. This
is not that.)
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:21 -04:00
Alyssa Rosenzweig
a426abcb46
asahi: Add command buffer decode helpers
...
Forked from Panfrost's pandecode. Like pandecode, most of the
heavylifting is generated with GenXML, so this is relatively simple.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:21 -04:00
Alyssa Rosenzweig
55c0956fd0
asahi: Add (clean room) IOKit uABI header
...
This only builds on macOS (depends on IOKit), where it is required for
command buffer submission and tracing the Metal blob.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:21 -04:00
Alyssa Rosenzweig
b67f148db7
asahi: Add a GenXML fork
...
Via Panfrost via v3d via Intel. Sour dough!
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:21 -04:00
Alyssa Rosenzweig
0f556dbdc0
asahi: Add allocation data structure
...
Something half-way between what IOKit (macOS) and DRM (Linux) want.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:20 -04:00
Alyssa Rosenzweig
cad54e2721
asahi: Add command buffer XML definitions
...
Formatted for GenXML. Incomplete and probably riddled with errors, but a
good start.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:20 -04:00
Alyssa Rosenzweig
8cca28c9f1
asahi: Add hexdump utility
...
Used in our decoder.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:20 -04:00
Alyssa Rosenzweig
87ad9439d3
agx: Support bcsel
...
We're already using cmpsel in lots of places, pipe through the real
thing!
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:20 -04:00
Alyssa Rosenzweig
e36a7f08df
agx: Pack cmpsel
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:19 -04:00
Alyssa Rosenzweig
d3abe997ca
agx: Add b2i implementation
...
Another icmpsel variant.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:19 -04:00
Alyssa Rosenzweig
80edb8124d
agx: Implement b2f
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:19 -04:00
Alyssa Rosenzweig
5a5abdc8d8
agx: Support 1-bit booleans
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:19 -04:00
Alyssa Rosenzweig
9201d31eac
agx: Add min/max support
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:19 -04:00
Alyssa Rosenzweig
9f55538834
agx: Pack texture ops
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:18 -04:00
Alyssa Rosenzweig
257a8cc111
agx: Emit texture ops
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:18 -04:00
Alyssa Rosenzweig
d555849c3c
agx: Add agx_tex_dim helper
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:18 -04:00
Alyssa Rosenzweig
1455f33f9b
agx: Implement vertex_id
...
Preloaded to r5 in vertex shaders.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:18 -04:00
Alyssa Rosenzweig
7566466354
agx: Lower load_attr to device memory accesses
...
This is pretty annoying but not as catastrophic as I feared... at least,
until we need to support indirect access, non-native formats, or instancing.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:17 -04:00
Alyssa Rosenzweig
1c6f34f611
agx: Set flag on last st_vary instruction
...
Not sure what the point is but let's match the blob.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:17 -04:00
Alyssa Rosenzweig
033d4d09fc
agx: Implement load_ubo/kernel_input
...
Lower to a read from global memory at a base address specified in a
sysval.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:17 -04:00
Alyssa Rosenzweig
1f23e9c06e
agx: Add sysval management helper
...
Will be used for lowering UBO loads, among other applications.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:17 -04:00
Alyssa Rosenzweig
77e7168ae2
agx: Implement limited case of i2i16/i2i32 as iadd
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:17 -04:00
Alyssa Rosenzweig
e444e3450d
agx: Propagate immediates
...
8-bit integers can be inlined to immediates on integer ops. Likewise,
floats with simple representations can be converted to 8-bit minifloats
and inlined on float ops.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:16 -04:00
Alyssa Rosenzweig
b077a73bfe
agx: Propagate fmov backwards as well
...
Primarily for fsat. Also folds conversions but this is more of an
accident, and it doesn't do so optimally (due to the f2f16/f2f32
orientation issue outlined in the pass comments).
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:16 -04:00
Alyssa Rosenzweig
0f58e8dabe
agx: Add dead code eliminator
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:16 -04:00
Alyssa Rosenzweig
28801b4849
agx: Add forward optimizing pass for fmov
...
Explain the ideas behind our SSA-based optimizer (inspired by ACO's,
thank you to Daniel Schuermann for discussing this with me in the
context of Bifrost), and implement the subset needed to propagate
abs/neg through.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:16 -04:00
Alyssa Rosenzweig
e50bae00f4
agx: Add 32-bit bitwise shifts
...
Only ishr has an actual native instruction, the others are special cases
of the bitfield insertion/extraction ops.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:16 -04:00
Alyssa Rosenzweig
17bb5a067a
agx: Add saturated integer add/subtract support
...
Just a flag on the regular iadd instruction.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:15 -04:00
Alyssa Rosenzweig
86ae965ea4
agx: Add iadd/imad integer arithmetic
...
Lots of optimizations will be possible later on.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:15 -04:00
Alyssa Rosenzweig
0c21513693
agx: Add bitwise operations
...
This get translated to bitop with the corresponding truth table with
some builder syntax sugar.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:15 -04:00
Alyssa Rosenzweig
c06dcaf0a0
agx: Implement native int->float conversions
...
This time 8, 16, and 32-bit sources are supported natively, but not
64-bit.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:15 -04:00
Alyssa Rosenzweig
2126848771
agx: Implement native float->int conversions
...
No 8-bit or 64-bit yet since those need lowerings.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:14 -04:00
Alyssa Rosenzweig
8191adb0d9
agx: Add minifloat tests
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:14 -04:00
Alyssa Rosenzweig
c89ab07996
agx: Add 8-bit AGX minifloat routines
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:14 -04:00
Alyssa Rosenzweig
1f77aa95ec
agx: Implement fsin/fcos
...
First, we lower to fsin_agx and some ALU in NIR. Then, we implement
fsin_agx with the underlying transcental ops.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:14 -04:00
Alyssa Rosenzweig
b5a3845f9a
agx: Implement simple floating point ops
...
These are all direct translations of NIR->AIR.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:14 -04:00
Alyssa Rosenzweig
8648b2be0b
agx: Implement ld_vary
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:13 -04:00
Alyssa Rosenzweig
e54fdc0fac
agx: Terminate programs with stop and traps
...
The function of stop is clear. The function of trap, let alone a whole
sled of them, is less so. Maybe a debugging feature for later.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:13 -04:00
Alyssa Rosenzweig
5b34cc40ca
agx: Add st_vary(_final) instruction packing
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:13 -04:00
Alyssa Rosenzweig
7832945747
agx: Add packing for memory loads/stores
...
Encoding is dramatically different from ALU.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:13 -04:00
Alyssa Rosenzweig
f2d264e191
agx: Add instruction packing
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:13 -04:00
Alyssa Rosenzweig
c215895eae
agx: Add a trivial register allocator
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:12 -04:00
Alyssa Rosenzweig
583684b5a7
agx: Add instruction printing
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:12 -04:00
Alyssa Rosenzweig
8af9822d14
agx: Implement fragment_out
...
For a single colour render target.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:12 -04:00
Alyssa Rosenzweig
0079783428
agx: Implement vec2/vec3/vec4 ops
...
As p_combine, to un-stub emit_alu.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:12 -04:00
Alyssa Rosenzweig
7ad11e3923
agx: Add agx_alu_src_index helper for emit_alu
...
Since we don't use abs/neg in NIR, this just needs to construct
p_extract ops to deal with swizzles.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:12 -04:00
Alyssa Rosenzweig
22886f50f9
agx: Implement direct st_vary
...
Indirection can come later, if at all..
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:11 -04:00
Alyssa Rosenzweig
fde66f0aa8
agx: Implement load_const as mov
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:11 -04:00
Alyssa Rosenzweig
2bfe1a61c5
agx: Stub emit_intrinsic
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:11 -04:00
Alyssa Rosenzweig
075e6be90c
agx: Stub NIR instruction iteration
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:11 -04:00
Alyssa Rosenzweig
186c56a2d4
agx: Stub control flow walking
...
From Bifrost. We'll need to diverge (no pun intended) due to exec_mask
handling specific to Apple.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:10 -04:00
Alyssa Rosenzweig
8b8c1a2827
agx: Remap varyings to match AGX ABI
...
It's not clear if this is software or hardware defined, but until we
know more about linkage, let's match the blob. Fixes dEQP issues with
gl_PointSize.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:10 -04:00
Alyssa Rosenzweig
2470a080d2
agx: Stub NIR backend compiler
...
A fork of the Bifrost compiler, tailored to AGX. nir_register support is
removed, as I want to use an SSA-based allocator for AGX. (There are no
VLIW-like requirements and extremely limited vector semantics, so we can
use an ACO approach with ease.)
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:10 -04:00
Alyssa Rosenzweig
719bf5152f
agx: Generate builder routines
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:10 -04:00
Alyssa Rosenzweig
07f87500e3
agx: Generate runtime-accessible opcode table
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:10 -04:00
Alyssa Rosenzweig
c9fe9ce998
agx: Generate opcode list
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:09 -04:00
Alyssa Rosenzweig
50b5c94885
agx: Add opcode descriptions as Python
...
Pattern lifted from NIR.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:09 -04:00
Alyssa Rosenzweig
972409dacb
asahi: Stub command-line compiler for AGX G13B
...
Based on the Bifrost standalone compiler, which was based on Midgard's
standalone compiler, which was based on Freedreno's standalone compiler,
which was.....
It's like sour dough!
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582 >
2021-05-02 17:41:09 -04:00