Commit graph

2411 commits

Author SHA1 Message Date
Samuel Pitoiset
b30f780c4f vulkan: update spec to 1.4.340
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39476>
2026-01-23 16:07:30 +00:00
Samuel Pitoiset
873008f274 vulkan: fix missing begin debug marker for HPLOC
This fixes capturing with RGP.

Fixes: 091b43b970 ("radv: Use HPLOC for TLAS builds")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39427>
2026-01-22 08:32:18 +01:00
Yiwei Zhang
c031bbd4b6 vulkan/wsi: improve present wait enablement tracking
Reviewed-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39322>
2026-01-20 19:13:33 +00:00
Yiwei Zhang
669503e404 vulkan/wsi: rename khr_present_wait to has_present_wait
Trivial refactor to aligns with surrounding codes and avoid confusions.

Reviewed-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39322>
2026-01-20 19:13:33 +00:00
Yiwei Zhang
b986250b69 vulkan/wsi: fix present wait support and present id creation condition
Common wsi should only create that semaphore if present wait is enabled.
Drivers may only advertise KHR_present_wait2 w/o KHR_present_wait. So
the common wsi core has to check for both.

Fixes: bf285c3be9 ("vulkan/wsi: Add basic support for PresentWait2")
Reviewed-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39322>
2026-01-20 19:13:33 +00:00
Yiwei Zhang
be9caf8ed6 vulkan/wsi: avoid host stage when blit to foreign queue
For mitigating the below VVL violation:

> VUID-vkCmdPipelineBarrier-srcStageMask-09634
>
> vkCmdPipelineBarrier(): dstStageMask is VK_PIPELINE_STAGE_HOST_BIT
> but srcQueueFamilyIndex (0) != dstQueueFamilyIndex (4294967293).
>
> The Vulkan spec states: If either srcStageMask or dstStageMask
> includes VK_PIPELINE_STAGE_HOST_BIT, for any element of
> pBufferMemoryBarriers, srcQueueFamilyIndex and dstQueueFamilyIndex
> must be equal

Fixes: 153857fb64 ("vulkan/wsi: amend barriers for blit dst buffer going to foreign queue")
Reviewed-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39322>
2026-01-20 19:13:32 +00:00
Icenowy Zheng
734b6a8c35 vk: descriptors: sort bindings along with flags
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Vulkan spec requires binding flags to be matched with the binding with
the same index, however currently bindings are sorted with flags not
properly sorted, which leads to bindings and flags mismatch.

Resolve this by adding optional flags info to the parameters of
vk_create_sorted_bindings(), and refactoring panvk/pvr (which really
pair bindings and flags instead of only iterating flags) to use sorted
flags.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Reviewed-by: Ryan Mckeever <ryan.mckeever@collabora.com>
Reviewed-by: Simon Perretta <simon.perretta@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38967>
2026-01-20 15:55:47 +00:00
Konstantin Seurer
a6a62363df vulkan: Implement HPLOC
Reviewed-by: Natalie Vock <natalie.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39116>
2026-01-18 19:20:36 +01:00
llyyr
c3763b12e2 vulkan/wsi/headless: implement vkReleaseSwapchainImagesKHR for headless
We need to support this if we advertise KHR_swapchain_maintenance1

Cc: mesa-stable
Signed-off-by: llyyr <llyyr.public@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39218>
2026-01-17 06:21:32 +00:00
llyyr
a1dd7eec87 vulkan/wsi/headless: add stub for VkSurfacePresentScalingCapabilitiesKHR
Similar to last MR, since we advertise support for
KHR_swapchain_maintenance1, we need to advertise this

Cc: mesa-stable
Signed-off-by: llyyr <llyyr.public@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39218>
2026-01-17 06:21:32 +00:00
llyyr
9cd5a4849a vulkan/wsi/headless: populate VkSurfacePresentModeCompatibilityKHR
Previously, we ignored this struct which caused VVL to treat the
compatible mode list as NULL, causing false positive validation errors
on headless applications.

Closes: #14622

