Commit graph

2223 commits

Author SHA1 Message Date
Emma Anholt
61fb238a4d vulkan/wsi: Add comments about the WSI's syncing, and KHR_display stuff.
I have spent so long orienting myself in this code, more than once, that
it's time to leave some clues for next time.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19309>
2025-08-16 22:26:40 +00:00
Faith Ekstrand
1b2acf9006 vulkan: Drop implicit sync support
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This gets rid of the internal wsi_memory_signal_submit_info structure
used to indicate implicit sync through vkQueueSubmit() as well as the
handling in vk_queue.c and vk_device::create_sync_for_memory.  Nothing
is using any of this anymore.

Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36783>
2025-08-16 00:04:47 -04:00
Faith Ekstrand
16520cfdf1 vulkan/wsi: Stop setting wsi_memory_signal_submit_info
There are no longer any drivers implementing the back-end hooks for this
so there's no point in setting it from WSI.

Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36783>
2025-08-16 00:04:47 -04:00
Faith Ekstrand
9cf6f14b88 vulkan/wsi: Drop signal_fence/semaphore_with_memory
Intel was the only drivers setting this and how they don't so we can get
rid of the flag and the associated code.

Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36783>
2025-08-16 00:04:47 -04:00
Emma Anholt
9e61e72e9f vk/runtime: Set GPU_MULTI_WAIT on the drm syncobj type.
DRM syncobjs always let you wait repeatedly on them, so we can set the
flag in the core instead of having each driver override it once they try
to enable the emulated timeline semaphores.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36563>
2025-08-13 18:57:42 +00:00
Lionel Landwerlin
69a04151db vulkan/runtime: add ray tracing pipeline support
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/36757>
2025-08-13 12:01:49 +00:00
Lionel Landwerlin
daac500e98 vulkan/runtime: add a few more shader properties
Ray tracing pipelines can contain unlimited number of shaders unlike
compute/graphics ones. Having the driver finding the maximum
scratch/ray-query/stack usage can be time consumming when this can be
stored on the pipeline and the runtime tell the driver at bind time.

These fields are unused for other shaders and so drivers can ignore
them.

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/36757>
2025-08-13 12:01:49 +00:00
Sagar Ghuge
7b634ebb63 vulkan/runtime: Add VK_SHADER_CREATE_UNALIGNED_DISPATCH_BIT_MESA flag
Drivers that doesn't support direct unaligned dispatches, they can use
the shader creation flag to lower unaligned dispatches.

Suggested-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36245>
2025-08-12 23:17:02 +00:00
Sagar Ghuge
ba1ddb6b62 vulkan/radix_sort: Fix subgroup invocation id
When we have single subgroup within a workgroup, I guess we want to
index invocation within the subgroup, we don't want the ID of subgroup
within local workgroup, since it will be always 0.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36733>
2025-08-12 18:39:20 +00:00
Yiwei Zhang
1abe0d38d1 vulkan/util: update common properties code gen to use platform guard
Similar to the prior feature code gen update. This one here also absorbs
the Android private ANB struct.

Reviewed-by: Lucas Fryzek <lfryzek@igalia.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36702>
2025-08-12 18:12:50 +00:00
Yiwei Zhang
9999cd3967 vulkan/util: no need to hide ANB property itself behind Android
Property members are never going to use platform specific struct.
Getting rid of the guard around sharedImage propperty simplifies driver
side setting the prop.

Reviewed-by: Lucas Fryzek <lfryzek@igalia.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36702>
2025-08-12 18:12:50 +00:00
Yiwei Zhang
567cff487c vulkan/util: add missing vulkan header
Unlike features, property members do need Vulkan header. Currently it
relies on the fact that vk_physical_device.h has included some other
headers that include vulkan.h before this.

Cc: mesa-stable
Reviewed-by: Lucas Fryzek <lfryzek@igalia.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36702>
2025-08-12 18:12:50 +00:00
Lucas Fryzek
23d7c3fbd5 vulkan/util: update pd feature codegen to use platform guards
If a given physical device feature needs a platform specific define
guard, generate the appropriate one instead of just ignoring it.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36702>
2025-08-12 18:12:50 +00:00
Aaron Ruby
796e11008d vulkan/wsi: No commandPool allocation required for WSI_SWAPCHAIN_NO_BLIT
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
commandPools/cmdBuffers are only required for swapchain configurations
that use a blit-queue. They do not need to be allocated at all in the
"no blit" configuration.

