Commit graph

201327 commits

Author SHA1 Message Date
Timur Kristóf
b0b1a07193 radv: Remove now unused num_prim_interp from shader_info.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32220>
2024-11-28 18:14:57 +00:00
Timur Kristóf
12b9b461e5 radv: Emit SPI_PS_IN_CONTROL when emitting PS inputs on GFX10.3.
GFX10.3 keeps track of per-vertex and per-primitive PS inputs
separately in NUM_INTERP / NUM_PRIM_INTERP,
which we only really know when emitting the inputs.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32220>
2024-11-28 18:14:57 +00:00
Timur Kristóf
e2b8c4a9ac radv, aco: Consolidate num_interp + num_prim_interp into num_inputs.
num_inputs contains the total number of FS inputs.

Note that this also fixes a bug where some calculations in RADV
and ACO were missing the per-primitive attributes from the LDS
usage of PS.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32220>
2024-11-28 18:14:57 +00:00
Timur Kristóf
e5a9ae912b radv: Slightly simplify potentially per-primitive FS inputs.
Add export_prim_id_per_primitive for mesh shaders.
This prepares to also configure some of these to be per-primitive
in the future, even in the traditional pipeline.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32220>
2024-11-28 18:14:56 +00:00
Timur Kristóf
930243bf36 radv: Reorder potentially per-primitive FS builtins.
There are some FS built-ins that can be per-vertex or
per-primitive depending on whether a mesh shader is used:
primitive ID (implicit in VS), layer and viewport.

However, the HW requires per-primitive FS inputs to be ordered last.
This causes bugs when the same unlinked FS is used together
with VS/TES/GS and MS (with unlinked ESO or fast-linked GPL).

To solve this problem, we reorder the FS inputs so that these
potentially per-primitive inputs go after per-vertex inputs but
before per-primitive inputs.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32220>
2024-11-28 18:14:56 +00:00
Alyssa Rosenzweig
f4a3ba5302 asahi,vtn: precompile kernels
switch libagx to the precompilation pipeline. see the big comment in the
previous commit for why we're doing this.

while doing so, we move some dispatch stuff. there was so much churn from
precompile that this avoids doing the churn twice. that new header will be used
for DGC down the road.

there's also a small vtn/bindgen patch in here to skip bindgen'ing entrypoints,
as that conflicts with the new dispatch macros. this is the sane behaviour, we
just need to do the full precomp switch across the tree at once.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32339>
2024-11-28 17:34:12 +00:00
Alyssa Rosenzweig
e3001352ad nir: add helpers for precompiled shaders
v2: generalize function signatures.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com> [v1]
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com> [v1]
Acked-by: Mary Guillemard <mary.guillemard@collabora.com> [v2]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32339>
2024-11-28 17:34:12 +00:00
Rhys Perry
4c3809e7fc aco: use small_vec in RegCounterMap
This seems to be a little faster.

