Commit Graph

204852 Commits

Author SHA1 Message Date
Faith Ekstrand
f3ba1e24b2 egl/wayland: Refuse to initialize Zink+DRM
Trying to use Zink with the DRM winsys is problematic at best.  In
theory all the pieces should be there but there are bugs around
synchronization, etc.  This copies the current behavior of X11 which
also refuses to initialize DRM on Zink.

This is particularly important for Nouveau users which are getting Zink
via the loader returning "zink" for get_driver_for_fd().  On Wayland
today, we go ahead and load zink and attempt to use the DRM EGL paths,
which are broken.  On X11, it fails to load the driver and then the EGL
device initialization code re-tries with zink which succeeds.  Because
the second try is using Zink from the start, it's equivalent to if the
user had set MESA_LOADER_DRIVER_OVERRIDE=zink and they get the kopper
path, which is more reliable.

This absolutely not what we want because it means we don't load the
driver the loader requested and are dependent on fallback paths to get a
driver loaded at all.  However, the real solution in
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36014
is too complex to backport.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13498
Acked-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36119>
2025-07-15 11:28:03 -04:00
Jose Maria Casanova Crespo
a81d0efaaa v3d: Fix depth resource invalidation with separate_stencil
If there is a separate stencil in use, the resource invalidation
flag was not being removed for the depth buffer as rsc was assigned
to the separate stencil.

Fixes: 6ff509593c ("v3d: Only apply TLB load invalidation on first job after FB state update")
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36030>
(cherry picked from commit 7d51a10cda)
2025-07-15 17:23:59 +02:00
Mel Henning
5d16bd56d9 nouveau/headers: Stop running rustfmt
rustfmt would change not only lib.rs, which is output by this script,
but also all of the other files in the library. The problem is, those
other files are inputs to lib_rs_gen so the script was changing its own
inputs which meant ninja needed to be run twice before we reached a
fixed point. Remove rustfmt for now to prevent this issue.

Fixes: 591b5da4 ("nouveau/headers: Run rustfmt on generated files")
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36121>
(cherry picked from commit 9b275cdbcc)
2025-07-15 17:23:59 +02:00
Olivia Lee
9e600d2c64 pan/shared: fix typo in pan_tiling doc comments
Fixes: 944049dedc ("panfrost: Document arguments to tiling routines")
Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36102>
(cherry picked from commit a59e3c6a8b)
2025-07-15 17:23:59 +02:00
Jordan Justen
38610fa518 intel/dev: Enable PTL PCI IDs (without INTEL_FORCE_PROBE)
Tested with:

commit 3a252ff9d8b6dc22b20463bfcb31a4e8992b0e8f
Merge: 9800bf6fae3b 11895f375939
Author: Simona Vetter <simona.vetter@ffwll.ch>
Date:   Fri Jul 11 11:25:34 2025 +0200

Backport-to: 25.1
Ref: drm/drm-next 3a252ff9d8b6dc22b20463bfcb31a4e8992b0e8f
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31893>
(cherry picked from commit 6dee0c3dae)
2025-07-15 17:23:59 +02:00
Jordan Justen
dafd704ac6 anv: Set Xe3 as supported
Backport-to: 25.1
Ref: 16a835ed3d ("anv: Drop "not yet supported" warning for Xe2")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31893>
(cherry picked from commit f19e2e69e9)
2025-07-15 17:23:59 +02:00
Faith Ekstrand
62d2825f11 loader: Report DRI_PRIME errors earlier
This needs devices[] in order to print an appropriate message but we
free it right after the loop.  Instead, print the error right away and
make the error case after the free just handle jumping to err.

