Lionel Landwerlin
f8cbc558db
vulkan/render_pass: fixup renderpasses barriers for 2D views of 3D images
...
With maintenance9 enabled
Spec clarification : https://gitlab.khronos.org/vulkan/vulkan/-/merge_requests/7629
Fixes: 595889018a ("anv: implement VK_KHR_maintenance9")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13669
Reviewed-by: Alyssa Anne Rosenzweig <alyssa.rosenzweig@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36624 >
2025-10-06 22:20:26 +00:00
Benjamin Cheng
5e297c7444
vulkan/video: Add vk_video_is_profile_supported()
...
This helper sanity-checks a VkVideoProfileInfoKHR to make sure it
represents a real profile corresponding to specific codec rules.
Reviewed-by: David Rosca <david.rosca@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37656 >
2025-10-06 21:27:47 +00:00
Natalie Vock
33099040a3
vulkan/bvh: Mark instances with NAN AABBs as inactive
...
They can never be hit, remove them from the BVH.
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37492 >
2025-10-01 14:27:15 +00:00
Aleksi Sapon
927f65caf3
vk: Fix MSVC warning C4189
...
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37638 >
2025-09-30 22:40:28 +00:00
Mary Guillemard
095f13109f
panvk, vk/meta: Move D/S sanitizing to panvk
...
In reality, only panvk rely on this and this breaks HK.
Signed-off-by: Mary Guillemard <mary@mary.zone >
Fixes: 42abf00f2b ("vulkan: Handle VK_IMAGE_VIEW_CREATE_DRIVER_INTERNAL_BIT_MESA automatically")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37631 >
2025-09-30 13:14:18 +00:00
Konstantin Seurer
dca33aa0a0
vulkan/vk_cmd_queue: Clone VkSampleLocationsInfoEXT extending VkRenderingInfo
...
This is used by the renderpass implementation but the Vulkan spec does
not say that VkSampleLocationsInfoEXT can extend VkRenderingInfo.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37603 >
2025-09-30 01:13:29 +00:00
Bas Nieuwenhuizen
00b8b571c6
device-select: Fix error check.
...
Fixes: 355b96413d ("egl/wayland: Move bind_wayland_display to legacy build option")
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13931
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37622 >
2025-09-29 17:19:34 +02:00
Boris Brezillon
27988e9848
vk/meta: Support DS <-> color copies
...
VK_KHR_maintenance8 allows such copies, but there are a few things we
need to fix to support the case where the destination and source aspects
don't match.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com >
Tested-by: Mary Guillemard <mary.guillemard@collabora.com >
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37473 >
2025-09-29 13:59:30 +02:00
Aleksi Sapon
583526ba2c
wsi/metal: fix cleanup on swapchain image creation failure
...
Reviewed-by: Lucas Fryzek <lfryzek@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33779 >
2025-09-26 20:59:35 +00:00
Aleksi Sapon
fd045ac99c
wsi/metal: add support for color spaces
...
Reviewed-by: Lucas Fryzek <lfryzek@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33779 >
2025-09-26 20:59:35 +00:00
Aleksi Sapon
f022754647
wsi/metal: move VkFormat -> MTLPixelFormat conversion to wsi_common_metal_layer.m
...
Reviewed-by: Lucas Fryzek <lfryzek@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33779 >
2025-09-26 20:59:34 +00:00
Konstantin Seurer
9094b404d5
vulkan/cmd_queue: Handle struct arrays with pNext
...
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37416 >
2025-09-26 17:27:32 +00:00
Konstantin Seurer
c76da351b0
vulkan/cmd_queue: Handle internal structs
...
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37416 >
2025-09-26 17:27:32 +00:00
Konstantin Seurer
b02ef48e9d
vulkan/cmd_queue: Remove unused variable
...
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37416 >
2025-09-26 17:27:31 +00:00
Yiwei Zhang
2ea551e85a
vulkan/util: drop workaround for ANB struct
...
VkPhysicalDevicePresentationPropertiesANDROID now properly extends
VkPhysicalDeviceProperties2.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37590 >
2025-09-26 14:02:53 +00:00
Mike Blumenkrantz
0dc5caec36
vulkan: update spec to 1.4.328
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37590 >
2025-09-26 14:02:52 +00:00
Hans-Kristian Arntzen
59278c2236
anti-lag: Do not enable layer by default.
...
There are too many reports of instability in the wild,
even in scenarios where anti-lag isn't really being actively used,
making it questionable to load the layer by default.
By using enable_environment, a certain environment variable
must be set for loader to consider loading the layer.
This could be removed once the layer stabilizes.
Cc: mesa-stable
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no >
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37509 >
2025-09-26 13:29:38 +00:00
Hyunjun Ko
84802cf325
vulkan/video: fix misuse of CLAMP in h265 slice parsing.
...
Fixes: 7998106355 ("vulkan/video: Fix wrong parsing for H265 decoding")
Signed-off-by: Hyunjun Ko <zzoon@igalia.com >
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37412 >
2025-09-26 12:27:59 +00:00
Hyunjun Ko
23c98417ae
vulkan/video: fix h265 encoding with LT enabled.
...
Signed-off-by: Hyunjun Ko <zzoon@igalia.com >
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37412 >
2025-09-26 12:27:59 +00:00
Hyunjun Ko
896f95a37e
vulkan/video: fix h265 decoding with LT enabled.
...
Signed-off-by: Hyunjun Ko <zzoon@igalia.com >
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37412 >
2025-09-26 12:27:58 +00:00
Antonio Ospite
613bfe0b8b
device-select: fix build errors on some stricter build configurations
...
After commit 45eb3bfd32 (device-select: only try wayland/x11 if the
required vars are set, 2024-10-18), building `device_select_layer.c` can
results in compiler errors on some stricter build configurations
(-Werror,-Wunused-variable):
-----------------------------------------------------------------------
../src/vulkan/device-select-layer/device_select_layer.c:149:9: error: unused variable 'has_wayland' [-Werror,-Wunused-variable]
149 | bool has_wayland = getenv("WAYLAND_DISPLAY") || getenv("WAYLAND_SOCKET");
| ^~~~~~~~~~~
../src/vulkan/device-select-layer/device_select_layer.c:150:9: error: unused variable 'has_xcb' [-Werror,-Wunused-variable]
150 | bool has_xcb = !!getenv("DISPLAY");
| ^~~~~~~
2 errors generated.
-----------------------------------------------------------------------
So guard the declarations of the `has_wayland` and `has_xcb` variables
behind `VK_USE_PLATFORM_WAYLAND_KHR` and `VK_USE_PLATFORM_XCB_KHR`
respectively, just like the user code.
Note: the declarations are still kept outside of the loop body, in order
to assign the variables once and for all.
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37571 >
2025-09-25 16:36:35 +00:00
Faith Ekstrand
0f7e0f79ad
vulkan/queue: Move shared binary semaphores to temps
...
If a client creates a semaphore, exports it, and then re-imports it back
into the device, this can trick our semaphore reset logic. When this
happens, we end up with two different vk_sync structs that have the same
underlying payload so if one is used as the signal and one is used as
the wait of the same submit, we'll end up resetting it because we think
they're different, causing us to lose the signal.
We already have the ability to handle this for the threaded case by
moving the semaphore payload into a new vk_sync which we then destroy
after we're done submitting to the driver. Use this path for shared
semaphores in the immediate case so we can just wait and signal without
worrying about the reset.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13805
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37149 >
2025-09-24 20:38:13 +00:00
Simon Perretta
6e3573127c
vulkan/runtime: only set shader subgroup info if non-zero
...
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com >
Fixes: 67c4b762a5 ("vulkan: setup max_subgroup_size for drivers without var...")
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37533 >
2025-09-24 09:14:38 +00:00
Pierre-Eric Pelloux-Prayer
1b23a2ba80
util, vulkan: use u_overflow.h
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37331 >
2025-09-23 09:09:55 +02:00
Simon Perretta
67c4b762a5
vulkan: setup max_subgroup_size for drivers without varying/max/min size support
...
Ensures max_subgroup_size is set to the subgroupSize physical device
property on drivers that don't support VK_EXT_shader_object,
VK_EXT_subgroup_size_control, or Vulkan 1.3.
Fixes: d807f5a351 ("vulkan: set nir subgroup size shader info")
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com >
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37477 >
2025-09-19 20:51:15 +00:00
Eric Engestrom
bbb76517ee
meson: only require glslang >= 12.2 when anv/radv/turnip are built
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37444 >
2025-09-18 19:07:10 +00:00
Konstantin Seurer
ea51a67996
vulkan/bvh: Enable glsl extensions in meson
...
Having a list of all enabled/used extensions in meson allows us to get
rid of a lot of boilerplate in every bvh build shader.
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35326 >
2025-09-16 20:18:01 +00:00
Frank Binns
692893705f
pvr: support VK_FORMAT_R8G8_SSCALED for vertex attribs
...
Signed-off-by: Frank Binns <frank.binns@imgtec.com >
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412 >
2025-09-16 18:26:31 +00:00
Valentine Burley
92623d2447
imgui: Silence build warnings for imgui
...
Avoid treating any warnings as errors in the third-party imgui code, and
use Wno-error=stringop-overflow for code in Mesa.
Suggested-by: @eric
Signed-off-by: Valentine Burley <valentine.burley@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35853 >
2025-09-16 06:16:19 +00:00
Georg Lehmann
2ac5641473
shader_info: remove gl_subgroup_size enum
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Acked-by: Timur Kristóf <timur.kristof@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37258 >
2025-09-12 21:05:17 +00:00
Georg Lehmann
d807f5a351
vulkan: set nir subgroup size shader info
...
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37258 >
2025-09-12 21:05:17 +00:00
Hans-Kristian Arntzen
83bf75e307
anti-lag: Don't force enable every supported feature on device creation.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no >
Fixes: 722ffe9a73 ("vulkan: implement VK_AMD_anti_lag as implicit vulkan layer")
Cc: mesa-stable
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37137 >
2025-09-12 19:50:14 +00:00
Konstantin Seurer
7c9e945460
radv,vulkan: Avoid a useless barrier in radv_update_bind_pipeline
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36982 >
2025-09-10 08:35:50 +00:00
Konstantin Seurer
850f339b89
vulkan: Add more detail to encode debug markers
...
Useful for radv because radv has quite a few different configurations.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36982 >
2025-09-10 08:35:50 +00:00
Konstantin Seurer
5c94e20abe
vulkan: Use a struct for debug markers
...
Improves u_trace integation with anv.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36982 >
2025-09-10 08:35:50 +00:00
Lionel Landwerlin
febe90e109
vulkan: remove incorrect assert
...
You can have a group with 0 shaders in it.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Fixes: 69a04151db ("vulkan/runtime: add ray tracing pipeline support")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13858
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37249 >
2025-09-09 13:34:05 +00:00
Yonggang Luo
773a7f347a
clang-format: Update the .clang-format files to conformance clang-format json-schema
...
The document is at
https://clang.llvm.org/docs/ClangFormatStyleOptions.html
The json-schema at
https://www.schemastore.org/clang-format.json
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37235 >
2025-09-09 07:04:55 +00:00
Faith Ekstrand
6eac1cefd9
vulkan/wsi/x11: Use mesa_logX() instead of fprintf()
...
We have a logging framework. We should use it. This way we can shut
these warnings off in CI if we want to.
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Reviewed-by: Eric Engestrom <eric@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37203 >
2025-09-08 21:28:10 +00:00
Lars-Ivar Hesselberg Simonsen
e6dae6ef5f
vulkan: Optimize implicit end_subpass barrier
...
Rather than adding an implicit barrier on the last subpass
unconditionally, track in what subpasses attachments are used for the
last time and only add dependencies if none exist and there might be an
image transition.
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36985 >
2025-09-08 16:54:06 +00:00
Lars-Ivar Hesselberg Simonsen
eccc198284
vulkan: Optimize implicit begin_subpass barrier
...
Rather than adding an implicit barrier on the first subpass
unconditionally, track in what subpasses attachments are used for the
first time and only add dependencies if none exist and there might be an
image transition.
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36985 >
2025-09-08 16:54:06 +00:00
Lars-Ivar Hesselberg Simonsen
c0def2cf27
vulkan: Add transition_view_mask calculation
...
Refactor out a function to calculate the view mask for required layout
transitions. This will be used in the following commits.
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36985 >
2025-09-08 16:54:06 +00:00
Lars-Ivar Hesselberg Simonsen
067305e4c6
vulkan: Find first_subpass when creating renderpass
...
Like last_subpass, add a per-view mask of what subpass first uses an
attachment. This is required for optimizing out some barriers later.
Note that this requires us to do another loop over the subpasses.
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36985 >
2025-09-08 16:54:06 +00:00
Lars-Ivar Hesselberg Simonsen
3bad2ae069
vulkan: Stop combining subpass dependencies
...
Rather than OR-ing all subpass dependencies together in the Vulkan layer,
pass an array of barriers down to the drivers and allow them to do the
OR-ing if needed.
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36985 >
2025-09-08 16:54:05 +00:00
David Rosca
a758273231
vulkan/format: Map VK_EXT_ycbcr_2plane_444_formats to pipe format
...
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37174 >
2025-09-08 11:59:36 +00:00
Faith Ekstrand
446d5ef103
vulkan: Drop the driver_internal from vk_image_view_init/create()
...
It alwways comes in through the create flags now.
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36957 >
2025-09-05 23:34:14 +00:00
Faith Ekstrand
42abf00f2b
vulkan: Handle VK_IMAGE_VIEW_CREATE_DRIVER_INTERNAL_BIT_MESA automatically
...
This moves the bit into vk_image.h and handles it automatically in
vk_image_view_init() so drivers don't have to.
This also means that Meta is now hitting the driver_internal path for
all its images so we need to do the same format fixups there that we
sould normally do on the !driver_internal path. We don't want to do
them unconditionally because v3dv and other drivers override
depth/stencil color formats and we don't want to break that.
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36957 >
2025-09-05 23:34:11 +00:00
Faith Ekstrand
e7b0cbdf40
vulkan/meta: Always set VK_IMAGE_VIEW_CREATE_DRIVER_INTERNAL_BIT_MESA
...
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36957 >
2025-09-05 23:34:11 +00:00
Karol Herbst
083a3dc545
util: move typed_memcpy into macros.h
...
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37135 >
2025-09-05 20:01:00 +00:00
Hans-Kristian Arntzen
fa486a0346
anti-lag: Fix stype for submit2 semaphores.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no >
Fixes: 722ffe9a73 ("vulkan: implement VK_AMD_anti_lag as implicit vulkan layer")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37159 >
2025-09-05 08:14:28 +00:00
Olivia Lee
5faa62f91e
vulkan/util: add vk_topology_to_mesa helper function
...
Something like this already exists in a few drivers, move it to common
code. This specific version was pulled from honeykrisp, which is the
only one that handles META_RECT_LIST_MESA.
Signed-off-by: Olivia Lee <olivia.lee@collabora.com >
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37038 >
2025-09-03 22:04:14 -07:00