Commit graph

193386 commits

Author SHA1 Message Date
Pavel Ondračka
9966365fe0 ttn: switch to derivative intrinsics
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30572>
2024-08-13 12:45:12 +00:00
Alyssa Rosenzweig
5f437aa24d elk: fix compute shader derivatives
derivatives are not fs only so move to be with the rest of subgroup ops.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11674
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30634>
2024-08-13 12:19:30 +00:00
Iago Toral Quiroga
ad9ff707ce broadcom: drop backend implementation of nir_op_ufind_msb
We can have NIR do this for us now that we have uclz.

Suggested by Georg Lehmann.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30614>
2024-08-13 13:16:18 +02:00
Iago Toral Quiroga
35a10f5d5a broadcom: implement nir_op_uclz
This enables some algebraic optimizations.

No changes in shader-db, but it does cause some CTS tests to
produce less instructions.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30614>
2024-08-13 13:16:11 +02:00
Lionel Landwerlin
aaff191356 brw/rt: fix ray_object_(direction|origin) for closest-hit shaders
When closest hit shader is called, the BVH object level
brw_nir_rt_load_mem_ray origin/direction is 0. What we should be using
is the ray origin/direction and apply the transform of the current
instance.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 9ba7d459a3 ("intel/rt: Implement the new ray-tracing system values")
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30578>
2024-08-13 10:28:50 +00:00
Karol Herbst
7935623126 rusticl/kernel: simplify adding internal kernel args
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30602>
2024-08-13 10:07:03 +00:00
Karol Herbst
d72cc037f2 rusticl/kernel: move CompiledKernelArg decleration above the impl block
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30602>
2024-08-13 10:07:03 +00:00
Karol Herbst
24ea5a756c rusticl/kernel: add KernelArgType::is_opaque
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30602>
2024-08-13 10:07:03 +00:00
Karol Herbst
d26d17bbaf rusticl/kernel: big kernel arg rework
The main change here is that instead of having two vectors for API and
internal arguments, there is just one per built kernel.

Some of the API level information is still in its own structure and
referenced by the above mentioned merged vector, but with this change each
device and also each kernel variant can have arguments placed at different
locations or even have a different set of arguments.

This rework will be necessary to add kernel variants in a non messy way.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30602>
2024-08-13 10:07:03 +00:00
Karol Herbst
0b98e47d83 rusticl/kernel: move serialization code of KernelArgType
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30602>
2024-08-13 10:07:03 +00:00
Karol Herbst
2645ba6942 rusticl/kernel: rename InternalKernelArgType to CompiledKernelArgType
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30602>
2024-08-13 10:07:03 +00:00
Karol Herbst
3cc3ba2e8f rusticl/kernel: make KernelArg::offset and KernelArg::binding proper u32 values
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30602>
2024-08-13 10:07:03 +00:00
Karol Herbst
b142bee150 rusticl/kernel: make CompiledKernelArg::offset a u32
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30602>
2024-08-13 10:07:03 +00:00
Karol Herbst
e69ad5ff69 rusticl/kernel: remove CompiledKernelArg::size
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30602>
2024-08-13 10:07:03 +00:00
Karol Herbst
3ddc2b536d rusticl/kernel: rename InternalKernelArg to CompiledKernelArg
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30602>
2024-08-13 10:07:03 +00:00
Karol Herbst
16a2808299 rusticl/kernel: move kernel size into Constant arg type
It's the only argument type with an actual size.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30602>
2024-08-13 10:07:03 +00:00
Karol Herbst
0cfcd2ff83 rusticl/memory: fix sampler argument size check
Not entirely sure why this hasn't caused any problems...

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30602>
2024-08-13 10:07:03 +00:00
Pavel Ondračka
1cad339409 r300: bias presubtract fix
We need to double check that the source is indeed constant before
looking at the constant type.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Fixes: 0508db9155
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29893>
2024-08-13 08:52:45 +00:00
Samuel Pitoiset
5d367aba7b radv: stop re-initializing HTILE for non-compressed to compressed transitions
Decompressing HTILE should also reset the HTILE metadata to initial
state which means that re-initializing it for non-compressed to
compressed transitions is redundant.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30122>
2024-08-13 06:16:03 +00:00
Alyssa Rosenzweig
f690592692 agx: lower exact frcp
the hardware is off by 1 ULP. fixes nir_lower_idiv brokenness.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 19:11:23 -04:00
Alyssa Rosenzweig
6405153a07 asahi: switch to block based compute blitter
This fixes the compute blitter with compression in the general case, and then
flips the switch since the compute blitter is faster / less buggy than the
traditional path.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 19:11:23 -04:00
Alyssa Rosenzweig
94cf7de88f asahi: pack imageblock words for compute
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 19:11:23 -04:00
Alyssa Rosenzweig
e3e82f7a6c agx: add a comment about an unknown bit
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 19:11:23 -04:00
Alyssa Rosenzweig
8b29f0a762 agx: handle explicit coordinate tib instructions
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 19:11:23 -04:00
Alyssa Rosenzweig
f706079dc5 agx: allow st_tile in compute shaders
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 19:11:23 -04:00
Alyssa Rosenzweig
9b39c5427f agx: plumb imageblock stride
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 19:11:23 -04:00
Alyssa Rosenzweig
b9eff53daa nir: add image_block_size_per_thread_agx info
This is like shared_size but for spatial data instead, for compute shaders that
use the tilebuffer.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 19:11:23 -04:00
Alyssa Rosenzweig
e754e54f88 nir: model AGX explicit coordinate intrinsics
I don't know what Apple calls these, so we're using the name "explicit
coordinates".