Fixes: ea84b85887 ("loader: add DRI_PRIME_DEBUG env var")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36014>
(cherry picked from commit 9e1a1633c4)
2025-07-15 17:23:55 +02:00
Faith Ekstrand
2fb25103a5 zink/kopper: Don't recycle unused acquire semaphores
Fixes: e9f18f64b9 ("zink: also cache swapchain semaphores")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36014>
(cherry picked from commit 8d9675520f)
2025-07-15 16:19:58 +02:00
Patrick Lerda
70b193dc9b r600: fix rv770 border color
The border color of the rv770 gpu behaves the same way as
the evergreen border color. This change updates the software
accordingly.

This change is enabled for all the pre-evergreen gpus.

This change fixes 120 piglit tests. The rv770 ci is updated
as well.

Cc: mesa-stable
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34502>
(cherry picked from commit 5bee7c0b12)
2025-07-15 16:19:58 +02:00
Patrick Lerda
ac689f19b2 r600: set never as the depth compare function when depth compare is disabled
This is the backport of 0c0b978938 "radeonsi: set NEVER as
the depth compare func if depth compare is disabled".

The function r600_tex_compare arguments are updated with the "const"
keyword.

This change fixes the test below which was broken after 0c6e56c391:
khr-gl4[5-6]/incomplete_texture_access/sampler: fail pass

Fixes: 0c6e56c391 ("mesa: (more) correctly handle incomplete depth textures")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Acked-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35968>
(cherry picked from commit d9baadcfb5)
2025-07-15 16:19:58 +02:00
Samuel Pitoiset
beb1ae7603 radv/sdma: fix unaligned 96-bits copies on GFX9
On SDMA4, when the pitch isn't aligned, the width needs to be scaled
by 3 for 96-bits formats.

On SDMA5+, the pitch is aligned and the driver doesn't need to fallback
to unaligned copies.

CC: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36067>
(cherry picked from commit a51afbaff8)
2025-07-15 16:19:58 +02:00
Yiwei Zhang
9aeb5cac72 hasvk: avoid leaking private binding for aliased wsi image
This time for hasvk and is the same with
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35893

Aliased wsi image has to share the same private binding with the
original wsi image for memory consistency. If the private binding
exists, it needs to be released before being overridden.

Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36095>
(cherry picked from commit c647c422db)
2025-07-15 16:19:58 +02:00
Mike Blumenkrantz
09e4fc7696 zink: lock harder around memory mappings
this addresses an ancient race condition where unmapping memory
in one thread at the same time memory is mapped in a different thread
could proceed without synchronization and result in the second thread
writing to unmapped memory

this was the actual cause of #12533

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36076>
(cherry picked from commit 841080ed42)
2025-07-15 16:19:58 +02:00
David Rosca
047ffcc1e4 frontends/va: Fix leaking fences in GetImage/PutImage
When we need to perform format conversion, we use temporary surface
allocated with vlVaHandleSurfaceAllocate. If the driver requires
clearing the surface on allocation, it will create a fence that
must be destroyed later.

Fixes: 0f20a3a4f1 ("frontends/va: Add surface pipe_fence for vl_compositor rendering")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13198
Reported-by: Mariusz Białończyk <manio@skyboo.net>
Tested-by: Mariusz Białończyk <manio@skyboo.net>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36040>
(cherry picked from commit 2d6560611f)
2025-07-15 16:19:58 +02:00
Mike Blumenkrantz
1ab2d62819 zink: always create gfx shader objects with 5 descriptor layouts
these are separate shader objects

fixes VUID-vkCmdDraw*-None-08879

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36057>
(cherry picked from commit d6e89787ed)
2025-07-15 16:19:58 +02:00
Mike Blumenkrantz
5a1ecb9c3b zink: double-check descriptor layout creation before adding to cache
this can race against the background compile thread, so ensure that
no collisions happen

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36057>
(cherry picked from commit 39f45f2a04)
2025-07-15 16:19:58 +02:00
Samuel Pitoiset
d1fb5f12d3 radv: fix the maximum variable descriptor count with inline uniform blocks
It must not be larger than maxInlineUniformBlockSize.

