Commit graph

206742 commits

Author SHA1 Message Date
Rob Clark
cd4f6caa0d vtn: Handle non-32b tex dests
With cl_khr_fp16 we can get texture instructions w/ f16 dest.  Not all
drivers handle this, so convert to 32b dest and insert alu conversion to
the requested type.  Drivers that can handle f16 texture loads would
fold away the extra conversion with nir_opt_16bit_tex_image.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35470>
2025-06-11 17:48:10 +00:00
Mel Henning
d764e1c062 zink: Return NULL on vkCreateInstance failure
Previously we were returning uninitialized data on the error path.

Fixes: 015eda4a41 ("zink: deduplicate VkDevice and VkInstance")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35471>
2025-06-11 17:32:27 +00:00
Derek Foreman
95148a5dfd egl/dri/wayland: Fix memory leak in wayland buffer handling
In 54c4a41e2d some of the wl_buffers are
destroyed without using the loader_wayland_buffer_destroy functions on
their wrappers, leaking the wrapper.

Fixes 54c4a41e2d

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35466>
2025-06-11 17:09:47 +00:00
Erik Faye-Lund
1895d6a107 meson: use literal false instead of string
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This fixes the following warning from Meson:

meson.options:179: WARNING: Project targets '>= 1.3.0' but uses
feature deprecated since '1.1.0': "boolean option" keyword argument
"value" of type str. use a boolean, not a string

Fixes: d348fd5fb5 ("mediafoundation: Add mediafoundation frontend")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35468>
2025-06-11 16:02:26 +00:00
Aaron Ruby
36dd155e7a gfxstream: Prune the wait/signal semaphore lists on queue submissions
For Linux guests, remove syncFd semaphores entirely, as they are waited
on/signaled using the guest-side syncFd operations, and coarse
queueWaits only.

Reviewed-by: Gurchetan Singh <gurchetansingh@google.com>
Reviewed-by: Marcin Radomski <dextero@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34751>
2025-06-11 11:46:10 -04:00
Christoph Pillmayer
f9ed719c6a panvk: Add tests for ls tracker behavior in cs_loop
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35436>
2025-06-11 15:19:50 +00:00
Christoph Pillmayer
cdedd04640 panvk: Fix ls_tracker usage in cs_loop
LOAD_MULTIPLE can be emitted inside of a loop body. We need to WAIT if
that loads targets a register for which a load was not already in-flight
at the start of the loop body.

Technically we only have to emit the wait if the dst reg of a new load
is actually used inside the loop, but that would require separate
tracking of source regs used in the loop and is probably not worth
the effort for now.

Fixes: f75569734e (panvk: Remove explicit LS waits)
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35436>
2025-06-11 15:19:50 +00:00
Christoph Pillmayer
a24abc3fbd panvk: Move cs_wait_slot(s) and cs_flush_loads/stores
The following commit needs to flush loads from cs_loop_ functions.

Fixes: f75569734e (panvk: Remove explicit LS waits)
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35436>
2025-06-11 15:19:50 +00:00
Hoe Hao Cheng
a36e51af22 zink: remove fixup_driver_props
No longer needed after the codegen improvements

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35389>
2025-06-11 14:49:52 +00:00
Hoe Hao Cheng
4d1768aec5 zink/codegen: support double-loading dynamic properties arrays
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35389>
2025-06-11 14:49:52 +00:00
Hoe Hao Cheng
4eb50771e4 zink/codegen: add indentation to the mako templates
This regains us some much needed sanity

And it actually uncovered a bug in zink_instance.py:L306 (misplaced
%endif)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35389>
2025-06-11 14:49:52 +00:00
Hoe Hao Cheng
a5e114ce97 zink: apply EXT-suffixed functions to their unsuffixed counterpart
...if they are promoted to core verbatim.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35389>
2025-06-11 14:49:51 +00:00
Hoe Hao Cheng
66f0a99c73 zink: apply core functions to extension functions
...if those core functions were promoted verbatim from the extension.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35389>
2025-06-11 14:49:51 +00:00
Hoe Hao Cheng
ef1ae1f24f zink: make zink_device_info look for KHR versions of promoted exts
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35389>
2025-06-11 14:49:51 +00:00
Hoe Hao Cheng
bbfeb6cd87 zink: fix win32 detection in zink_device_info
str.find(substr) returns -1 if the substring's not in the string, and
bool(-1) returns True in Python, so the _WIN32 ifdef guard was actually
inserted everywhere.