Cc: mesa-stable
Signed-off-by: llyyr <llyyr.public@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39218>
2026-01-17 06:21:32 +00:00
Alyssa Rosenzweig
5b44724ad2 vk/meta_copy_fill_update: simplify tex builder
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39271>
2026-01-14 08:18:15 +00:00
Alyssa Rosenzweig
41cdc548ee nir/builder: infer txf_ms/txl/txb opcodes
I'm not convinced these really should be separate opcodes at all in NIR, but
that's not what this patch is about. Here we just infer the opcodes in the
texture builder to allow simplified usage.

This lets us drop nir_txl() & nir_txb() helpers in favour of nir_tex(.lod/bias)
which is more normalized. We could also drop nir_txf_ms in favour of nir_txf but
that affects more callsites and is not obviously a win (unlike nir_txl which is
used once and nir_txb which is unused).

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39271>
2026-01-14 08:18:15 +00:00
Konstantin Seurer
077292f65b radv/bvh: Use box16 nodes when bvh8 is not used
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Using box16 nodes trades bvh quality for memory bandwidth which seems to
be roughly equal in performance.

Stats assuming box16 nodes are as expensive as box32 nodes:
Totals from 7668 (79.68% of 9624) affected BVHs:
compacted_size: 951666944 -> 742347648 (-22.00%)
max_depth: 57606 -> 57615 (+0.02%)
sah: 129114796242 -> 129998517775 (+0.68%); split: -0.00%, +0.68%
scene_sah: 188564162 -> 192063633 (+1.86%); split: -0.02%, +1.88%
box16_node_count: 0 -> 3270600 (+inf%)
box32_node_count: 3365707 -> 95100 (-97.17%)

Reviewed-by: Natalie Vock <natalie.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37883>
2026-01-10 11:36:28 +01:00
Eric Engestrom
93390d4b73 vk/runtime,zink: only integrate renderdoc on supported platforms
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
It is not actually available to all the platforms mesa can be compiled
to, so let's keep an opt-in list of supported platforms instead, and
compile it out on all other platforms.

Fixes: 48a0478126 ("zink: add renderdoc handling")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39176>
2026-01-07 09:08:46 +00:00
Marek Olšák
492a176cbb util: increase SHA1_DIGEST_LENGTH to 32 (BLAKE3_KEY_LEN)
The last 12 bytes are always 0 for now. With this, all SHA1 functions
can be internally implemented as BLAKE3, so that we can switch everything
to BLAKE3 by only changing the implementation of the sha1 utility.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39110>
2026-01-07 08:32:33 +00:00
Dave Airlie
833706e381 device-select: add a layer setting to disable device selection logic
There are cases like zink where we have a file descriptors we are searching
for devices for, so we don't need device selecting reordering, we just want
the fastest path to get the devices so we can match them.

This also helps avoid some cases of deadlock inside compositors where
zink/vulkan initialises later and tries to connect to the compositor.

This uses a VK_EXT_layer_setting to add a bypass setting.

Cc: mesa-stable
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38252>
2026-01-05 23:51:26 +00:00
Icenowy Zheng
e8c81652c9 vulkan/wsi/headless: do not destroy images that are never created
Currently the image creation failure handling codepath of
wsi_headless_surface_create_swapchain() just calls
wsi_headless_swapchain_destroy() , which will try to destroy all
`image_count` of images. However, some of these images might never be
successfully created because of the failure, which leads to double-free.

Set image_count to the number of successfully created images before
calling wsi_headless_swapchin_destroy() to prevent over-destroying.

Fixes dEQP-VK.wsi.headless.swapchain.simulate_oom.* on lavapipe and pvr,
although some of the tests got QualityWarning saying "Creating swapchain
did not succeed, callback limit exceeded" on lavapipe (Pass on pvr).

Cc: mesa-stable
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39039>
2026-01-05 19:05:06 +00:00
Franz Hoeltermann
0b86e1f752 device-select: Avoid usage of legacy GetPhysicalDeviceProperties
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This caused validation errors and redundantly called both the new "2"
variant and the legacy variant

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39058>
2026-01-01 17:51:35 +00:00
Yuxuan Shui
e0fbf9a908 wsi/display: Set atomic client cap in Acquire{Drm,Xlib}DisplayEXT as well.
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Since we use atomic mode setting now, the wsi->fd we use needs to have
the atomic client cap.