Fixes recent VKCTS
dEQP-VK.api.maintenance3_check.support_count_inline_uniform_block*.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36044>
(cherry picked from commit b7f4e344bc)
2025-07-15 16:19:58 +02:00
Samuel Pitoiset
ed7d8e8b67 radv: fix indexing with variable descriptor count
The Vulkan spec says:
    "If bindingCount is zero or if this structure is not included in
     the pNext chain, the VkDescriptorBindingFlags for each descriptor
     set layout binding is considered to be zero. Otherwise, the
     descriptor set layout binding at
     VkDescriptorSetLayoutCreateInfo::pBindings[i] uses the flags in
     pBindingFlags[i]."

Fixes recent VKCTS dEQP-VK.api.maintenance3_check.*.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13503
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36044>
(cherry picked from commit 36879c4f99)
2025-07-15 16:19:58 +02:00
Qiang Yu
561f5dfb24 radeonsi: fix gfx11 ngg shader emit
Cc: mesa-stable
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35931>
(cherry picked from commit 09e6bc90ee)
2025-07-15 16:19:58 +02:00
Timothy Arceri
34bd7e6ecd glsl: fix reuse of deref
We can't reuse the deref or validation will get mad at us.

Fixes: 3da4b5eaa5 ("glsl: always copy bindless sampler packing constructors to a temp")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13464

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36038>
(cherry picked from commit bda89200ce)
2025-07-15 16:19:57 +02:00
Faith Ekstrand
81657e76df zink: Clean up file descriptor closing in export_dmabuf_semaphore()
First, we handle the case where GetMemoryFdKHR fails.  This is unlikely
and, if it's a Mesa driver it probably won't stomp the FD but we should
be extra careful.  Then, we can close the dma-buf file immediately after
we call drmIoctl() on it, ensuring we don't leak the dma-buf file
descriptor if drmIoctl() fails.  If ImportSemaphoreFdKHR() fails, then
we need to clean up the sync file.

Fixes: d4f8ad27f2 ("zink: handle implicit sync for dmabufs")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36048>
(cherry picked from commit de4224a57c)
2025-07-15 16:19:57 +02:00
Charlotte Pabst
3d2cea3c27 mesa: clear program info when updating program string
The program info contains all sorts of flags concerning the compilation state of
the program, and those need to be reset when the program is going to be recompiled
when its source changes.

For example, before this change, after info.flrp_lowered got set following the
first call to glProgramStringARB, flrp lowering would not happen for any subsequent
updates to the program string, leading to compilation failures.

Signed-off-by: Charlotte Pabst <cpabst@codeweavers.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35523>
(cherry picked from commit be6b49449c)
2025-07-15 16:19:57 +02:00
Mary Guillemard
c30e7b17d8 panvk: Fix wrong reporting of subgroup size for executable properties
Fixes: 563823c9ca ("panvk: Implement vk_shader")
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Caterina Shablia <caterina.shablia@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36006>
(cherry picked from commit d08a21b7a3)
2025-07-15 16:19:57 +02:00
Mary Guillemard
288610f06b pan/bi: Disallow FAU for CLPER in bi_check_fau_src
Previously this was allowing invalid forms like
"CLPER.i32.subgroup8.zero lane-id, src1" to reach bi_pack.

This fixes the assert that can be seen with
"dEQP-VK.glsl.derivate.dfdxsubgroup.*" but doesn't fix failures.

Fixes: 0acc6b564e ("pan/bi: Rework FAU lowering")
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36006>
(cherry picked from commit db5ad8e3d2)
2025-07-15 16:19:57 +02:00
Mary Guillemard
cb03929a21 pan/bi: Do not allow passthrough for instructions disallowing temps
Previously we were allowing passthrough to temps without using
bi_reads_temps.

This was causing instructions like CLPER to create undefined encodings.

We now check if the instruction support temps.