insert_NOPs (navi31):
Difference at 95.0% confidence
	-11.484 +/- 6.13377
	-1.62767% +/- 0.860593%
	(Student's t, pooled s = 5.71913)

insert_NOPs (gfx1200):
Difference at 95.0% confidence
	-35.6745 +/- 4.97972
	-8.1236% +/- 1.10453%
	(Student's t, pooled s = 4.6431)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32374>
2024-11-28 17:07:34 +00:00
Rhys Perry
7a500c8b22 aco: make small_vec copyable
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32374>
2024-11-28 17:07:34 +00:00
Marek Olšák
c26da94b4c nir/opt_varyings: replace options::lower_varying_from_uniform with a cost number
This is a simple way for drivers to enable uniform expression propagation
without having to set any callbacks for it. It replaces the old option.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32390>
2024-11-28 15:39:46 +00:00
Marek Olšák
428613b690 nir/opt_varyings: add a default callback for varying_estimate_instr_cost
used when the driver doesn't set it.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32390>
2024-11-28 15:39:46 +00:00
Marek Olšák
1f238f0a2e nir/opt_varyings: always call remove_dead_varyings in init_linkage
so that we don't have to do it after every init_linkage call.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32390>
2024-11-28 15:39:46 +00:00
Scott Moreau
7d1a32fafd dri: Fix hardware cursor for cards without modifier support
After the breaking commit, gbm_bo_create_with_modifiers({LINEAR}) returns
a BO with gbm_bo_get_modifier() = INVALID. This restores the functionality
and fixes most notably, hardware cursors for cards without modifiers.

Fixes #12039.

Fixes: 361f362258 ("dri: Unify createImage and createImageWithModifiers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31725>
2024-11-28 14:52:42 +00:00
Marek Olšák
c1442030ec vc4: lower clip planes in st/mesa
This fixes:
    spec@glsl-1.20@execution@clipping@vs-clip-vertex-enables
with the latest nir_lower_clip changes.

The driver breaks when POS is stored before CLIP_DIST.
That's the only change caused by previous commits according to
VC4_DEBUG=nir.

Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32363>
2024-11-28 14:14:47 +00:00
Marek Olšák
c50c9e9bf9 nir/lower_clip: implement ClipVertex lowering for GS + lowered IO correctly
This is currently needed to fix d3d12 for st_unlower_io_to_vars.

The idea is to track the current value of ClipVertex in a temporary
variable, and for every emit_vertex, we load the ClipVertex value from
the temporary (which matches the stored value) and insert new CLIP_DIST
stores before emit_vertex.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32363>
2024-11-28 14:14:47 +00:00
Marek Olšák
a648acc287 nir/lower_clip: convert nir_lower_clip_gs to nir_shader_intrinsics_pass
and add struct lower_clip_state to hold the state for both
nir_lower_clip_gs and nir_lower_clip_vs.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32363>
2024-11-28 14:14:47 +00:00
Marek Olšák
3b8e4a71fe nir/lower_clip: set clip_distance_array_size outside of create_clipdist_vars
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32363>
2024-11-28 14:14:47 +00:00
Marek Olšák
b4ef50bca8 nir/lower_clip: separate code for IO variables and intrinsics
The code for IO variables was interleaved with code for IO intrinsics,
which was difficult to follow.

lower_clip_outputs is split and replaced by more accurate names:
lower_clip_vertex_var and lower_clip_vertex_intrin

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32363>
2024-11-28 14:14:47 +00:00
Marek Olšák
3e40c2010e nir/lower_clip: don't set cursor to fix crashes due to removed instructions
The original builder already points at the end of the function impl.
Just use that.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32363>
2024-11-28 14:14:47 +00:00
Job Noorman
1a0b4531d1 ir3: add workaround for predication hardware bug
Predication instructions sometimes need extra nops to workaround what
seems to be a hardware bug: prede needs 6 nops and the second
predt/predf of a predt/predf pair needs 4 nops.

The prede workaround is enabled starting from a6xx gen3 and the
predf/predt workaround from a6xx gen4, following the blob.

Fixes rendering corruption in God of War (2018).

Signed-off-by: Job Noorman <job@noorman.info>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32366>
2024-11-28 13:08:36 +00:00
Job Noorman
c129547d9c ir3/isa: allow rpt6/rpt7
The blob sometimes uses this for nop.

Signed-off-by: Job Noorman <job@noorman.info>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32366>
2024-11-28 13:08:36 +00:00
Danylo Piliaiev
794a092693 tu: Handle cmdbuf and rp_blit flags of TU_DEBUG_STALE_REGS_FLAGS
The flags handling was accidentally dropped before.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32352>
2024-11-28 12:48:15 +00:00
Erik Faye-Lund
14bca200be panvk: widen type before multiplying
This function returns an uint64_t, but returns the result of two
uint32_t values. If we don't widen at least one of them before
returning, the multiplication wraps large results.

So let's widen the type first, so we can preserve large offsets.

Fixes: d1934e44fc ("panvk: Implement occlusion queries for JM")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
CID: 1634943
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32380>
2024-11-28 10:22:22 +00:00
Erik Faye-Lund
2c6bc9615d panvk: correct signedness of timestamps
These functions returns signed values, so we shouldn't use an unsigned
variable to store one of them in.

Fixes: d1934e44fc ("panvk: Implement occlusion queries for JM")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
CID: 1635021
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32380>
2024-11-28 10:22:22 +00:00
Erik Faye-Lund
22985caf3f panfrost: sanity-check alignment
The page-alignment should always be a positive power of two. Let's
assert that, to avoid confusion.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
CID: 1605086
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32380>
2024-11-28 10:22:21 +00:00
Erik Faye-Lund
0d51248e5d lima: avoid memleak on error
We should free this pointer, otherwise we're leaking it.

CID: 1521251
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32381>
2024-11-28 09:59:51 +00:00
Erik Faye-Lund
b8bb9e08bc lima: add assert to validate list-lenght
If this could be zero, we'd end up with divisions by zero here, which
uh... would be bad? I don't think that can happen, so let's assert about
this, to make it clear what's going on.

CID: 1444660
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32381>
2024-11-28 09:59:51 +00:00
Erik Faye-Lund
e50f7fad86 lima: fixup typo
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32381>
2024-11-28 09:59:51 +00:00
Boris Brezillon
0109e012b8 panvk: Filter out input-attachment usage on non renderable formats
Fixes dEQP-VK.api.info.unsupported_image_usage.*.input_attachment_*
failures.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32378>
2024-11-28 09:28:14 +00:00
David Rosca
489ba819b0 radeonsi/vcn: Support tiling for JPEG decode
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32301>
2024-11-28 08:52:37 +00:00
Caterina Shablia
7ca8c19246 Revert "nir: introduce instance_index system value"
This reverts commit b9be1f1f20.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32332>
2024-11-28 07:53:01 +00:00
Caterina Shablia
9d5ba87ca1 Revert "nir: lower INSTANCE_{ID,INDEX} to an offset load_instance_{index,id} respectively"
This reverts commit a5bcf566a9.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32332>
2024-11-28 07:53:01 +00:00
Samuel Pitoiset
9bae92f659 radv: add support for capturing RGP per-submit
This is pretty basic but it can be enabled with MESA_VK_TRACE=rgp and
MESA_VK_TRACE_PER_SUBMIT=1.

Can be useful for compte-only workloads.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12202
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32370>
2024-11-28 07:03:21 +00:00
Samuel Pitoiset
f3272f0044 radv: add new start/stop sqtt helpers for capturing with SQTT
They will be also used for per-submit captures.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32370>
2024-11-28 07:03:21 +00:00
Samuel Pitoiset
df52c70b8a radv: finish tools after cleaning meta resources
Otherwise, the number of registered RGP pipelines could be non-zero
and this will assert.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32370>
2024-11-28 07:03:21 +00:00
Samuel Pitoiset
851a8a481b vulkan: add MESA_VK_TRACE_PER_SUBMIT
To capture RGP per-submit for compute-only workloads. Other capture
tools like RMV are not covered here.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32370>
2024-11-28 07:03:20 +00:00
Job Noorman
86465a3f2b ir3: add pass to select bitwise triops
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32181>
2024-11-28 06:19:59 +00:00
Job Noorman
faba4ca5f8 ir3: add codegen for bitwise triops
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32181>
2024-11-28 06:19:59 +00:00
Job Noorman
5879e4470e ir3: fix backend support for bitwise triops
- Immediates are not allowed in 2nd src.
- Immediates are 12 bits, not sign-extended.
- Only one of the first two sources can be shared when not scalar ALU.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32181>
2024-11-28 06:19:59 +00:00
Job Noorman
1333af5d77 nir/search: add is_only_used_by_{iand,ior} helpers
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32181>
2024-11-28 06:19:59 +00:00
Job Noorman
a8c947df9a nir/search: make is_only_used_by_iadd reusable
The algorithm is exactly the same for other opcodes so we don't have to
have to copy paste it.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32181>
2024-11-28 06:19:59 +00:00
Job Noorman
22fc90a116 nir: add ir3-specific bitwise triop opcodes
ir3 has a number of bitwise triops (e.g., shrm == (src0 >> src1) & src2)
that don't have NIR-equivalents. Doing instruction selection for them is
a lot more convenient using algebraic patterns than to have to manually
match for them. This patch add NIR opcodes for these instructions.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32181>
2024-11-28 06:19:59 +00:00
Eric Engestrom
c51378fa6c docs: add sha sum for 24.2.8
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32384>
2024-11-28 01:32:32 +01:00
Eric Engestrom
955bdb82c3 docs: add release notes for 24.2.8
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32384>
2024-11-28 01:32:32 +01:00
Eric Engestrom
4b0c600fa2 docs: update calendar for 24.2.8
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32384>
2024-11-28 01:32:32 +01:00
Marek Olšák
1a7c54b840 Revert "gbm: mark surface buffers as explicit flushed"
This reverts commit c49a71c03c.

It broke radeonsi.

GBM can't set __DRI_IMAGE_USE_BACKBUFFER if gbm itself doesn't use it as
a back buffer by rendering to it and calling SwapBuffers. If another
library uses it as a back buffer, that library should set
__DRI_IMAGE_USE_BACKBUFFER, not GBM. A different flag could be added
to indicate the behavior that the original commit expected.

Fixes: c49a71c03c - gbm: mark surface buffers as explicit flushed
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11996
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32345>
2024-11-27 22:48:04 +00:00
Timothy Arceri
1f954a207b glsl: remove now unused ir reader
This was used to parse glsl ir in string format and create real ir with
it. It was previously used for some really old test infrastructure which
has now been removed so lets burn this with fire also.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32364>
2024-11-27 22:05:06 +00:00
Timothy Arceri
722f939614 glsl: drop last remaining lower jump test
This test only tests that a redundant continue is removed. This test is
not very useful and there are hundreds of lines of supporting test
infrastructure that can be removed if we drop it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32364>
2024-11-27 22:05:06 +00:00
Timothy Arceri
cf188a0efb glsl: remove return lowering from glsl ir
We don't need it as nir does it for us anyway.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32364>
2024-11-27 22:05:06 +00:00
Timothy Arceri
6c86b56c06 glsl: disable function return lowering in glsl ir
We just let the nir lowering pass do it instead.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32364>
2024-11-27 22:05:06 +00:00