There are several different code paths where wsi can acquire a file
descriptor. For drm masters, the atomic client cap is set in
wsi_display_init_wsi. For leased drm fds, there are AcquireDrmDisplayEXT
and AcquireXlibDisplayEXT.

According to a comment we previously assumed wsi_display_get_connector
is common among all code paths, and that's why the atomic client cap was
set there. But that assumption can be broken based on the particular
order which the application invokes vulkan APIs in.

This commit simply push the drmSetClientCap to all entrypoints where a
drm fd comes through.

Fixes: 513ffea1d3 ("wsi/display: use atomic mode setting")
Signed-off-by: Yuxuan Shui <yshui@codeweavers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38987>
2025-12-23 00:47:26 +00:00
Yiwei Zhang
962bed2dd6 vulkan: update ALLOWED_ANDROID_VERSION for api level 36
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38988>
2025-12-17 19:22:47 +00:00
Alyssa Rosenzweig
079e9ae606 treewide: use BITSET_*_COUNT
Mix of Coccinelle patch, manual fix ups, sed, etc. Probably best to review the diff
as-if hand written:

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38955>
2025-12-16 17:42:10 +00:00
Aaron Ruby
3bddd2eaed Revert "device-select-layer: Implement VkNegotiateLayerInterface::pfnGetDeviceProcAddr"
This reverts commit b17896f693

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38953>
2025-12-15 16:46:13 +00:00
Faith Ekstrand
f43cff3728 util: Move STACK_ARRAY into util
It's useful for more than just Vulkan.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36385>
2025-12-12 10:03:02 +01:00
Christian Gmeiner
b393518bdf treewide: Use wsi_common_is_swapchain_image() helper
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Replace the duplicated swapchain image detection pattern across all
Vulkan drivers with the new wsi_common_is_swapchain_image() helper.

Since the swapchain handle can be extracted from VkImageCreateInfo's
pNext chain inside wsi_common_create_swapchain_image(), remove the
now-redundant VkSwapchainKHR parameter from that function.

This removes the #ifdef guards for Android/WSI platforms from each
driver, as the helper now handles this uniformly.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38541>
2025-12-11 20:20:39 +00:00
Christian Gmeiner
9a89280d62 vulkan/wsi: Add wsi_common_is_swapchain_image() helper
Add a helper function to check if a VkImageCreateInfo represents a
swapchain image by looking for VkImageSwapchainCreateInfoKHR in the
pNext chain.

This consolidates the swapchain detection logic that is currently
duplicated across all Vulkan drivers, and handles the Android case
in one place.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Suggested-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38541>
2025-12-11 20:20:39 +00:00
Aaron Ruby
b17896f693 device-select-layer: Implement VkNegotiateLayerInterface::pfnGetDeviceProcAddr
This must be implemented for loaderLayerInterfaceVersion >= 2. The only
interface that's allowed to be set to null is pfnGetPhysicalDeviceProcAddr.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38270>
2025-12-10 17:36:21 +00:00
Lionel Landwerlin
c1197d88e2 vulkan/runtime: include unaligned dispatch bit in hashing
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38837>
2025-12-10 07:44:31 +00:00
Marek Olšák
0c400fbed9 nir: give nir_lower_clip_cull_distance_array_vars a better name
also rename the file

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38465>
2025-12-10 05:16:34 +00:00
Marek Olšák
74995eb64d nir: split gathering array sizes from nir_lower_clip_cull_distance_array_vars
nir_lower_clip_cull_distance_array_vars was sneakily updating
shader_info::clip/cull_distance_array_size.

This moves the gathering into a new function
nir_gather_clip_cull_distance_sizes_from_vars.

