Commit graph

208129 commits

Author SHA1 Message Date
Marek Olšák
1124587495 glsl: don't lower inputs to temps unconditionally
It's done later in nir_lower_io_passes only for shader stages not
supporting indirect access.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35945>
2025-07-08 06:11:43 +00:00
Marek Olšák
9083e8b984 glsl: fix a possible crash in gl_nir_lower_xfb_varying
If the last block is empty, nir_block_last_instr returns NULL, which
sets the cursor to NULL, which crashes.

I think this can't crash currently because if xfb is present, there is
always at least 1 output store in the last block due to
lower_io_vars_to_temporaries, but that won't be true after we stop
calling it in a later commit.

Fixes: fa9cee4247 - glsl: implement lower_xfb_varying() as a NIR pass

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35945>
2025-07-08 06:11:43 +00:00
Marek Olšák
89285e25b6 nir: remove nir_shader_compiler_options::lower_all_io_to_temps
All drivers should report support_indirect_* correctly, so this
is redundant.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35945>
2025-07-08 06:11:43 +00:00
Marek Olšák
8def3f865d agx,freedreno,intel,lima,panfrost,svga,virgl,zink: fix supports_indirect_inputs
The GLSL compiler always lowers inputs to temps for VS and GS, so exclude
them from driver support because the GLSL compiler will no longer do that
unconditionally. Thus, indirect VS and GS inputs are completely untested
and broken in a lot of drivers.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35945>
2025-07-08 06:11:42 +00:00
Marek Olšák
a86f32a1ae etnaviv,r600,v3d,virgl: report correct nir_options::support_indirect_*
These drivers set lower_all_io_to_temps = true, which means all indirect
access is always lowered except TCS, which is skipped by
nir_lower_io_vars_to_temporaries. Based on that, these drivers have never
received indirect IO for non-TCS shaders.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35945>
2025-07-08 06:11:42 +00:00
Autumn Ashton
1ceded0c83 radv: Fix handling of NULL pColorAttachmentLocations in vkCmdSetRenderingAttachmentLocations
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
From the Vulkan spec:
`If pColorAttachmentLocations is NULL, it is
equivalent to setting each element to its index
within the array.`

Use similar logic to what we do in
CmdSetRenderingInputAttachmentIndices to handle
this behaviour properly.