There are some validUsage issues with the commandPool allocation, namely
that the WSI impl assumes that the logical device was created with all
queueFamilies made available to it. This is an invalid assumption that
can result in: VUID-vkCreateCommandPool-queueFamilyIndex-01937 invalid
usage on the eventual call to the driver. Note: invalid usage by WSI
wouldn't normally be detectable without virtualization.

This change reduces the scope of that invalid usage.

Reviewed-by: Gurchetan Singh <gurchetansingh@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36361>
2025-08-12 11:44:24 -04:00
Caterina Shablia
e6d2a426e6 vulkan/runtime: add vk_image_subresource_slice_count
vk_image_subresource_slice_count is useful when implementing image
barriers. When maintenance9 is enabled,
VkImageSubresourceRange::{baseArrayLayer,layerCount} specify the
slices, rather than layers, to transition. This helper returns
the number of slices specified in the subresource range, accounting
for the VK_REMAINING_ARRAY_LAYERS sentinel.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36176>
2025-08-12 12:43:10 +00:00
Faith Ekstrand
6ece4f3fa0 vulkan: Add a vk_video_session_finish() helper
It's always better if init/finish come in pairs.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36646>
2025-08-11 20:34:56 +00:00
Faith Ekstrand
8f03f9b443 vulkan: Add common VideoSessionParametersKHR entrypoints
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36646>
2025-08-11 20:34:56 +00:00
Faith Ekstrand
9d6f65db9a vulkan: Add handle casts for vk_video_session[_parameters]
This also allows us to simplify the interface to
vk_video_session_parameters_create().

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36646>
2025-08-11 20:34:56 +00:00
Faith Ekstrand
f8086c6472 vulkan/video: Switch vk_video_session_parameters to create/destroy
These are never created on the stack or deep inside other objects so it
makes sense to use create/destroy instead of init/finish.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36646>
2025-08-11 20:34:56 +00:00
Yiwei Zhang
d88fd2c582 vulkan/wsi/headless: clean up headless wsi device and headers
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Still keep the wsi_headless container in case of future customizations.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36687>
2025-08-10 07:16:46 +00:00
Yiwei Zhang
90caf9bdbd vulkan/wsi/headless: drop the wsi_create_null_image_mem override
The existing wsi code paths work in the most correct manner now w.r.t
implicit fencing, memory allocation, prime buffer blit, etc.

With this and the prior change, ANV with headless doubled the perf and
beats the windowed vkmark run.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36687>
2025-08-10 07:16:46 +00:00
Yiwei Zhang
6ac8ac38f1 vulkan/wsi/headless: acquire the most likely idle image
Previously the present marks the image free, and the next acquire would
immediately acquire the just presented image back, which likely still
has pending gpu work going on. To avoid introducing a present queue in
headless, we simply tweak to acquire swapchain images in a loop to give
the app the most likely idle image.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36687>
2025-08-10 07:16:46 +00:00
llyyr
dbb779967c vulkan: Update enum_to_str conversion to handle AMDX enum names
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Without this, mesa fails to build with:
src/vulkan/util/vk_enum_to_str.c:684:14: error:
‘VK_COMPRESSED_TRIANGLE_FORMAT_AMDX_MAX_ENUM’ undeclared (first use in
this function); did you mean
‘VK_COMPRESSED_TRIANGLE_FORMAT_MAX_ENUM_AMDX’?