Also, the win32 functions actually have "Win32" in their name, like
vkGetMemoryWin32HandleKHR

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35389>
2025-06-11 14:49:50 +00:00
Marek Olšák
4dafd2e787 radeonsi: add a workaround for a DrawTransformFeedback issue on gfx11.5
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35344>
2025-06-11 14:29:06 +00:00
Marek Olšák
d991810833 radeonsi/ci: update gfx8 failures
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35344>
2025-06-11 14:29:06 +00:00
Marek Olšák
56ed949e08 radeonsi: don't clamp the shadow comparison value for nir_texop_lod on gfx8-9
It doesn't have the value. This fixes a crash on gfx8-9.

Cc: mesa-stable

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35344>
2025-06-11 14:29:06 +00:00
Lionel Landwerlin
595889018a anv: implement VK_KHR_maintenance9
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35381>
2025-06-11 14:09:56 +00:00
Lionel Landwerlin
884df891d7 anv: allow device creation with no queue
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35381>
2025-06-11 14:09:56 +00:00
Lionel Landwerlin
1d8382b88e brw: enable more lowering for bitfield manipulation at non 32bit sizes
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35381>
2025-06-11 14:09:56 +00:00
Juan A. Suarez Romero
d983280da9 vc4: free RA interference graph on failure
This fixes a leak in the driver.

Backport-to: 25.1
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35464>
2025-06-11 13:29:35 +00:00
Martin Krastev
bacc0451bc svga/ci: vmware farm is back; restore piglit job to automatic
Signed-off-by: Martin Krastev <martin.krastev@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35459>
2025-06-11 13:11:44 +00:00
Pierre-Eric Pelloux-Prayer
7280e3b2a1 radeonsi/tests: update expected results
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35206>
2025-06-11 12:11:28 +00:00
Pierre-Eric Pelloux-Prayer
3bcbd11a33 aco/isel: fix visit_tex handling of is_sparse
For cases when less than 4 components are read, the original code
would compute an incorrect dmask. eg: with a single component + is_sparse,
the dmask was 0x13:
  - 0x 3 = coming from nir_def_components_read
  - 0x10 = the sparse bit
While it should have at 2 bits set (1 for the color/depth, 1 for tfe).

This caused problem when expand_vector() used the dmask to generate
the final results, because the value for the sparse component was
read from the wrong index.

So after the call to emit_mimg() dmask needs to be adjusted
because the components will be stored in order, so if mask is 0x11
the tfe value would be stored at invalid index=5 (while it should
be at index=1).

This fixes KHR-GL46.sparse_texture_clamp_tests.SparseTextureClampLookupResidency_texture_2d_depth_component16
and KHR-GL46.sparse_texture2_tests.SparseTexture2Lookup_texture_2d_depth_component16
with ACO.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35206>
2025-06-11 12:11:28 +00:00
Pierre-Eric Pelloux-Prayer
4a84ebfcb1 ac/llvm: rework component trimming in visit_tex
The referenced commit was a step in the right direction, but not
complete.

ac_build_image_opcode returns a vec<4> or a struct<vec<4>, int>
so we can simplify visit_tex. We just need to map these 4/5 values
to the expected layout from NIR.
eg: depth + TFE would produces "<d, x, x, x>, t" so it has to be
transformed into <d, t>.

nir_texop_fragment_mask_fetch_amd + sparse doesn't exist, so it's
another opportunity for simplification.

This is required to get KHR-GL46.sparse_texture2_tests.SparseTexture2Lookup_texture_2d_depth_component16
working properly.
The same test fails with ACO so it probably needs a change in the
same area.

Fixes: c0ef2aa7f8 ("DEPENDENCY: ac/llvm: fix sparse code handling")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35206>
2025-06-11 12:11:28 +00:00
Pierre-Eric Pelloux-Prayer
1cc52dff05 radeonsi: allow sparse depth textures
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35206>
2025-06-11 12:11:28 +00:00
Pierre-Eric Pelloux-Prayer
508bf2a490 radeonsi/tests: fix script handling of missing results
When running radeonsi-run-tests.py with the -t option, it's possible that
some suite won't generate any result so don't fail in this case.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35206>
2025-06-11 12:11:28 +00:00
Pierre-Eric Pelloux-Prayer
b153188f25 amd/ci: remove references to tests that don't exist anymore
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35206>
2025-06-11 12:11:27 +00:00
Pierre-Eric Pelloux-Prayer
3d8fe9b36d radeonsi: skip draws using invalid setup
Draws running with the secure bit set needs to have their destination
surfaces created with tmz to get the correct result.
Instead of asserting this fact, let just skip the invalid draws
completely.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35206>
2025-06-11 12:11:27 +00:00
Pierre-Eric Pelloux-Prayer
0e9ba3031e radeonsi: allow msaa sparse textures on gfx10+
The hardware doesn't support the prt layouts, but we can use normal
layouts and ac_surface_addr_from_coord to determince which pages
need to be committed.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35206>
2025-06-11 12:11:27 +00:00
Pierre-Eric Pelloux-Prayer
ee6d3a593e winsys/radeon: add surface_offset_from_coord
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35206>
2025-06-11 12:11:27 +00:00
Juan A. Suarez Romero
d6614099a0 vc4,v3d: update expected results
Add new failures/flakes.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35462>
2025-06-11 11:55:54 +00:00
Corentin Noël
1dfe97cc0b llvmpipe: Make sure to not divide by zero on debug output
Check that lp->nr_fs_variants is not zero before dividing by it as done in a few
lines above.