v2: remove assertions that prevented nir_lower_clip_cull_distance_array_vars
    from being used with non-compact arrays

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com> (v1)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38465>
2025-12-10 05:16:34 +00:00
Aitor Camacho
273f668520 wsi/metal: Fix blit_imate_to_image's pool selection for cmd buffer alloc
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Fixes: 39a7d65113 ("wsi/metal: Backend addition for drivers built on top of Metal")

Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38785>
2025-12-04 20:08:02 +00:00
Aitor Camacho
a547c6306a wsi/metal: Fix command buffer release at destroy
Fixes: 39a7d65113 ("wsi/metal: Backend addition for drivers built on top of Metal")

Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38785>
2025-12-04 20:08:02 +00:00
Samuel Pitoiset
ac37885fc8 vulkan: update spec to 1.4.335
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This renames rayTracingInvocationReorder because both NV and EXT use
the same name.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38779>
2025-12-03 14:47:00 +00:00
Aitor Camacho
df19ec3020 vulkan/wsi: Fix double destroy of present_id_timeline at swapchain create
Fixes: c888da3d48 ("vulkan/wsi: Add mechanism to wait for WSI semaphore unsignal.")

Reviewed-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38754>
2025-12-03 09:53:42 +00:00
Lionel Landwerlin
104206fb0f vulkan/runtime: add an internal flag for independent sets
Shader objects are by definition I think independents.

But implementation like Anv would like to optimize dynamic descriptors
if possible. It's possible if the sets are not independent.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38678>
2025-12-02 13:25:20 +00:00
Lionel Landwerlin
5c53c6e693 vulkan/runtime: track dynamic descriptor offsets for RT pipelines
Dynamic descriptors are mapped an array of offsets provided through
vkCmdBindDescriptorSets*() commands.

When pipelines are compiled with independent sets layouts, the
implementation might have to do additional runtime calculation to
figure out what offset in the contiguous array maps to what dynamic
descriptor in the pipeline layout.

For graphics pipelines you can always compute that information when
binding the shaders. There is always a limited amount of shaders (5
max).

For ray tracing pipelines, there could be lots of shaders to process
at every pipeline binding call. Besides there is no interface from the
runtime to the driver to list all the shaders used at the moment.

So do that tracking in the runtime and pass the information down to
the driver through the cmd_set_rt_state() vfunc.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 69a04151db ("vulkan/runtime: add ray tracing pipeline support")
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38678>
2025-12-02 13:25:20 +00:00
Aitor Camacho
16c98f4f18 vulkan/cmd_queue: Use vk_strdup and free allocated string memory
Fixes: 9082715ab0 ("vk/cmd_queue: generate copies for string struct members")

Reviewed-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38634>
2025-12-01 18:44:47 +00:00
Hans-Kristian Arntzen
974dba2afe vulkan/wsi: Promote EXT_swapchain/surface_maintenance1.
No spec changes, just update the enums and types.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37157>
2025-11-30 10:30:52 +01:00
Aleksi Sapon
cef4102548 nir, vk: fix MSVC unused variable warning
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38663>
2025-11-28 01:52:12 +00:00
Yonggang Luo
123a66fc43 util,asahi,vulkan,panfrost: Replace the remaining usage of getenv with os_get_option
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Antonio Ospite <antonio.ospite@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38640>
2025-11-27 18:22:32 +00:00
Sagar Ghuge
d8447fd392 vulkan/runtime: Account for pipeline libraries stage count
Don't excludes stages coming from pipeline libraries. This caused valid
group indices referring to library stages to be dropped, leading to
mismatched stage_count.

Fixes: e05a9b77b6 ("vulkan/runtime: split rt shaders hashing from compile")
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38669>
2025-11-26 22:17:57 +00:00
Joshua Ashton
8916b8a7f4 vulkan/wsi: Handle 0xFFFFFFFF special case in vk_wsi_force_swapchain_to_current_extent driconf
Current extent can be 0xFFFFFFFF (-1) which indicates there is no current extent, and the swapchain will inherit that of which the application provides.

Check this before applying the hack.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31134>
2025-11-25 22:10:38 +00:00
Faith Ekstrand
e4e619d685 vulkan/drm-syncobj: Stop returning early waiting for sync files
In the WAIT_ALL case in spin_wait_for_sync_file(), we were returning the
moment we saw the first success.  However, this isn't a wait-all, it's a
bad wait-any.  We should instead just continue on to check the next sync
until we've ensured that every sync in the array has a sync file.  The
only reason this wasn't blowing up in our face is because it only
affects non-timeline drivers (pretty rare these days) and because most
of the places where we use WAIT_PENDING on non-timeline drivers is to
guard a sync file export and those typically have only a single sync in
the array.