Fixes: c74ad9f142 ("vulkan: Update headers/xml for 1.4.325")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36693>
2025-08-09 01:24:10 +00:00
Caio Oliveira
c74ad9f142 vulkan: Update headers/xml for 1.4.325
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36681>
2025-08-08 22:41:14 +00:00
Caio Oliveira
c00b167d16 vulkan: Update enum_to_str conversion to handle ARM enum names
Next Vulkan update will have
VK_DATA_GRAPH_PIPELINE_PROPERTY_MAX_ENUM_ARM and similar names,
so apply the same rule for ARM prefix.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36681>
2025-08-08 22:41:14 +00:00
Yiwei Zhang
5b1104476f vulkan/wsi/headless: drop redundant chain struct members
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Janne Grunau <j@jannau.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36658>
2025-08-08 16:34:26 +00:00
Yiwei Zhang
24cb071d47 vulkan/wsi/headless: allow explicit modifiers
When wsi device has modifier support, simply allow all driver supported
modifiers for the requested format.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12534
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13636
Reviewed-by: Janne Grunau <j@jannau.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36658>
2025-08-08 16:34:26 +00:00
Hyunjun Ko
609ef617c9 vulkan/video: align with spec correctly for h265 slice header.
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/36211>
2025-08-08 11:26:13 +00:00
Karol Herbst
fe09dfbcf3 vulkan: use p_atomic_read on vk_descriptor_set_layout::ref_cnt
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36652>
2025-08-08 10:26:52 +00:00
Konstantin Seurer
fe4c3dcab8 vulkan: Add MESA_VK_SHADER_STAGE_ALL
For masking invalid bits.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36371>
2025-08-07 20:46:24 +00:00
Simon Perretta
ba92104b56 wsi/display: make HDR_OUTPUT_METADATA, Colorspace properties optional
Fixes some dEQP-VK.wsi.display.* issues on platforms that don't
support said properties following their addition in !35461.

Fixes: b4176393a0 ("wsi/display: Implement VK_EXT_hdr_metadata on KHR_display swapchain")

Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36607>
2025-08-07 20:32:02 +01:00
Qiang Yu
196569b1a4 all: rename gl_shader_stage to mesa_shader_stage
It's not only for GL, change to a generic name.

Use command:
  find . -type f -not -path '*/.git/*' -exec sed -i 's/\bgl_shader_stage\b/mesa_shader_stage/g' {} +

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36569>
2025-08-06 10:28:40 +08:00
Qiang Yu
799806d85e all: rename PIPE_SHADER_MESH_TYPES to MESA_SHADER_MESH_STAGES
Use command:
  find . -type f -not -path '*/.git/*' -exec sed -i 's/\bPIPE_SHADER_MESH_TYPES\b/MESA_SHADER_MESH_STAGES/g' {} +

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36569>
2025-08-06 10:28:40 +08:00
Ernst Persson
2bdbc72d27 vulkan/util: Use str.removeprefix() from Python 3.9
Signed-off-by: Ernst Persson <ernstp@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36398>
2025-08-05 21:39:58 +00:00
Hyunjun Ko
b59552628e vulkan/video: fix to set ref_pic_list_modification_flag_l1 correctly
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/36152>
2025-08-05 09:16:56 +00:00
Hyunjun Ko
62b07c01d1 vulkan/video: fix to write a h264 slice header for CAVLC mode
In CAVLC mode, slice header doesn't need to be aligned. Instead
encoder needs exact bits written in the slice header in order to
set the offset correctly.

This fixes encoding with entropy_coding_mode_flag false.

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/36152>
2025-08-05 09:16:56 +00:00
David Rosca
94619a0f4b wsi/display: Add RGBA16, RGBA16F and A2RGB10(SRGB) formats
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35461>
2025-08-05 08:50:07 +00:00
David Rosca
d977951d64 wsi/display: Report supported formats based on plane formats
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35461>
2025-08-05 08:50:05 +00:00
Joshua Ashton
13137393f6 wsi/display: Expose HDR10 colorspace based on EDID
Uses libdisplay-info to parse the edid, grab the metadata and see
if HDR10 is supported by the display.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35461>
2025-08-05 08:50:05 +00:00
Joshua Ashton
1ed78dd7ec wsi/display: Clean up DRM hdr/color state on swapchain destruction
Reset our color outcome to defaults, and update the state.
We need to clean up after our mess, for any other compositors,
etc that come after us that may not be aware of properties
we have set.
We can do this by just setting ourselves back to sRGB and therefore
SDR and updating like normal.
We only need to do this if we have a color outcome serial that isn't
0, the default.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35461>
2025-08-05 08:50:05 +00:00
Joshua Ashton
b4176393a0 wsi/display: Implement VK_EXT_hdr_metadata on KHR_display swapchain
Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35461>
2025-08-05 08:50:05 +00:00
Joshua Ashton
b465d144ca wsi/common: Track VkColorSpaceKHR with wsi swapchain
Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35461>
2025-08-05 08:50:05 +00:00
Valentine Burley
1dfe5bbd09 vulkan/wsi/wayland: Enable 4444 formats
Expose 4444 formats when they are available.

Fixes dEQP-EGL.functional.*rgba4444* with zink on ANV.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36111>
2025-08-05 06:04:28 +00:00
Yiwei Zhang
83b9c13b6f Revert "android: moving HMI symbol to separate file"
This reverts commit 6c7f7e4953.