CID: 1417662 Division or modulo by zero
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35091>
2025-06-11 11:03:34 +00:00
Corentin Noël
d4d37ead82 llvmpipe: Make sure to not divide by zero on debug output
Check that lp->nr_cs_variants is not zero before dividing by it as done in a few
lines above.

CID: 1531786 Division or modulo by zero
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35091>
2025-06-11 11:03:34 +00:00
Corentin Noël
383684596c llvmpipe: Check for negative size before mapping the memory
CID: 1596479 Argument cannot be negative
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35091>
2025-06-11 11:03:34 +00:00
Corentin Noël
94f2d53586 llvmpipe: Close mem_fd or dmabuf_fd on error
The variable shadowing made the error path to leak these file descriptors.

CID: 1596485, 1596493 Logically dead code
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35091>
2025-06-11 11:03:34 +00:00
Corentin Noël
fb72e84c7a llvmpipe: Do bitwise operation on unsigned constants
This fixes coverity issues while all compilers would do the right thing here.

CID: 1605222 Overflowed constant
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35091>
2025-06-11 11:03:34 +00:00
Corentin Noël
c9243262f0 llvmpipe: Check allocated memory instead of argument
This is likely a copy-paste error.

CID: 1616035 Dereference after null check
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35091>
2025-06-11 11:03:33 +00:00
Corentin Noël
09938eee85 llvmpipe: Asserts that the format at least has one non-void channel
As we are using its index as array index, avoid the use of the -1 index there.

CID: 1517247, 1517239 Negative array index read
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35091>
2025-06-11 11:03:33 +00:00
Corentin Noël
d2aade9184 llvmpipe: Avoid function name leak on fail paths
Free the memory on the fail path, also check early on allocation failure.

CID: 1644471 Resource leak
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35091>
2025-06-11 11:03:33 +00:00
Emma Anholt
6e97df1d76 u_trace: Fix payload refcounting in u_trace_clone_append().
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
If the clone_append was to a chunk of the same u_trace that gets
process_chunk()ed after where we're cloning from, then the payloads would
have been unreffed in the previous chunk's cleanup_chunk().

Fixes use-after-frees with turnip gmem rendering that resulted in
corrupted payloads.

Fixes: 14e45cb21e ("util/u_trace: refcount payloads")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35379>
2025-06-11 10:02:30 +00:00
Rhys Perry
bc2edf14d8 ac/nir: run nir_lower_vars_to_ssa after nir_lower_task_shader
nir_lower_task_shader does nir_lower_returns, so we need this if the
launch_mesh_workgroups was in control flow.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13326
Backport-to: 25.1
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35411>
2025-06-11 09:01:39 +00:00
Samuel Pitoiset
3b326abf7b radv: add capture/replay for sparse buffers and descriptor buffer
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Shouldn't be super useful in practice because the normal capture/replay
BDA path should also work.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35366>
2025-06-11 07:31:29 +00:00
Samuel Pitoiset
643e1c4395 radv: cleanup creating sparse buffers with capture/replay
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35366>
2025-06-11 07:31:29 +00:00
Samuel Pitoiset
74acae0ed8 radv: stop setting the address for capture/replay and non-sparse buffers
This doesn't do anything because for non-sparse buffers, a device
memory object must be bound to the buffer.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35366>
2025-06-11 07:31:28 +00:00
Samuel Pitoiset
ee200cc0d1 radv: stop using vk_common entrypoints when not necessary
For less indirections.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35359>
2025-06-11 07:10:02 +00:00
Samuel Pitoiset
7d2f20b2fb radv: remove useless vk_common_entrypoints.h includes
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35359>
2025-06-11 07:10:02 +00:00
Samuel Pitoiset
f3578973d7 radv/meta: fix using the wrong pipeline layout for ASTC decoding
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35359>
2025-06-11 07:10:01 +00:00
Mike Blumenkrantz
2a58d7b333 zink: verify that mutable dmabufs are created with a format list
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
this is otherwise illegal

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35433>
2025-06-10 23:12:22 +00:00