AGX has instructions for loading/stores register <---> tilebuffer ---> storage
images. Usually these are used in the fragment shader and end-of-tile shader to
implement colour attachments, with implicitly specified coordinates based on the
shader stage. However they can also be used in compute shaders with explicitly
specified coordinates ("imageblocks" in Apple parlance). Model this in NIR.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 18:46:31 -04:00
Alyssa Rosenzweig
290820e8b0 agx: fix block_image_store indirect ts
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 18:46:31 -04:00
Alyssa Rosenzweig
7de5d51f16 hk: advertise KHR_sampler_ycbcr_conversion
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 18:46:31 -04:00
Alyssa Rosenzweig
001a9e20c4 hk: denouveau
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 18:46:31 -04:00
Alyssa Rosenzweig
c50e0934e7 agx: let if-fusing opts interact
total instructions in shared programs: 2115031 -> 2114800 (-0.01%)
instructions in affected programs: 46937 -> 46706 (-0.49%)
helped: 147
HURT: 30
Instructions are helped.

total alu in shared programs: 1669893 -> 1669655 (-0.01%)
alu in affected programs: 38134 -> 37896 (-0.62%)
helped: 147
HURT: 28
Alu are helped.

total fscib in shared programs: 1666017 -> 1665779 (-0.01%)
fscib in affected programs: 38134 -> 37896 (-0.62%)
helped: 147
HURT: 28
Fscib are helped.

total bytes in shared programs: 14059380 -> 14057364 (-0.01%)
bytes in affected programs: 306294 -> 304278 (-0.66%)
helped: 147
HURT: 28
Bytes are helped.

total regs in shared programs: 656483 -> 656491 (<.01%)
regs in affected programs: 257 -> 265 (3.11%)
helped: 3
HURT: 4
Inconclusive result (value mean confidence interval includes 0).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 18:46:31 -04:00
Alyssa Rosenzweig
64239ac12c agx: fuse not into if
total instructions in shared programs: 2115466 -> 2115031 (-0.02%)
instructions in affected programs: 68776 -> 68341 (-0.63%)
helped: 222
HURT: 5
Instructions are helped.

total alu in shared programs: 1670328 -> 1669893 (-0.03%)
alu in affected programs: 54224 -> 53789 (-0.80%)
helped: 222
HURT: 5
Alu are helped.

total fscib in shared programs: 1666452 -> 1666017 (-0.03%)
fscib in affected programs: 54224 -> 53789 (-0.80%)
helped: 222
HURT: 5
Fscib are helped.

total bytes in shared programs: 14061990 -> 14059380 (-0.02%)
bytes in affected programs: 458702 -> 456092 (-0.57%)
helped: 222
HURT: 5
Bytes are helped.

total regs in shared programs: 656515 -> 656483 (<.01%)
regs in affected programs: 432 -> 400 (-7.41%)
helped: 7
HURT: 1
Inconclusive result (value mean confidence interval includes 0).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 18:46:31 -04:00
Alyssa Rosenzweig
2b1859cd06 agx: tweak jmp_exec_none heuristic
to make sure border colour code is skipped.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 18:46:31 -04:00
Alyssa Rosenzweig
339a1a4d73 hk: advertise more eds features
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 18:46:31 -04:00
Alyssa Rosenzweig
d512709eea hk: advertise shaderResourceMinLod
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 18:46:31 -04:00
Alyssa Rosenzweig
907fe00da1 agx: handle min_lod sources
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 18:46:31 -04:00
Alyssa Rosenzweig
03830c9523 agx: optimize popcount(ballot(true))
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 18:46:31 -04:00
Alyssa Rosenzweig
431a176287 hk: fix vkd3d-proton descriptor-performance
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 18:46:31 -04:00
Alyssa Rosenzweig
1d5c2f56d8 hk: implement drawIndirectCount
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 18:46:31 -04:00
Alyssa Rosenzweig
a6d7991475 libagx: add drawIndirectCount clone&patch kernel
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 18:46:31 -04:00
Alyssa Rosenzweig
f04ae930d9 nir,agx: add "active threads in subgroup" intrinsic
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 18:45:58 -04:00
Alyssa Rosenzweig
4dbce4a6a3 hk: fix restart index overemit
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 18:45:58 -04:00
Alyssa Rosenzweig
765e6ad2fc asahi,hk: generalize bo_bind hook
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 18:45:58 -04:00
Alyssa Rosenzweig
01ac52f05c hk: fix BDA alignment
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 18:45:57 -04:00
Alyssa Rosenzweig
f4cca9d600 asahi: introduce agx_va data structure
prep for sparse.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 18:45:57 -04:00
Alyssa Rosenzweig
5c7dd392d3 asahi: always pass align parameter for BOs
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 18:36:26 -04:00
Alyssa Rosenzweig
7ff31a4bf8 asahi: drop iThing logic
wontfix.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 18:36:26 -04:00
Alyssa Rosenzweig
8dae4aacb4 asahi: stop fixing up USC addresses
use the real VA space.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 18:36:26 -04:00
Alyssa Rosenzweig
77ea124d7e asahi: drop agx_bo::type
macOS silliness.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30633>
2024-08-12 18:36:26 -04:00