Signed-off-by: Autumn Ashton <misyl@froggi.es>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35948>
2025-07-08 02:32:56 +00:00
Konstantin Seurer
a3785ff131 ci/llvmpipe: Update expectations
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26282>
2025-07-07 23:05:11 +00:00
Konstantin Seurer
975f1f3c4b vulkan/cmd_queue: Free pNext
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26282>
2025-07-07 23:05:11 +00:00
Konstantin Seurer
b52351c857 vulkan/cmd_queue: Fix indentation a bit
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26282>
2025-07-07 23:05:11 +00:00
Konstantin Seurer
12fd20bbb5 lavapipe: Implement VK_KHR_workgroup_memory_explicit_layout
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26282>
2025-07-07 23:05:11 +00:00
Konstantin Seurer
d519f917e1 llvmpipe: Use the correct field to decide if coroutines are used
Fixes: 92083fc ("llvmpipe: Do not use coroutines when they are unnecessary")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26282>
2025-07-07 23:05:11 +00:00
Konstantin Seurer
19d5d82d6f lavapipe: Implement VK_EXT_depth_bias_control
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26282>
2025-07-07 23:05:11 +00:00
Konstantin Seurer
b30bebf38e llvmpipe: Improve depth bias rounding workaround
Multiplying by 2 is too conservative to pass depth bias control CTS.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26282>
2025-07-07 23:05:11 +00:00
Konstantin Seurer
84f581c659 llvmpipe: Implement pipe_rasterizer_state::offset_units_unscaled
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26282>
2025-07-07 23:05:11 +00:00
Konstantin Seurer
803521f416 gallium: Add back pipe_rasterizer_state::offset_units_unscaled
The field was removed with the nine removal but it is needed for depth
bias control on Vulkan.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26282>
2025-07-07 23:05:11 +00:00
Konstantin Seurer
ebd2fc1441 docs: Document some lavapipe extensions
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26282>
2025-07-07 23:05:11 +00:00
Konstantin Seurer
5ec02e9d0f lavapipe: Advertise VK_EXT_tooling_info support
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26282>
2025-07-07 23:05:11 +00:00
Mike Blumenkrantz
66ba87d717 zink: support NV_timeline_semaphore
this is just adding new value arrays to the existing semaphore mechanics

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35866>
2025-07-07 21:18:29 +00:00
Mike Blumenkrantz
035d837a92 gallium: fix timeline semaphore value passing
using a screen method for this is broken since the value can change
before it is flushed. it must be passed along with the methods that use it

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35866>
2025-07-07 21:18:29 +00:00
Mike Blumenkrantz
ab1dbd0899 zink: capture KHR_timeline_semaphore properties
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35866>
2025-07-07 21:18:29 +00:00
Mike Blumenkrantz
6e8b9e143d mesa: support NV_timeline_semaphore
this is for use with vulkan interop and carries the same mechanics

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35866>
2025-07-07 21:18:29 +00:00
Mike Blumenkrantz
03e5a63058 zink: fix signaling multiple API semaphores
it's possible for multiple user semaphores to be signaled in one batch,
and these all have the same mechanics as wait semaphores, which means
they unfortunately need their own submit in order to preserve ownership
when resetting the batch state

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35866>
2025-07-07 21:18:28 +00:00
Mike Blumenkrantz
d65c37f72e mesa: PIPE_FD_TYPE_TIMELINE_SEMAPHORE -> PIPE_FD_TYPE_TIMELINE_SEMAPHORE_D3D12
functionally this is the same as other types of timeline semaphores, but
it is not actually the same as other types of timeline semaphores, e.g.,
in vulkan it would be VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT
whereas other types of timeline semaphores would have different handle types

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35866>
2025-07-07 21:18:28 +00:00
Mike Blumenkrantz
5f7e42706d mesa: set semaphore type directly during creation
this ensures the active type always matches

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35866>
2025-07-07 21:18:27 +00:00
Mike Blumenkrantz
488b1704e7 mesa: unify creation of real semaphore objects
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35866>
2025-07-07 21:18:27 +00:00
Eric R. Smith
6c64ad934f panfrost: spill registers in SSA form
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Before doing register allocation, use information available from
the SSA representation to determine register pressure and to
spill registers. This spilling doesn't have to be perfect (the
register allocator is still allowed to spill) but it will be
much faster to do the SSA spilling than RA spilling. In general
this should vastly improve the performance of register allocation.

Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34446>
2025-07-07 19:49:37 +00:00
Lionel Landwerlin
67e452669e anv: do not rely on sampler objects for pipeline compilation
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Descriptor set layout lifetime can be shorter than what the
implementation requires. One example is :
  * create descriptor set layout
  * create graphics pipeline library
  * destroy descriptor set layout
  * link optimize library in a final pipeline

The last step might need the descriptor set layout information again.

We've so far worked around this by taking a reference on the
descriptor set layout in the pipelines. But we forgot that descriptor
set layouts have pointers to samplers (for immutable & embedded
samplers).

We could take a reference to samplers but that sucks for various
reasons :
  - it consumes dynamic state heap space
  - it could cause issues with capture-replay placement

So instead we copy the information from the samplers that might be
needed in cases like link optimization. This includes :
  - ycbcr conversion state (used for NIR lowering)
  - embedded sampler data (to recreate the sampler)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35955>
