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
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
Eric Engestrom
a37d5dcd63
radv/ci: use deqp-vk-main in radv jobs
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28168 >
2024-11-27 20:38:05 +00:00
Alyssa Rosenzweig
c2973765e2
nir: add nir_lower_constant_to_temp helper
...
this comes up with clc.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com >
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32382 >
2024-11-27 20:02:05 +00:00
Alyssa Rosenzweig
12cc22af4c
nir: add nir_remove_entrypoints helper
...
opposite of nir_remove_non_entrypoint. this operation comes up with
precompiling.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com >
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32382 >
2024-11-27 20:02:05 +00:00
Alyssa Rosenzweig
c076900360
nir: add nir_function::pass_flags
...
convenience, asahi will stash stuff here.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com >
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32382 >
2024-11-27 20:02:05 +00:00
Alyssa Rosenzweig
7d6e923a4f
vtn: gather workgroup size in libraries
...
we have multiple kernels. that's fine, gather sizes for each.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Karol Herbst <kherbst@redhat.com >
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com >
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/32382 >
2024-11-27 20:02:05 +00:00
Alyssa Rosenzweig
9c37745f9d
vtn: plumb through OpEntryPoint
...
mark nir_functions as entrypoints according to the source.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Karol Herbst <kherbst@redhat.com >
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com >
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/32382 >
2024-11-27 20:02:05 +00:00
Alyssa Rosenzweig
5555769102
nir: add workgroup size to functions
...
for cl kernel libraries with many entrypoints. spirv can represent, nir should
be able to as well.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Karol Herbst <kherbst@redhat.com >
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com >
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/32382 >
2024-11-27 20:02:05 +00:00
Alyssa Rosenzweig
ba30eb9f40
nir: add nir_foreach_entrypoint macros
...
for compiling libraries full of kernels.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Karol Herbst <kherbst@redhat.com >
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com >
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/32382 >
2024-11-27 20:02:05 +00:00
Alyssa Rosenzweig
83581b3f1f
asahi/clc: switch to nir_lower_calls_to_builtins
...
common code has a generic version, so we don't need to handroll this.
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/32382 >
2024-11-27 20:02:04 +00:00
Alyssa Rosenzweig
d8ece9bf3a
nir: add nir_lower_calls_to_builtins pass
...
nir_builder for the GPU
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/32382 >
2024-11-27 20:02:04 +00:00
Pierre-Eric Pelloux-Prayer
879e8bfe6d
radeonsi: use bytes units in streamout
...
GFX10.3 and earlier were configured to count the number of dwords written,
and VGT_STRMOUT_DRAW_OPAQUE_VERTEX_STRIDE was also configured in dw units.
GFX11+ on the other hand used nir code that would use bytes.
This commit aligns radeonsi's logic on the radv's one, and use STRMOUT_DATA_TYPE
to configure older chips to use bytes as well.
This fixes GTF-GL46.gtf40.GL3Tests.transform_feedback2.transform_feedback2_two_buffers.
It also seems to have an effect on:
- dEQP-GLES3.functional.transform_feedback.random.separate.*
- dEQP-GLES3.functional.transform_feedback.random_full_array_capture.separate.*
but the results seem flaky so need further investigation.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32281 >
2024-11-27 19:00:20 +00:00
Pierre-Eric Pelloux-Prayer
272addc672
ac/nir: remove prim_stride_ret arg from ngg_build_streamout_buffer_info
...
This is not used outside of this function, so declare it as a local
variable instead.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32281 >
2024-11-27 19:00:20 +00:00
Pierre-Eric Pelloux-Prayer
9f4ab06842
glx: return BadMatch for invalid reset notification strategy
...
The specification doesn't say which error should be reported, but
piglit expects BadMatch:
/* The GLX_ARB_create_context_robustness spec does not say what error
* code should be generated. However, similar cases (e.g., valid GL
* versions) specify BadMatch. This is also the behavior of NVIDIA's
* closed-source driver.
*/
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32281 >
2024-11-27 19:00:20 +00:00
Pierre-Eric Pelloux-Prayer
d3798130ad
radeonsi: disable DCC for PIPE_BIND_USE_FRONT_RENDERING
...
Front rendering and (display) DCC are causing artifacts on screen.
si_texture_get_handle deals with this problem by disabling dcc, but
we can make it simpler by not allocating DCC at all when this flag
is set.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32281 >
2024-11-27 19:00:20 +00:00
Pierre-Eric Pelloux-Prayer
666a6eb871
radeonsi/gfx12: disable display dcc for front buffer rendering
...
Same logic as other chips, except we need to reallocate the texture
as we can't disable dcc.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32281 >
2024-11-27 19:00:20 +00:00
Pierre-Eric Pelloux-Prayer
df7bb6bfd2
dri: Remove unused function
...
This function is unused so get rid of it.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32281 >
2024-11-27 19:00:20 +00:00
Zan Dobersek
be9f2e5189
tu/a7xx: support 8x MSAA
...
a7xx hardware has 8x MSAA capabilities we can expose. The 8-bit sample
count flag is included in the supported sample counts when computing image
format properties for MSAA-capable image creation conditions, with the
exception of 128-bit formats that don't support 8x MSAA.
UBWC blocksize logic is updated to cover cases of 16-bit and 32-bit formats
that support 8x MSAA. The per-cpp blocksize array is adjusted to also cover
128-byte values for which UBWC has to be disabled anyway.
VK_EXT_sample_locations implementation is adjusted to support sampling in
up to 8 locations, achieved by writing into additional sample location
registers.
Signed-off-by: Zan Dobersek <zdobersek@igalia.com >
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32180 >
2024-11-27 17:26:02 +00:00
Lionel Landwerlin
292c6a5156
anv: avoid using cmd_buffer for flushing runtime
...
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Tapani Pälli <tapani.palli@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32372 >
2024-11-27 16:51:57 +00:00