Commit graph

2499 commits

Author SHA1 Message Date
Marek Olšák
a965ada6ee Inline mesa_sha1, SHA1_CTX
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40383>
2026-03-23 07:03:27 +00:00
Marek Olšák
110632f702 Inline SHA1_DIGEST_LENGTH
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40383>
2026-03-23 07:03:27 +00:00
Samuel Pitoiset
59883a5cb6 vulkan: stop passing vk_device to vk_set_subgroup_size()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40481>
2026-03-19 19:23:54 +00:00
Icenowy Zheng
38cf1b3829 vulkan/wsi/headless: properly use CPU images for CPU devices
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Currently the headless WSI unconditionally uses DRM images as WSI
images, which isn't proper behavior for working with lavapipe driver,
and leads to either error or crash (depending on whether udmabuf is
available).

Properly setup CPU images instead of DRM images for software-rendering
WSI devices.

This fixes (at least) `dEQP-VK.wsi.headless.swapchain.render.*` on
lavapipe.

Fixes: 90caf9bdbd ("vulkan/wsi/headless: drop the wsi_create_null_image_mem override")
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40360>
2026-03-17 23:49:38 +00:00
Erik Kurzinger
addadd20df wsi/display: retrieve monitor size from EDID
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
When libdisplay-info is available and we are able to retrieve the
physical size of a display from its EDID, use that to populate the
physicalDimensions field of VkDisplayPropertiesKHR.

Signed-off-by: Erik Kurzinger <ekurzinger@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39989>
2026-03-17 21:40:12 +00:00
Erik Kurzinger
64f2f97fb8 wsi/display: retrieve monitor name from EDID
When libdisplay-info is available and we are able to retrieve the make
and model of a display from its EDID, use those to construct a more
useful displayName for VkDisplayPropertiesKHR.

Signed-off-by: Erik Kurzinger <ekurzinger@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39989>
2026-03-17 21:40:12 +00:00
Lionel Landwerlin
173a4c6170 vulkan/runtime: break view mask from renderpass information
The runtime builds a final pipeline state with pointers to structures
coming from the associated pipelines libraries.

So far it has considered that the viewMask was part of a structure
together with the rest of the renderpass information. This information
can be specified in pre-raster, fragment & color-output state groups
and it was assumed would be consistent for all 3. And the runtime
currently takes the pointer to the structure from the last pipeline
library (color output).

Some coming spec/cts will clarify that the viewMask only needs to be
specified for pre-raster & fragment groups, making the value in the
color-output group untrustworthy.

This change creates a new state structure to hold the viewMask on its
own so it is only gather on pre-raster & fragment groups.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> (radv)
Reviewed-by: Aitor Camacho <aitor@lunarg.com> (kosmickrisp)
Reviewed-by: Connor Abbott <cwabbott0@gmail.com> (turnip)
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> (v3dv)
Reviewed-by: Frank Binns <frank.binns@imgtec.com> (powervr)
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> (panvk)
Royaled-yes-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> (lavapipe)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39940>
2026-03-17 20:13:35 +00:00
Erik Faye-Lund
e32f7ac381 vulkan: use common ycbcr code
There's a few things going on here:

1. Vulkan makes the YCbCr model and YCbCr range completely orthogonal.
   This means that we need to be able to handle an identity transform
   while still doing range-remapping, so we apply the range mapping and
   color-transform separately, and let the optimizer clean things up.
   This is similar to what we did before, but it means it's a bit harder
   to get completely optimal code out of this.

2. Vulkan defines that the YCbCr inputs come in a bit of an unusual
   order; Cr, Y, Cb. This means we need to reorder things a bit when
   applying the YCbCr range and multiplying the YCbCr color-model
   matrix. This makes the code a little bit confusing to read at times.

3. Because the alpha-channel is passed through this function, we need to
   expand the matrix to 4x3. This is similar to what we've already been
   doing, but also a bit unusual. In the future, we might want to keep
   the alpha-channel out of this code-path, and just work on a vec3
   here.

I suspect that all of these can be solved by rearranging the code a bit.
But I've left that as an excercize for later to make sure we get this
right first, with as few modifications as possible. Some people might
disagree with this approach, but let's see.

Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40175>
2026-03-17 15:00:54 +00:00
Yiwei Zhang
bd916d9de9 vulkan/android: add new helpers for aliased ANB support (spec v8+)
Reviewed-by: Lucas Fryzek <lfryzek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40384>
2026-03-16 21:09:42 +00:00
Samuel Pitoiset
d6fe5ee8a6 vulkan: do not pass vk_instance for debug report messages
RADV wants to abstract the compiler from any instance/device/pdev
objects.