2025-07-07 18:53:53 +00:00
Lionel Landwerlin
98bc185376 anv: rework embedded sampler hashing
Create a hashing key on all samplers so we can just copy that anywhere
we need it. That key already contains the needed parameters for
embedded samplers, so the sha1 stuff can go away.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35955>
2025-07-07 18:53:53 +00:00
Sushma Venkatesh Reddy
fa0232d961 intel/executor: Add missing dependency to fix intermittent build failures
The executor build was failing randomly due to a missing dependency on
`idev_intel_dev`. This patch adds the required dependency to the
`meson.build` file to ensure consistent and reliable builds across
different configurations.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35928>
2025-07-07 18:35:56 +00:00
Yiwei Zhang
0282ce8211 venus: back out implicit fencing handling for NV proprietary
It is a tech debt now since NV proprietary is on sw wsi path, and
rendering to the prime blit dst buffer  may never get supported there.
For later, when performance optimization is needed for venus on nv, we
can downgrade the sw wsi device workaround to a venus dri config, so
that setups with tiled explicit modifier support can be perf optimal.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35984>
2025-07-07 18:16:34 +00:00
Yiwei Zhang
054c8e117e venus: fix a prime blit assert
The assert doesn't consider multiple queue family case where the same
blit cmd has to be recorded for each, thus hitting the assert for the
same image and buffer.

Fixes: 5535184539 ("venus: track prime blit dst buffer memory in the wsi image")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35984>
2025-07-07 18:16:34 +00:00
Sushma Venkatesh Reddy
c89d788ffb docs: Add INTEL_DEBUG_BKP_BEFORE/AFTER_DISPATCH_COUNT
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35353>
2025-07-07 17:43:41 +00:00
Sushma Venkatesh Reddy
29fc96cb80 anv: Add GPU breakpoint before/after specific compute dispatch call
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13089
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35353>
2025-07-07 17:43:41 +00:00
Sushma Venkatesh Reddy
172e475705 intel: Add env variable to add break point on/before compute dispatch
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13089
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35353>
2025-07-07 17:43:40 +00:00
Mike Blumenkrantz
213874d42b zink: use unsynchronized cmdbuf for unsynchronized image GENERAL barriers
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
this fixes all the random sync issues

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35979>
2025-07-07 16:07:54 +00:00
Jesse Natalie
09096189c0 mediafoundation: Use C++ brace initialization instead of C-style
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35900>
2025-07-07 15:41:29 +00:00
Jesse Natalie
eca4743535 mediafoundation: Fix fence handling
- Use the right fence_wait method on the codec instead of the screen.
- Use fence_wait instead of using shared handles to wait.
- Release fence references.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35900>
2025-07-07 15:41:28 +00:00
Jesse Natalie
5f3a7cee83 gallium/video: Frontends separate in_fence and out_fence
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35900>
2025-07-07 15:41:28 +00:00
Sil Vilerino
9fc42666f4 d3d12: Remove requirement of surface creation/clearing functions for video
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35900>
2025-07-07 15:41:27 +00:00
Jesse Natalie
1959a352ea d3d12: Fix video fence lifetime issues
pipe_fence_handle is a refcounted object, it can't be owned by a container
which might have a different lifetime, it needs a dedicated heap allocation
so it can outlive its container.

Make sure that when we're handing out pipe_fence_handle references, that
we add a ref to them before handing them out.

Instead of assuming that a fence_wait call is for the exact fence that we
returned from a given op, mirror what's done on graphics and
opportunistically scan the batches to see what's done, and reclaim
resources for them.