The original change wasn't properly reviewed and the rationale was
obscure. Meanwhile, it was for gfxstream Android frontend which was not
built in upstream mesa at all.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36532>
2025-08-01 23:44:49 +00:00
Antonio Ospite
ddf2aa3a4d build: avoid redefining unreachable() which is standard in C23
In the C23 standard unreachable() is now a predefined function-like
macro in <stddef.h>

See https://android.googlesource.com/platform/bionic/+/HEAD/docs/c23.md#is-now-a-predefined-function_like-macro-in

And this causes build errors when building for C23:

-----------------------------------------------------------------------
In file included from ../src/util/log.h:30,
                 from ../src/util/log.c:30:
../src/util/macros.h:123:9: warning: "unreachable" redefined
  123 | #define unreachable(str)    \
      |         ^~~~~~~~~~~
In file included from ../src/util/macros.h:31:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:456:9: note: this is the location of the previous definition
  456 | #define unreachable() (__builtin_unreachable ())
      |         ^~~~~~~~~~~
-----------------------------------------------------------------------

So don't redefine it with the same name, but use the name UNREACHABLE()
to also signify it's a macro.

Using a different name also makes sense because the behavior of the
macro was extending the one of __builtin_unreachable() anyway, and it
also had a different signature, accepting one argument, compared to the
standard unreachable() with no arguments.

This change improves the chances of building mesa with the C23 standard,
which for instance is the default in recent AOSP versions.

All the instances of the macro, including the definition, were updated
with the following command line:

  git grep -l '[^_]unreachable(' -- "src/**" | sort | uniq | \
  while read file; \
  do \
    sed -e 's/\([^_]\)unreachable(/\1UNREACHABLE(/g' -i "$file"; \
  done && \
  sed -e 's/#undef unreachable/#undef UNREACHABLE/g' -i src/intel/isl/isl_aux_info.c

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36437>
2025-07-31 17:49:42 +00:00
Antonio Ospite
b4c7d3a08e build: stop calling unreachable() without arguments
The unreachable(str) macro defined in src/util/macros.h is defined to
accept a literal string as an argument.

However the way it checks that the argument is a string literal, by
prepending an empty string where the argument is used, i.e.:

  #define unreachabel(str) assert(!"" str)

still allows users to call the macro with no arguments.

This is confusing, so pass an empty string to all invocations of
unreachable() for consistency.

This is done with the following command:

  git grep -l '[^_]unreachable();' -- "src/**" | sort | uniq | \
  while read file; \
  do \
    sed -e 's/\([^_]\)unreachable();/\1unreachable("");/g' -i "$file";
  done

This should not change the behaviour of the callers of unreachable() in
a meaningful way, but there will be some cosmetic consequence.

The changed invocations will now print:

  Assertion `!"" ""' failed.

instead of

  Assertion `!""' failed.

But this is also what happens for the invocations that do pass an
argument, for instance `unreachable("Invalid type")` currently prints:

  Assertion `!"" "Invalid type"' failed.

So all invocations now also have the same output style.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36437>
2025-07-31 17:49:40 +00:00
Sergii Ushakov
6c7f7e4953 android: moving HMI symbol to separate file
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
To support "surfaceless" builds on Android it is required to still have
HMI symbol exported by the library while no other android-specific code is
needed.

Reviewed-by: Gurchetan Singh <gurchetansingh@google.com>
Reviewed-by: Marcin Radomski <dextero@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36459>
2025-07-31 17:11:51 +00:00
David Rosca
2c3bb204a5 vulkan/video: Fix h265 level values
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
From spec:
"general_level_idc shall be set equal to a value of 30 times the level number."

Fixes: 8243145f02 ("vulkan/video: add a h265 level translator.")
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36285>
2025-07-31 10:08:05 +00:00
Konstantin Seurer
656acb96b0 vulkan/cmd_queue: Reorder memcpy in get_struct_copy
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Using the temporary variable for the memcpy makes sure they are always
used so the "(void)tmp_src123" can be removed.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36331>
2025-07-31 08:13:59 +00:00
Konstantin Seurer
d29f446aa3 vulkan/cmd_queue: Clean up generating copies
Using the builder makes it much easier to see what is happening and
fixes indentation in the process.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36331>
2025-07-31 08:13:58 +00:00