The previous NULL check for instance seems to be useless.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40379>
2026-03-16 11:55:45 +00:00
Lionel Landwerlin
a8e49be9d9 vulkan/runtime: add implementation of older entrypoints using KHR_DAC
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40431>
2026-03-16 11:30:46 +00:00
Lionel Landwerlin
b7bf4e5304 vulkan/runtime: build (address|copy)_flags for vk_buffer
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40431>
2026-03-16 11:30:46 +00:00
Lionel Landwerlin
ba2e3b1d10 vulkan/runtime: add new helper for vertex strides
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40431>
2026-03-16 11:30:46 +00:00
Faith Ekstrand
3abdee9ec7 vulkan/render_pass: Always use separate depth/stencil layouts
There are no Vulkan drivers in Mesa that don't support this feature and
it's a hard requirement for Vulkan 1.2 so there's no reason why we
shouldn't also require it for the runtime render pass code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40154>
2026-03-16 09:16:09 +00:00
Samuel Pitoiset
7c12efb370 vulkan: add helpers for depth/stencil only layouts
Original patch from Faith Ekstrand.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40154>
2026-03-16 09:16:06 +00:00
Samuel Pitoiset
770a94e126 vulkan: add vk_image_memory_copy_layout()
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40385>
2026-03-16 08:44:08 +00:00
Samuel Pitoiset
045c1fff7d vulkan: add helpers for device address range
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40385>
2026-03-16 08:44:08 +00:00
Samuel Pitoiset
217dc750e7 vulkan: add support for vkCreateAccelerationStructure2KHR()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40385>
2026-03-16 08:44:08 +00:00
Samuel Pitoiset
730054ca47 vulkan: use vk_object_zalloc() for acceleration structs
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40385>
2026-03-16 08:44:08 +00:00
Samuel Pitoiset
e5bb3edad8 vulkan: update spec to 1.4.346
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40385>
2026-03-16 08:44:08 +00:00
Samuel Pitoiset
6d0fc30e7a vulkan: adjust MESA_VK_PIPELINE_RAY_TRACING_FLAGS with beta extensions disabled
This prevent a build failure in the next commit.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40385>
2026-03-16 08:44:07 +00:00
Francois Coulombe
4112eb2b0f vulkan/wsi/headless: add sRGB swapchain format support
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Headless surfaces when queried return that they only support RGBA UNORM
and BGRA UNORM. Adding those lines enables RGBA SRGB and BGRA SRGB
support to headless surfaces.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40275>
2026-03-15 23:15:15 +00:00
Ian Douglas Scott
6641c891fd wsi/wayland: Use wl_fixes to destroy wl_registry
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29140>
2026-03-12 16:24:33 +00:00
Mike Blumenkrantz
72bf7ad701 vk/cmd_queue: generate CmdPushConstants2
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40268>
2026-03-10 21:49:18 +00:00
Mike Blumenkrantz
47e78e60e3 vk/cmd_queue: generate the rest of the descriptor functions
this special cases the pData for template updating since it's a weird
one-off case where all the data needs to be copied

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40268>
2026-03-10 21:49:18 +00:00
Mike Blumenkrantz
c35499e99d vk/cmd_queue: move pipeline layout refs into builder
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40268>
2026-03-10 21:49:18 +00:00
Mike Blumenkrantz
dbbd5360f0 vk/cmd_queue: generate CmdPushDescriptorSet
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40268>
2026-03-10 21:49:17 +00:00
Mike Blumenkrantz
5f8b244ce6 vk/cmd_queue: generate CmdBindDescriptorSets
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40268>
2026-03-10 21:49:17 +00:00
Mike Blumenkrantz
f10f9d45bc vk/cmd_queue: pass command to struct copying methods
no functional changes

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40268>
2026-03-10 21:49:16 +00:00
Mike Blumenkrantz
9f272af038 vk/cmd_queue: return cmd instead of error code
the error code is always the same, and this is a bit more logical

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40268>
2026-03-10 21:49:15 +00:00
Mike Blumenkrantz
e3be0e23f9 vk/cmd_queue: handle descriptor layout refcounting
this enables supporting pnexted VkPipelineLayoutCreateInfo from vkCmdPushDescriptorSetWithTemplate2

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40268>
2026-03-10 21:49:15 +00:00
Mike Blumenkrantz
0c22630ba2 vk/cmd_queue: use arrays to directly manage refcounting
this allows deleting driver_free_cb and elimination of another iteration
of each cmdbuf on reset/free

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40268>
2026-03-10 21:49:14 +00:00
Mary Guillemard
8f2eeee7ba vulkan: Do not override the shader_flags in case of no task shader
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This should be doing a or and not an assign.
This fixes issues on NVK with mesh stages on DGC.