Use d3d12_fence helpers to replace a lot of duplicated code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35900>
2025-07-07 15:41:27 +00:00
Jesse Natalie
e9301b36fe d3d12: Store fence FD type in the fence
Native sync fences represent point-in-time (fence + value) and can have
CPU wait events. Timeline semaphores represent a full timeline, do not
have a CPU wait event, and can have their value updated dynamically.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35900>
2025-07-07 15:41:27 +00:00
Mike Blumenkrantz
f335158cfa zink: always insert current batch sparse semaphore into sparse wait chain
this avoids desync in the case where a batch performs multiple distinct
sparse commit operations

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35978>
2025-07-07 15:21:27 +00:00
Mike Blumenkrantz
de9b4f1ae5 zink: move HIC resource usage check into hic transition function
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35976>
2025-07-07 10:48:07 -04:00
Rhys Perry
34f1a8f707 aco: handle FPAtomicToDenormModeHazard
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This is quite unlikely to happen, but I guess it might be possible and
it's relatively simple to work around.

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/35884>
2025-07-07 13:02:43 +00:00
Yogesh Mohan Marimuthu
d9e5e8f5fc winsys/amdgpu: pass r/w bo to w/r list in userq_wait ioctl
bo with write usage should wait for read and write fence. bo
with read usage should wait for write fence. Currently wrote bos
are passed to write list and read bos are passed to read like.
This patch fixes the issue.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35963>
2025-07-07 12:34:25 +00:00
Patrick Lerda
9e5d11bff3 r600: fix emit_ssbo_store() wrmask compatibility
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This issue was generating unwanted write accesses that
could overwrite previous operations.

Note: This functionality could also be tested with
nir_lower_wrmasks. This problem seems to only affect
the ssbos.

This change was tested on cypress, barts and cayman. Here are the tests fixed:
khr-gl4[3-6]/compute_shader/pipeline-pre-vs: fail pass
khr-gl4[5-6]/direct_state_access/queries_functional: fail pass
khr-gl4[5-6]/es_31_compatibility/shader_image_load_store/advanced-cast-cs: fail pass
khr-gl4[5-6]/es_31_compatibility/shader_image_load_store/advanced-cast-fs: fail pass
khr-gl4[5-6]/es_31_compatibility/shader_storage_buffer_object/advanced-switchbuffers-cs: fail pass
khr-gl4[5-6]/es_31_compatibility/shader_storage_buffer_object/advanced-switchprograms-cs: fail pass
khr-gl4[5-6]/es_31_compatibility/shader_storage_buffer_object/basic-operations-case1-cs: fail pass
khr-gl4[3-6]/shader_storage_buffer_object/advanced-switchbuffers-cs: fail pass
khr-gl4[3-6]/shader_storage_buffer_object/advanced-switchprograms-cs: fail pass
khr-gl4[3-6]/shader_storage_buffer_object/basic-operations-case1-cs: fail pass
khr-gl4[4-6]/texture_buffer/texture_buffer_max_size: fail pass
khr-gles31/core/compute_shader/pipeline-pre-vs: fail pass
khr-gles31/core/shader_image_load_store/advanced-cast-cs: fail pass
khr-gles31/core/shader_image_load_store/advanced-cast-fs: fail pass
khr-gles31/core/shader_storage_buffer_object/advanced-switchbuffers-cs: fail pass
khr-gles31/core/shader_storage_buffer_object/advanced-switchprograms-cs: fail pass
khr-gles31/core/shader_storage_buffer_object/basic-operations-case1-cs: fail pass
khr-gles31/core/texture_buffer/texture_buffer_max_size: fail pass
khr-glesext/texture_buffer/texture_buffer_max_size: fail pass

Cc: mesa-stable
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35830>
2025-07-07 12:08:15 +00:00
Marek Olšák
b31f73a1b1 ac/nir: use u_foreach_bit more
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35345>
2025-07-07 11:41:57 +00:00
Marek Olšák
896dd9bc93 ac/nir: eliminate sample_id/sample_pos if MSAA is disabled
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35345>
2025-07-07 11:41:57 +00:00
Marek Olšák
1c2007005e ac/nir: rename force_center_interp_no_msaa to msaa_disabled
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35345>
2025-07-07 11:41:57 +00:00
Juan A. Suarez Romero
3c7a8b4913 broadcom/ci: 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/35964>
2025-07-07 11:07:40 +00:00