Commit graph

168472 commits

Author SHA1 Message Date
Alyssa Rosenzweig
09e46aa168 asahi: add agx_push macro
Thanks, Ella!

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
31b1bdb475 asahi: fix destroy_query leaving dangling references
this was fixed for occlusion queries already, but other queries have equivalent
issues.

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
2d8a714f9c asahi: choose staging bind better
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
5257283941 asahi: use correct target packing PBE
harmless, but more correct.

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
a3ae9e1a59 asahi: fix layout transitions with arrays
don't minify the layer count for non-3D!

Affects: dEQP-GLES31.functional.copy_image.*array

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
Asahi Lina
25d185a501 ail: Fix tile size & strides for compressed textures
Compressed textures have two additional quirks that affect the tiling
code (but not the mip offsets): they get extra stride padding in some
cases for the large miptree, and the tile size is based on the POT size
and not the real size for the small miptree.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:45 -04:00
Asahi Lina
be3890a898 ail: Add explicit specification of mip level strides
For compressed textures, mip levels > 0 can have additional stride
padding. This (in some cases) affects the tile stride calculation, so it
cannot be implicitly represented with the existing members.

Add an explicit array containing the stride, in elements, of each
miptree level. The tiling code uses this instead of the minified and
element-aligned width when computing tile addressing.

This commit should be a functional no-op.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:45 -04:00
Asahi Lina
2221eb6cec ail: Fix miptree offset generation for compressed textures
For compressed textures, the POT miptree starting size is calculated
backwards (POT then minify instead of minify then POT).

In addition, the existing POT miptree start level code does not work for
compressed textures. Due to the extra block alignment requirement each
step of the way, we can no longer get away with nice log-based O(1)
math. Switch to a loop. This should be equivalent for uncompressed
textures, but yields different results with compression (element size >
1x1).

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:45 -04:00
Alyssa Rosenzweig
5382f57e81 asahi: advertise ARB_shader_texture_image_samples
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:45 -04:00
Alyssa Rosenzweig
bc6b2d087b agx: wire up texture_samples/image_samplers
CL makes this too easy, lmao

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:45 -04:00
Karol Herbst
6979a1aa07 nir/opt_preamble: make load_workgroup_size handling optional
not all drivers support it being in the preamble, e.g. asahi.

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:37 -04:00
Alyssa Rosenzweig
47337e7918 asahi: Implement draw parameters
This is the easy part, passes the piglits.

---

N.b.: this also includes a bug fix for ARB_base_instance that would be
nontrivial to extract out, so I'm backporting the whole feature for release. How
terrible, more features :-P

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:37 -04:00
Alyssa Rosenzweig
31f1ef0a79 asahi: Early out for GS + rast discard
Reduces overhead for XFB.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:37 -04:00
Alyssa Rosenzweig
2129fe30bc asahi: use GS for first-provoking fans
workaround hw bug / missing feature, in a vk compliant way.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:37 -04:00
Alyssa Rosenzweig
e10e21120b asahi: Rotate tri fans based on provoking vtx
I don't have a spec citation for the rotation but it's implied by the GL and VK
specs taken together with piglit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:37 -04:00
Alyssa Rosenzweig
5bae4bfc8c asahi: defeature quads
fixes xfb piglits. i am not paid enough to care.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:37 -04:00
Alyssa Rosenzweig
decd134c0c asahi: fix xfb of pointsize when not drawing points
stupid case.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:37 -04:00
Alyssa Rosenzweig
9d1a0f11e2 agx: Fix flatshading of matrices
Fixes dEQP-VK.glsl.conversions.scalar_to_matrix.float_to_mat4_vertex

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:37 -04:00
Alyssa Rosenzweig
9fc23df0d5 asahi: flush before resource transition
otherwise data_valid is not valid! fixes arb_shader_image_load_store-bitcast
and who knows what else.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:37 -04:00
Alyssa Rosenzweig
e637ccff36 asahi: blit with the old format when transitioning
dest is uncompressed, it can take it. but src is compressed so we don't want to
view. bugfix by inspection

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:37 -04:00
Alyssa Rosenzweig
9031f04642 asahi: minify when blitting for transition
asahi version of https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26077/diffs

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:37 -04:00
Alyssa Rosenzweig
a0485292af asahi: bump glsl version
should work and fixes a buggy test falling over due to missing gpu_shader5

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:37 -04:00
Alyssa Rosenzweig
2ad5bcc41e asahi: fix output to non-rast streams
fixes arb_gpu_shader5-emitstreamvertex_nodraw

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
79e37f7581 asahi: implement xfb stream queries
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
0099315edf asahi: fix meta usc builder allocation
otherwise can usc overflow (caught by the usc builder validation :) )