Signed-off-by: Mary Guillemard <mary@mary.zone>
Fixes: 9308e8d90d ("vulkan: Add generic graphics and compute VkPipeline implementations")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40266>
2026-03-10 20:03:56 +00:00
Connor Abbott
c7497ceed3 vulkan: Store a few more fields in vk_sampler
These will be used for subsampled images, which use immutable samplers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39868>
2026-03-06 21:26:41 +00:00
Lucas Fryzek
4933e60bc2 vulkan/wsi: Check that xshm can be attached
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Cc: mesa-stable
Co-authored-by: Carlos Lopez <clopez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35284>
2026-03-06 01:18:53 +00:00
Konstantin Seurer
d363381d18 vulkan/cmd_queue: Don't explicitly set struct members to NULL
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
They are already initialized by the memcpy above.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39902>
2026-03-03 10:19:31 +00:00
Konstantin Seurer
f2bb6103c3 vulkan/cmd_queue: Rework copy codegen
The new code handles pNext chanis correctly.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39902>
2026-03-03 10:19:31 +00:00
osy
5f8a9f0aeb vulkan: external sync for vk_sync_binary
Venus uses vkImportSemaphoreFdKHR() with FD == -1 to signal a binary
semaphore and vkGetSemaphoreFdKHR() to wait on a binary semaphore.

Both KK and Dzn uses vk_sync_binary so supporting this special case for
import/export sync file will enable Venus host support.

Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39067>
2026-02-24 14:23:05 +00:00
Georg Lehmann
d870d10ad9 vulkan,spirv: update headers
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40003>
2026-02-24 08:55:52 +00:00
Yiwei Zhang
715e4d1833 vulkan/wsi/drm: force prime buffer blit for WSI_DEBUG_BUFFER
This change updates wsi_drm_image_needs_buffer_blit to respect
WSI_DEBUG_BUFFER to force buffer blit similar to the cpu path. This has
been found pretty handy for debugging wsi backend related issues.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39947>
2026-02-20 05:26:57 +00:00
Samuel Pitoiset
090b67a163 vulkan/runtime: add support for ETC2 emulation with copy_memory_indirect
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39908>
2026-02-18 07:04:43 +00:00
Samuel Pitoiset
b6f292e146 vulkan/runtime: add a separate function to build ETC2 decode core shader
This will allow us to re-use it for indirect.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39908>
2026-02-18 07:04:43 +00:00
Daniel Stone
b8eb0f88d3 vulkan/wsi/wayland: Correctly map 24bpp format types
VK_FORMAT_{R8G8B8,B8G8R8}_{UNORM,SRGB} describe a 3-component, 8bpc,
24bpp, format. This is mapped to that type for Android, and implemented
as such by panvk. radv maps these to 4-component/32bpp formats, but only
support these formats for buffers rather than images. The outlier is
ANV, which relies on the 24->32bpp mapping to happen.

The Wayland WSI was mapping this to the 32bpp R8G8B8A8/B8G8R8A8 formats
instead. This would cause a failure to import the dmabuf into the
compositor on panvk, as it would send a buffer which was too small. (Or,
if it did import: garbage.)

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39552>
2026-02-17 19:25:19 +00:00
Konstantin Seurer
9a82e4ba81 vulkan/cmd_queue: Do not zero initialize vk_cmd_queue_entry
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Most of the struct will be initialized already. Make sure to initialize
everything so linear_alloc_child can be used.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39881>
2026-02-14 20:11:40 +00:00
Konstantin Seurer
be5ab80de1 vulkan/cmd_queue: Fixup stride for multi draws
Copying the draw infos packs them so the stride needs to be set to the
struct size.

cc: mesa-stable

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39881>
2026-02-14 20:11:40 +00:00
Konstantin Seurer
bf61736aa5 vulkan/cmd_queue: Remove get_array_member_copy
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39881>
2026-02-14 20:11:40 +00:00
Konstantin Seurer
d2ea8b3d14 vulkan: Remove vk_cmd_queue_entry::driver_data
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39881>
2026-02-14 20:11:39 +00:00
Konstantin Seurer
6dce207497 vulkan/cmd_queue: Use a linear allocator
This simplifies memory management a lot and should improve performance.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39859>
2026-02-13 10:29:42 +00:00
Dylan Baker
7f469f1963 vulkan/runtime: Tie vulkan log printing to debug option rather than buildtype
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This allows users of -Dbuildtype=debugoptimized, or who just set
-Ddebug=true, to get error messages. This is especially important for us
in the Intel CI, where we want these messages, but we also need to the
performance benefits of optimization.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39863>
2026-02-12 23:29:29 +00:00
Aitor Camacho
e6f118f12b wsi/metal: Expose additional color spaces if instance extension enabled
Caught through VVL test NegativeWsi.SwapchainImageFormatList. The test
would try to create a swapchain with a color space from
VK_EXT_swapchain_colorspace without enabling the extension. This is
because wsi would expose those color spaces even when the extension was
not enabled.

Fixes: fd045ac99c ("wsi/metal: add support for color spaces")

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/39797>
2026-02-12 19:24:45 +00:00