Alyssa Rosenzweig
07ccaa3118
Revert "hk: Stop using strings or common key types for meta keys"
...
This reverts commit 32e0e8c8c5 , which broke the
build on Honeykrisp (and then the obvious build fix causes CTS to blow up with
explosions).
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33406 >
2025-02-05 20:01:35 +00:00
Alyssa Rosenzweig
0ce0b7c7b0
hk: advertise EXT_image_view_min_lod
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33386 >
2025-02-05 17:27:18 +00:00
Alyssa Rosenzweig
157ffa5b43
hk: emulate EXT_image_view_min_lod
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33386 >
2025-02-05 17:27:18 +00:00
Alyssa Rosenzweig
8e1ce5331b
hk: rearrange sampler image desc
...
pack nicer.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33386 >
2025-02-05 17:27:18 +00:00
Alyssa Rosenzweig
7ed6aa68ad
hk: pack has_border with clamp_0_sampler_index
...
this is cheaper to decode (shorter preambles!).
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33386 >
2025-02-05 17:27:18 +00:00
Alyssa Rosenzweig
6e29a2c8d5
agx: switch to nir_tex_src_lod_bias_min_agx
...
saves moves.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33386 >
2025-02-05 17:27:18 +00:00
Alyssa Rosenzweig
932d8a68eb
agx: lower min LOD for txf
...
to match the robustness semantic the spec wants.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33386 >
2025-02-05 17:27:18 +00:00
Konstantin Seurer
32e0e8c8c5
hk: Stop using strings or common key types for meta keys
...
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32881 >
2025-02-03 16:03:49 +01:00
Konstantin Seurer
1bba4cf21b
vulkan/meta: Remove object types from vk_meta_object_key_type
...
Most values are used for multiple object types. It also is not
necessary, because the object type is already included in the key.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32881 >
2025-02-03 16:03:49 +01:00
Alyssa Rosenzweig
3b1d8796fb
asahi: port to vtn_bindgen2
...
this gets rid of all our linking gunk, which is a nice cleanup.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33099 >
2025-01-31 16:17:59 +00:00
Alyssa Rosenzweig
0dd788298f
libagx: port to glsl-style compute builtins
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33099 >
2025-01-31 16:17:59 +00:00
Alyssa Rosenzweig
3bfcc4f323
clc,libagx: automatically set lang version
...
bit less meson cargocult.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33242 >
2025-01-28 23:01:32 +00:00
Alyssa Rosenzweig
9f460eadab
clc,libagx: drop --in for mesa_clc
...
just accept the arguments as-is. this matches how gcc/clang actually work
and simplifies the meson.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33242 >
2025-01-28 23:01:32 +00:00
Alyssa Rosenzweig
164a161279
meson: project-wide fs = import('fs')
...
reduces a bit of boilerplate.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33242 >
2025-01-28 23:01:32 +00:00
Rhys Perry
0eb5f66660
nir/validate: validate ssa dominance by default
...
This no longer modifies dominance metadata, so enable it by default.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com >
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32005 >
2025-01-23 23:35:44 +00:00
Marek Olšák
02516ff0f9
nir: remove dead code due to IO being always lowered in st/mesa
...
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33146 >
2025-01-22 02:15:04 +00:00
Alyssa Rosenzweig
c1e685bfe9
util,vulkan,asahi,hk: hash format strings
...
flag day change to use the new infra. as-is this is a bit pointless, but it
unblocks the new bindgen work.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33067 >
2025-01-17 18:09:45 +00:00
Alyssa Rosenzweig
c4bd2e691b
agx: defer printf address lowering
...
this will be needed with vtn_bindgen2
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33067 >
2025-01-17 18:09:45 +00:00
Alyssa Rosenzweig
401b400de3
nir,asahi,hk: add barrier argument to MESA_DISPATCH_PRECOMP
...
In the current API, precomp implicitly assumes full barriers both before & after
every dispatch. That's not good for performance. However, dropping the barriers
and requiring user to explicitly call barrier functions before/after would have
bad ergonomics.
So, we add a new parameter to the standard MESA_DISPATCH_PRECOMP signature
representing the barriers required around the dispatch. As usual, the actual
type & semantic is left to drivers to define what makes sense for their
hardware. We just reserve the place for it. (I think most drivers will want
bitflags here, but I don't think the actual flags are worth. If a driver wanted
to use a struct here, that would work too.)
Since the asahi stack doesn't do anything clever with barriers yet, we
mechnically add an AGX_BARRIER_ALL barrier to all precomp users in-tree. We can
optimize that later, this just gets the flag-day change in with no functional
change.
For JM panfrost, this will provide a convenient place to stash both their "job
barrier" bit and their "suppress prefetch" bit (which is really a sort of
barrier / cache flush, if you think about it).
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32980 >
2025-01-14 16:39:57 +00:00
Alyssa Rosenzweig
4955a68a03
libagx: add agx_barrier enum
...
trivial for now, but eventually this will describe interesting things :-)
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32980 >
2025-01-14 16:39:56 +00:00
Vinson Lee
25f5f1b9b4
hk: Fix build error with static_assert
...
../src/asahi/vulkan/hk_cmd_draw.c: In function ‘hk_draw’:
../src/asahi/vulkan/hk_cmd_draw.c:3471:32: error: expression in static assertion is not constant
3471 | static_assert(size > sizeof(VkDrawIndirectCommand),
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
Fixes: 5bc89aa991 ("hk,libagx: handle adjacency without a GS")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12351
Signed-off-by: Vinson Lee <vlee@freedesktop.org >
Reviewed-by: Eric Engestrom <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32988 >
2025-01-14 15:20:17 +00:00
Alyssa Rosenzweig
7a4469681e
nir: pass a callback to nir_lower_robust_access
...
rather than try to enumerate everything a driver might want with an unmanageable
collection of booleans, just do a filter callback + data. this ends up simpler
overall, and will allow Intel to use this pass for just 64-bit images without
needing to add even more booleans.
while we're churning the pass signature, also do a quick port to
nir_shader_intrinsics_pass
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com > [NIR and V3D]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32907 >
2025-01-08 15:59:05 +00:00
Mary Guillemard
ecdccae990
nir,agx: Allow nir_precomp_print_blob to print a static array
...
This makes it stop leaking shader binary blobs definition and is
required for panfrost clc.
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Eric R. Smith <eric.smith@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32939 >
2025-01-08 11:37:27 +00:00
Chia-I Wu
1f333ac9fa
hk: remove calibrated timestamp support
...
We don't advertise KHR_calibrated_timestamps yet. When we do, we can
use the common implementation.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32689 >
2025-01-07 03:39:29 +00:00
Vinson Lee
3514b65c35
hk: Fix hk_ia_update arguments order
...
Fix defect reported by Coverity Scan.
Arguments in wrong order (SWAPPED_ARGUMENTS)
swapped_arguments: The positions of arguments in the call to
hk_ia_update do not match the ordering of the parameters:stat_c_inv is
passed to c_prims.stat_c_prims is passed to c_inv.
Fixes: a3b796ba19 ("libagx,hk: handle pipeline stats queries without a GS")
Signed-off-by: Vinson Lee <vlee@freedesktop.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32853 >
2025-01-03 17:14:48 +00:00
Marek Olšák
c21bc65ba7
nir/opt_load_store_vectorize: make hole_size signed to indicate overlapping loads
...
A negative hole size means the loads overlap. This will be used by drivers
to handle overlapping loads in the callback easily.
Reviewed-by: Mel Henning <drawoc@darkrefraction.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32699 >
2025-01-01 00:03:55 +00:00
Samuel Pitoiset
6d3b2a6531
vulkan: add a new vk_meta option to use the rect list pipeline path
...
RADV uses VK_PRIMITIVE_TOPOLOGY_META_RECT_LIST_MESA for some meta
operations but it doesn't need to use the existing path that draws
using VBOs.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32805 >
2024-12-31 10:32:50 +00:00
Mary Guillemard
711b3351ef
asahi: Remove unneeded dependencies for asahi_clc
...
There is no requirement on LLVM or SPIR-V tools since the introduction
of mesa-clc.
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32719 >
2024-12-23 15:09:41 +00:00
Mary Guillemard
5ddeea9a62
meson: Add precomp-compiler and install-precomp-compiler options
...
As Asahi, Intel and soon Panfrost requires an offline compiler for their
respective internal shaders, this commit adds generic new options to
workaround meson current limitations around cross-compillation.
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32719 >
2024-12-23 15:09:41 +00:00
Alyssa Rosenzweig
83a7d9a814
hk: fix primitive restart dirty tracking
...
the previous logic was busted with the sequence Dolphin emits:
BeginRender
BindIndex
Draw
EndRender
BeginRender
Draw without restart
Draw with restart
EndRender
the second control stream would not have any restart index emitted, since the
dirty flag is set only on Begin and Bind, and cleared on draw.
this was probably also broken in the similar case
BeginRender
BindIndex
Draw without restart
Draw with restart
EndRender
fixes Zelda: Wind Waker, Xeno Blade, etc.
thank you to pokechu22 for debug help!
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32759 >
2024-12-21 01:50:32 +00:00
Alyssa Rosenzweig
c585681378
hk: avoid compiling unneeded VS->GS variants
...
this should reduce pipeline compile time and memory bloat, now that we have no
non-XFB passthrough GS's.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32759 >
2024-12-21 01:50:32 +00:00
Alyssa Rosenzweig
07e1b523b9
libagx: use designated initializers
...
these work now :-)
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32759 >
2024-12-21 01:50:32 +00:00
Alyssa Rosenzweig
a3b796ba19
libagx,hk: handle pipeline stats queries without a GS
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32759 >
2024-12-21 01:50:32 +00:00
Alyssa Rosenzweig
5bc89aa991
hk,libagx: handle adjacency without a GS
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32759 >
2024-12-21 01:50:32 +00:00
Alyssa Rosenzweig
872487919b
hk,libagx: accelerate index buffer robustness
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32759 >
2024-12-21 01:50:32 +00:00
Alyssa Rosenzweig
f106451a90
hk: factor out hk_draw_as_indexed_indirect
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32759 >
2024-12-21 01:50:32 +00:00
Alyssa Rosenzweig
954080275b
hk: use index buffer overflow check
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32759 >
2024-12-21 01:50:31 +00:00
Alyssa Rosenzweig
e0cfc5eac1
libagx: factor out load/store_index
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32759 >
2024-12-21 01:50:31 +00:00
Alyssa Rosenzweig
ff7abb1e22
libagx: refactor index buffer code
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32759 >
2024-12-21 01:50:31 +00:00
Alyssa Rosenzweig
686daf2524
libagx: move index size helpers to the gpu
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32759 >
2024-12-21 01:50:31 +00:00
Alyssa Rosenzweig
b5d41bc0fb
agx: match another address pattern
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32759 >
2024-12-21 01:50:31 +00:00
Alyssa Rosenzweig
7626e40506
asahi: reformat
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32759 >
2024-12-21 01:50:31 +00:00
Alyssa Rosenzweig
fc4e533709
agx: add more 8-bit address fusing rules
...
helps kernel I'm writing
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32759 >
2024-12-21 01:50:31 +00:00
Alyssa Rosenzweig
e110b8f2c9
libagx: add missing agx_vdm_return
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32759 >
2024-12-21 01:50:31 +00:00
Alyssa Rosenzweig
b9155de0a1
hk,libagx: move hk_draw to the gpu
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32759 >
2024-12-21 01:50:31 +00:00
Asahi Lina
c80c56a315
asahi: hk: Enable timestamps for virt
...
Signed-off-by: Asahi Lina <lina@asahilina.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32759 >
2024-12-21 01:50:31 +00:00
Asahi Lina
e281293508
asahi: Virt UABI update
...
Support timestamp extensions & fix a bunch of missing/broken things we
were dragging along.
Signed-off-by: Asahi Lina <lina@asahilina.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32759 >
2024-12-21 01:50:31 +00:00
Alyssa Rosenzweig
0d5db3238b
asahi: fix mmap'ing imported BOs
...
bo->dev wasn't being set on the import path. apparently mmap'ing imported BOs is
really rare, so this slipped through. should address segfaults with gnome
settings.
Reported-by: girona
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32759 >
2024-12-21 01:50:31 +00:00
Erik Faye-Lund
57dc5bb31f
asahi: use vk_descriptor_type_is_dynamic
...
No need to open-code this one now that we have a generic helper.
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32627 >
2024-12-19 15:12:58 +00:00
Alyssa Rosenzweig
b7f2d480da
agx: optimize scratch access
...
so we can use designated initializers and other fun features.
all affected shaders are in gfxbench:
total instructions in shared programs: 2750549 -> 2750497 (<.01%)
instructions in affected programs: 10832 -> 10780 (-0.48%)
helped: 4
HURT: 2
Inconclusive result (value mean confidence interval includes 0).
total alu in shared programs: 2278478 -> 2278760 (0.01%)
alu in affected programs: 7040 -> 7322 (4.01%)
helped: 2
HURT: 4
Alu are HURT.
total fscib in shared programs: 2276985 -> 2277267 (0.01%)
fscib in affected programs: 7040 -> 7322 (4.01%)
helped: 2
HURT: 4
Fscib are HURT.
total bytes in shared programs: 19922466 -> 19922734 (<.01%)
bytes in affected programs: 71412 -> 71680 (0.38%)
helped: 4
HURT: 2
Inconclusive result (value mean confidence interval includes 0).
total regs in shared programs: 865070 -> 865086 (<.01%)
regs in affected programs: 142 -> 158 (11.27%)
helped: 0
HURT: 2
total uniforms in shared programs: 2120930 -> 2121034 (<.01%)
uniforms in affected programs: 244 -> 348 (42.62%)
helped: 0
HURT: 2
total scratch in shared programs: 11576 -> 11600 (0.21%)
scratch in affected programs: 2744 -> 2768 (0.87%)
helped: 0
HURT: 2
total spills in shared programs: 958 -> 868 (-9.39%)
spills in affected programs: 958 -> 868 (-9.39%)
helped: 6
HURT: 0
total fills in shared programs: 732 -> 626 (-14.48%)
fills in affected programs: 732 -> 626 (-14.48%)
helped: 4
HURT: 2
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32529 >
2024-12-12 21:16:13 +00:00