fixes clearbuffer-mixed-format

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
f82264fec0 asahi: return GL_OOM for excessive image sizes
fixes piglit max-texture-size

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
fd91d46487 ail: handle >4GiB textures
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
7a7a3b8847 asahi: defer texture packing to draw-time
needed for correctness with layout transitions.

fixes arb_shader_image_load_store-host-mem-barrier

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
b74d2dcd57 asahi: use 2D descriptors for cubes
fixes arb_shader_image_load_store-invalid case imageLoad/address bounds test/imageCube/rgba32f

this is also better codegen since it avoids the wacko division by 6. although it
creates a div by 6 in imageSize, that's better because that one is much more
likely to hoist to the preamble. probably should've done this from the start.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
86c4a72767 asahi: rm compact image atomic descriptors
these cause robustness problems -- since the target type might not match the
shader for invalid apps -- and are a dubious microoptimization. can revisit
later. for now, fixes imageAtomic*/target mismatch test.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
b13e3adb04 asahi: fix imageSize of null image
Fixes faulting in imageAtomicAdd/unbound image test.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
0cd032e4bb asahi: Be robust with arrays of images
fixes imageLoad/index bounds test subcase.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
b0f4b0a9ef asahi: handle null PBE
fixes some subcases of arb_shader_image_load_store-invalid

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
c73d7d042c asahi: fix dirty tracking fail with point sprites
fixes arb_point_sprite-checkerboard

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
683dac24b2 asahi: be robust about null xfb
fixes arb_enhanced_layouts-transform-feedback-layout-qualifiers tests.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
3ac44d8c5e asahi: remove bogus assertion
replace with optional debug flag for retaining debugability but getting
conformant behaviour by default. fixes piles of piglit crashes.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
e3c528068f asahi: bump limits
fixes gl-3.3-minmax.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
84a8324c55 asahi: handle self blits
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
de6336381b asahi: clamp clear colours
fixes arb_texture_view-rendering-formats_gles3

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
acd095f03d asahi: init clear colour between batches
should be a noop, but safer

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Janne Grunau
2cceacdb8e asahi: Fix typo in arch check in agx_get_gpu_timestamp
Signed-off-by: Janne Grunau <janne-fdr@jannau.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
4ff78407f7 asahi: Sync heap size
Hot fix... gpu alloc needs bigger reworks but that's probably not going to
happen until tess is done & we can see the whole picture.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
afb60d7707 asahi: fix index bias with GS/XFB
noticed when bringing up mdi.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Asahi Lina
45ef977481 asahi: Add extra barrier for texture atomics on G13X
Found experimentally. Fixes
KHR-GLES31.core.texture_buffer.texture_buffer_atomic_functions on G13D.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Asahi Lina
376c2697dc asahi: Add more memory barrier opcodes
These are used by the helper program, and at least one experimentally
fixes texture atomics on G13X.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
c507f4a330 asahi: Identify bicubic filtering mode
Officially undocumented but supported by MSL.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
58d6374b4c asahi: Identify Primitive ID frag input
With a name from powervr :)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
0cb6a993a8 asahi: Add XML for hw tessellation
AFAICT, there's no way to use this with...

* transform feedback
* geometry shaders
* isolines
* points mode

...so it's not terribly useful to us. But worth knowing it exists.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
2c328f4f8a asahi: Add half float type to genxml
Used with the tessellator.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
3da3b18d0c asahi: Quiet clang warning
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00