Cc: mesa-stable
Reviewed-by: Gurchetan Singh <gurchetansingh@google.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38635>
2025-11-25 06:08:07 +00:00
Simon McVittie
b860ae309a vulkan: Optionally share one JSON manifest per driver between architectures
If the library_path is just a basename like `libvulkan_lvp.so`, then we
can share the same JSON manifest like `lvp_icd.json` between all of the
architectures, like we already do for Vulkan layers. The library will
be looked up in the dynamic linker's default search path in this case,
and in practice will be found in `${libdir}`. This is how the Mesa's
EGL driver and Vulkan layers work, how Mesa is packaged in Debian 13,
and also how the Nvidia proprietary driver works; it makes installation
simpler for distros, especially on multiarch systems like Debian and
the freedesktop.org SDK.

However, if we want a separate manifest per architecture in order to
be able to write the full path into it, we still need per-architecture
filename disambiguation like `lvp_icd.x86_64.json`.

We presumably still want a separate per architecture on Windows, because
the concept of a single monolithic `${libdir}` is less common there, and
it can also be helpful during development when setting `$VK_DRIVER_FILES`
to force the use of a specific driver installed in a non-default location.

Use the following parameter to passed to vk_icd_gen:
'--icd-lib-path', vulkan_icd_lib_path,
'--icd-filename', icd_file_name,
output : 'virtio_icd.' + vulkan_manifest_suffix,

and the output is passed by '--out', '@OUTPUT@',
so we can detect vulkan_manifest_per_architecture from the --out parameter in script.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13745
Signed-off-by: Simon McVittie <smcv@collabora.com>
Co-authored-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37314>
2025-11-24 19:05:57 +00:00
Simon McVittie
1ec7bc382d vulkan: Don't emit library_arch if the library_path is just a basename
If the library_path is just a basename like `libvulkan_lvp.so`, then
we can share the same JSON manifest between all of the architectures,
like we already do for Vulkan layers. This is also how the Nvidia
proprietary driver works, and how Mesa is packaged in Debian 13.
However, this will only work if we don't mark the manifest as being
architecture-specific.

This partially reverts commit f7aa6ba9 "vulkan: Specify library_arch in
ICD files".

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37314>
2025-11-24 19:05:57 +00:00
Hyunjun Ko
01de6ac134 vulkan/video: Fix H.265 long-term reference handling
Without these fixes, H.265 streams using long-term references would
fail to decode correctly as the decoder wouldn't distinguish between
short-term and long-term reference frames.

Fixes: 896f95a37e ("vulkan/video: fix h265 decoding with LT enabled.")

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38571>
2025-11-24 12:58:02 +00:00
Hyunjun Ko
0fd0b76922 vulkan/video: Fix H.265 short-term reference picture set handling
An H.265 SPS can contain multiple short-term reference picture sets.
Fix the code to properly store and copy all sets instead of just one.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38571>
2025-11-24 12:58:02 +00:00
Samuel Pitoiset
9c34567a4a vulkan: stop excluding Shader64BitIndexingEXT SPIR-V cap
The SPIRV spec has been fixed since
3853dc11e5 ("spirv: Update the JSON and headers").

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38543>
2025-11-20 15:44:04 +00:00
Samuel Pitoiset
d700205a9d vulkan: add support for vkCustomResolveCreateInfoEXT
This basically remaps color attachment formats for the resolve
operation.

Co-Authored-by: Connor Abbott <cwabbott0@gmail.com>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38442>
2025-11-18 17:03:13 +00:00
Lionel Landwerlin
c12fa4bf8b vulkan/runtime: fix incorrect assert on empty shader groups
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: e05a9b77b6 ("vulkan/runtime: split rt shaders hashing from compile")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14278
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38466>
2025-11-17 12:12:22 +00:00