Fixes: 4252fb84f4 ("pan/bi: Add passthrough register rewriting helper")
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36006>
(cherry picked from commit 48d716a05f)
2025-07-15 16:19:57 +02:00
Timothy Arceri
a93ca06f28 util: add workaround for legacy OpenGL tf2
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3514
Fixes: a34cc97ca3 ("glsl: when NIR linker enable use it to resize uniform arrays")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36036>
(cherry picked from commit f617b4f850)
2025-07-15 16:19:57 +02:00
Vitaliy Triang3l Kuzmin
6f10f11854 r600: Fix rectangle coordinate limits on R6xx/R7xx
R6xx/R7xx use D3D10 15.8 fixed-point coordinates rather than 16.8.

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35953>
(cherry picked from commit 21136d931d)
2025-07-15 16:19:57 +02:00
Gorazd Sumkovski
878f37732f panfrost: Fix incorrect condition in assert
Since commit 8bb46de0, the correct way to check for a compute shader is
with `gl_shader_stage_is_compute()`.

Fixes: d2838f3c ("pan/bi: handle barriers with SUBGROUP scope")

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: John Anthony <john.anthony@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35957>
(cherry picked from commit 7bc1c456cb)
2025-07-15 16:19:57 +02:00
Mel Henning
6f0494869d egl: Clear modifiers if we clear use_flags
zink assumes that we won't pass modifiers without PIPE_BIND_SHARED

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13439
Cc: mesa-stable
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/36008>
(cherry picked from commit 295768c13e)
2025-07-15 16:19:57 +02:00
Daniel Stone
1dd1eaff75 vulkan: Remove build-system remnants of wl_drm support
We don't need to depend on the generated wl_drm files, as wl_drm support
was removed from Vulkan quite some time ago.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Fixes: e090316570 ("vulkan/wsi/wayland: drop support for wl_drm")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35885>
(cherry picked from commit 94b51503b3)
2025-07-15 16:19:57 +02:00
Yiwei Zhang
64d2cf1851 venus: allow to build vtest-only on non-DRM/KMS systems
The vtest backend doesn't require drm.

Backport-to: 25.1
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13420
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36017>
(cherry picked from commit d93840dc22)
2025-07-15 16:19:57 +02:00
Caleb Callaway
2c12fffef7 anv: Increase max VBs to 33 on Gen11+
Prior to Gen 11, we had to upload a bunch of SGVs
(FirstVertex, BaseVertex, BaseInstance, DrawID) via
3DSTATE_VERTEX_BUFFERS.

For Gen11+, we upload via 3DSTATE_SGVS_2 instead.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35376>
(cherry picked from commit 111005066d)
2025-07-15 16:19:57 +02:00
Mike Blumenkrantz
8cd9637aec lavapipe: fix advertised depth resolve modes
only sample0 is actually supported

Fixes: 07956bbcae ("lavapipe: VK_KHR_depth_stencil_resolve support")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36004>
(cherry picked from commit eed207e597)
2025-07-15 16:19:57 +02:00
Yiwei Zhang
f278cc38e6 anv: fix ANB gralloc usage query to not append display usage bits
The consumer of the Android surface may or may not be display. e.g. it
can also be a media encoder. When BufferQueue makes the allocation, it
takes the gralloc usage bits from both the client API (EGL/Vulkan) and
the consumer side.

Cc: mesa-stable
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35785>
(cherry picked from commit 8f4c938c1e)
2025-07-15 16:19:56 +02:00
Yiwei Zhang
4dfc5f4145 vulkan/android: fix to not append GRALLOC_USAGE_HW_COMPOSER bit
The composer usage bit is automatically added by the surface consumer
side when the consumer is SurfaceFlinger. e.g. if the swapchain is
connected with a media encoder surface, the consumer side would append
encoder usage bit instead.

Fixes: c406d53858 ("vulkan/android: Add common vkGetSwapchainGrallocUsage{2}ANDROID")
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35785>
(cherry picked from commit 495156079c)
2025-07-15 16:19:56 +02:00
Sviatoslav Peleshko
6af4598af4 brw/disasm: Fix Gfx11 3src-instructions dst register disassembly
The conversion from bit value to register file type is already done
by the brw_eu_inst_3src_a1_dst_reg_file in the FFC macro now, so doing it
again produced incorrect results.

Fixes: e7179232 ("intel/brw: Move encoding of Gfx11 3-src inside the inst helpers")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13141
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35960>
(cherry picked from commit 8d22eb960b)
2025-07-15 16:19:56 +02:00
Calder Young
53e87c6b47 iris: Fix issue with conditional dispatching
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35946>
(cherry picked from commit a39779e695)
2025-07-15 16:19:56 +02:00
Mel Henning
d6ef45b48b meson: Allow unnecessary_transmutes for bindgen
Otherwise I get hundreds of "unnecessary transmute" warnings
on rustc 1.88.0

Cc: mesa-stable
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: @LingMan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35874>
(cherry picked from commit b9a9f6cd53)
2025-07-15 16:19:56 +02:00
LingMan
d78e41e89c meson: Streamline silencing of warnings in bindgen generated code
Everyone was doing roughly the same.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34969>
(cherry picked from commit 3fbee8bae6)
2025-07-15 16:19:56 +02:00
Lionel Landwerlin
690b16d96c anv: do not rely on sampler objects for pipeline compilation
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>
(cherry picked from commit 67e452669e)
2025-07-15 16:19:56 +02:00
Lionel Landwerlin
658f29cef2 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>
(cherry picked from commit 98bc185376)
2025-07-15 16:19:56 +02:00
Marek Olšák
9a05d14e81 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>
(cherry picked from commit 9083e8b984)
2025-07-15 16:19:56 +02:00
Autumn Ashton
ff45036ed7 radv: Fix handling of NULL pColorAttachmentLocations in vkCmdSetRenderingAttachmentLocations
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>
(cherry picked from commit 1ceded0c83)
2025-07-15 16:19:56 +02:00
Konstantin Seurer
9ab7bbeb5d 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>
(cherry picked from commit d519f917e1)
2025-07-15 16:19:56 +02:00
Mike Blumenkrantz
9995630fbe 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>
(cherry picked from commit f335158cfa)
2025-07-15 16:19:56 +02:00
Patrick Lerda
2f59c310dc r600: fix emit_ssbo_store() wrmask compatibility
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>
(cherry picked from commit 9e5d11bff3)
2025-07-15 16:19:56 +02:00
Mike Blumenkrantz
929906a1b1 zink: fix submit_count disambiguation for bo usage checks
also improve docs for submit_count to avoid similar errors

Fixes: 61b0955308 ("zink: always check submit_count to disambiguate when checking/waiting")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35940>
(cherry picked from commit 3925e53efe)
2025-07-15 16:19:56 +02:00
Mike Blumenkrantz
232311722f zink: fix acquire semaphore sync
the semaphore stage is VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
so the src access barrier must also use this in order to ensure it happens
after the acquire

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35940>
(cherry picked from commit 69b5abee14)
2025-07-15 16:19:55 +02:00
Mike Blumenkrantz
625f22be13 zink: don't modify the u_foreach_bit64 bit inside the loop in loop_io_var_mask()
this breaks the macro and causes infinite loops on patch locations in release builds

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35922>
(cherry picked from commit ef0bf50ae9)
2025-07-15 16:19:55 +02:00
Erik Faye-Lund
47553ba5a0 panfrost: limit sample_shading to bifrost and later
We haven't wired this up in the Midgard compiler, so we can't expose
sample shading on Midgard GPUs. This all seems fixable, because the KILL
instruction can update the coverage without the kill-flag (yeah, a bit
confusing naming), but until someone puts in the time to wire up that,
let's just disable the functionality to avoid crashes.

Fixes: 6bba718027 ("panfrost: Advertise SAMPLE_SHADING")
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35881>
(cherry picked from commit 504e511c44)
2025-07-15 16:19:55 +02:00