Commit graph

217869 commits

Author SHA1 Message Date
Alyssa Milburn
7b5e16fb05 nv50,nvc0: Avoid uninitialized cbuf reads in blits
Overwrite the whole framebuffer cbuf rather than copying it from the
stack; fixes util_framebuffer_get_num_samples getting uninitialized
stack contents during validation.

Suggested-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Signed-off-by: Alyssa Milburn <amilburn@zall.org>
Fixes: 2eb45daa9c ("gallium: de-pointerize pipe_surface")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14082
(cherry picked from commit a6992c7bbe)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:33 +02:00
Icenowy Zheng
b26748a918 pco: fix encoding of fred's s0abs bit
The s0abs bit in the encoing of fred instruction is wrongly set to the
status of .neg modifier instead of .abs modifier.

Fix this copy-n-paste error.

Fixes GLCTS tests when running on top of Zink:
dEQP-GLES2.functional.shaders.random.trigonometric.vertex.4
dEQP-GLES2.functional.shaders.random.trigonometric.vertex.45
dEQP-GLES2.functional.shaders.random.trigonometric.fragment.4
dEQP-GLES2.functional.shaders.random.trigonometric.fragment.45

Fixes: 8ec174b3f9 ("pco: add support for various selection, complex, trig ops")
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Reviewed-by: Simon Perretta <simon.perretta@imgtec.com>
(cherry picked from commit 54860bb4c7)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:33 +02:00
Pierre-Eric Pelloux-Prayer
dfa0f6706d gallium/u_blitter: add a new fs_color_clear variant
The referenced commit switched from a passthrough shader
to fs_clear_color[write_all_cbufs=0]. It shouldn't matter since
the shader isn't supposed to be executed - it's only setup to get
the first color output active.

On some chips (gfx8) it seems to cause issues (hangs or page fault)
for some piglit tests, eg:
  framebuffer-blit-levels draw stencil

To fix this, introduce a 3rd variant, where a constant buffer isn't
required and instead the color is hardcoded in the shader.

Fixes: ca09c173f6 ("gallium/u_blitter: remove UTIL_BLITTER_ATTRIB_COLOR, use a constant buffer")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 2ff9fa8b72)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:33 +02:00
Erik Faye-Lund
e406a5bbd7 panvk: remove unused flag
This flag isn't used any more, so let's remove all references to it.

Fixes: e25064c026 ("panvk: Use indirect path for indexed draw on JM")
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
(cherry picked from commit 5b8ebb8553)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:33 +02:00
juntak0916
f8d492ccc3 nvk: fix BindImageMemory2 per-bind status result
The per-bind status was always being set to VK_SUCCESS instead of the
actual result from nvk_bind_image_memory.

Fixes: 93792b5ef2 ("nvk: Add static wrappers for image/buffer binding")
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
(cherry picked from commit dd3e153a10)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:33 +02:00
Job Noorman
e2e2dc6bf7 ir3/legalize: don't drop sync flags on removed predt/predf
When a predt/predf branch can be removed, any sync flags set on the
terminator were removed as well. Fix this by copying these flags to the
prede that replaces the terminator.

Fixes frame instability in "Devil May Cry 5" and "Resident Evil 3".

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Fixes: 39088571f0 ("ir3: add support for predication")
(cherry picked from commit b2a44da9e9)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:33 +02:00
Jose Maria Casanova Crespo
b640985aab broadcom/common: fix V3D 7.1 TFU ICFG IFORMAT values
The V3D 7.1 TFU ICFG register restructured the IFORMAT field to 3 bits
(25:23) vs 4 bits on V3D 4.2. The defines were still using the V3D 4.2
encoding (11-15) which overflows the 3-bit field. Fix values to the
correct 3-7 range.

This was working by accident because the overflow bits land in the
SVTWID field, which is not used for the affected tiling formats.

Also rename SAND_128 to SAND since V3D 7.1 has a single SAND input
format; the tile width is now controlled by SVTWID.

Fixes: 146ceadcf4 ("v3dv: add support for TFU jobs in v71")
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
(cherry picked from commit 89229f08bb)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:33 +02:00
Valentine Burley
8c2283df41 ci: Drop duplicate Intel shader-db run
Skylake is the default device for the Intel shim, and it's already
included in the four Intel families listed below.

Fixes: 183d57aa9e ("ci: Run intel shader-db on Haswell, Broadwell, and Meteorlake")
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
(cherry picked from commit 9dd0f19198)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:33 +02:00
Ian Romanick
efc9ad3986 brw: Handle scalars and swizzles correctly in is_const_zero
v2: Massive simplification based on feedback from Ken.

Fixes: 96cde9cc01 ("intel/fs: Emit better code for bfi(..., 0)")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit dff1e8ae28)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:33 +02:00
Ian Romanick
29a5d22049 brw/algebraic: Allow mixed types in saturate constant folding
Prevents assertion failures in func.shader-ballot.basic.q0 and other
tests starting with "nir/algebraic: Optimize some b2f of integer
comparison".

Vector immediates, bfloat, and 8-bit floats are still not supported.

v2: Almost complete re-write based on suggestions from Ken.

v3: Don't retype() on a brw_imm_f value.

Fixes: f8e54d02f7 ("intel/compiler: Relax mixed type restriction for saturating immediates")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 985ace332b)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:33 +02:00
Marek Olšák
6416837667 radeonsi: recompute IO bases after optimizations
to fix an assertion added by the commit, reproduced by viewperf13/catia

Fixes: d06616063c - radeonsi: assert that IO bases don't have holes & the same base isn't used twice

Reviewed-by: Pierre-Eric
(cherry picked from commit 8ea3d794fb)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:33 +02:00
Radu Costas
9257997e3e pco: Amend errant nir_move_option
Move options were bit or-ing from the wrong enum, causing undefined
behaviour when the number of intrinsics changed.
Replaced it with the values from the right nir_move_options enum that
were previously working. (Further refinement needed on these after
extensive testing.)

Fixes: f1b24267d2 ("pco: rework nir processing and passes")
Signed-off-by: Radu Costas <radu.costas@imgtec.com>
Reviewed-by: Simon Perretta <simon.perretta@imgtec.com>
(cherry picked from commit 721c1b8f65)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:33 +02:00
pal1000
9c45a18af7 util: Fix use of undeclared identifier 'NULL' in src/util/os_misc.h when compiling with clang
Fixes: 2771eb39fd ("util: Add function os_unset_option/os_set_option for latter use")

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14805

```
FAILED: [code=1] src/util/libmesa_util.a.p/u_process.c.obj
"cc" "-Isrc/util/libmesa_util.a.p" "-Isrc/util" "-I../../src/util" "-Iinclude" "-I../../include" "-Isrc" "-I../../src" "-Isrc/util/format" "-I../../src/util/format" "-IC:/msys64/clang64/bin/../include" "-fvisibility=hidden" "-fdiagnostics-color=always" "-D_FILE_OFFSET_BITS=64" "-Wall" "-Winvalid-pch" "-std=c11" "-O2" "-g" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DPACKAGE_VERSION=\"26.0.0-rc3\"" "-DPACKAGE_BUGREPORT=\"https://gitlab.freedesktop.org/mesa/mesa/-/issues\"" "-DHAVE_OPENGL=1" "-DHAVE_OPENGL_ES_1=1" "-DHAVE_OPENGL_ES_2=1" "-DHAVE_SOFTPIPE" "-DHAVE_LLVMPIPE" "-DHAVE_ZINK" "-DHAVE_D3D12" "-DHAVE_VIRGL" "-DHAVE_SWRAST" "-DMESA_SYSTEM_HAS_KMS_DRM=0" "-DVIDEO_CODEC_VC1DEC=1" "-DVIDEO_CODEC_H264DEC=1" "-DVIDEO_CODEC_H264ENC=1" "-DVIDEO_CODEC_H265DEC=1" "-DVIDEO_CODEC_H265ENC=1" "-DVIDEO_CODEC_AV1DEC=1" "-DVIDEO_CODEC_AV1ENC=1" "-DVIDEO_CODEC_VP9DEC=1" "-DVIDEO_CODEC_MPEG12DEC=1" "-DVIDEO_CODEC_JPEGDEC=1" "-DHAVE_WINDOWS_PLATFORM" "-DHAVE_SURFACELESS_PLATFORM" "-DUSE_LIBGLVND=0" "-DUSE_D3D12_PREVIEW_HEADERS=0" "-DHAVE_GALLIUM_D3D12_VIDEO" "-DHAVE_VA_SURFACE_ATTRIB_DRM_FORMAT_MODIFIERS" "-DGLAPI_EXPORT_PROTO_ENTRY_POINTS=1" "-DALLOW_KCMP" "-DMESA_DEBUG=0" "-DHAVE___BUILTIN_BSWAP32" "-DHAVE___BUILTIN_BSWAP64" "-DHAVE___BUILTIN_CLZ" "-DHAVE___BUILTIN_CLZLL" "-DHAVE___BUILTIN_CTZ" "-DHAVE___BUILTIN_EXPECT" "-DHAVE___BUILTIN_FFS" "-DHAVE___BUILTIN_FFSLL" "-DHAVE___BUILTIN_POPCOUNT" "-DHAVE___BUILTIN_POPCOUNTLL" "-DHAVE___BUILTIN_UNREACHABLE" "-DHAVE___BUILTIN_TYPES_COMPATIBLE_P" "-DHAVE___BUILTIN_ADD_OVERFLOW" "-DHAVE_FUNC_ATTRIBUTE_CONST" "-DHAVE_FUNC_ATTRIBUTE_FLATTEN" "-DHAVE_FUNC_ATTRIBUTE_MALLOC" "-DHAVE_FUNC_ATTRIBUTE_PURE" "-DHAVE_FUNC_ATTRIBUTE_UNUSED" "-DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT" "-DHAVE_FUNC_ATTRIBUTE_WEAK" "-DHAVE_FUNC_ATTRIBUTE_FORMAT" "-DHAVE_FUNC_ATTRIBUTE_PACKED" "-DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL" "-DHAVE_FUNC_ATTRIBUTE_ALIAS" "-DHAVE_FUNC_ATTRIBUTE_NORETURN" "-DHAVE_FUNC_ATTRIBUTE_COLD" "-DHAVE_FUNC_ATTRIBUTE_VISIBILITY" "-DHAVE_UINT128" "-D_WIN32_WINNT=0x0A00" "-DWINVER=0x0A00" "-D_GNU_SOURCE" "-DUSE_SSE41" "-DHAVE___BUILTIN_IA32_CLFLUSHOPT" "-DUSE_GCC_ATOMIC_BUILTINS" "-DHAS_SCHED_H" "-DHAVE_DLFCN_H" "-DHAVE_CET_H" "-DHAVE_STRTOF" "-DHAVE_STRTOK_R" "-DHAVE_QSORT_S" "-DHAVE_STRUCT_TIMESPEC" "-DHAVE_ZLIB" "-DHAVE_ZSTD" "-DHAVE_COMPRESSION" "-DWIN32_LEAN_AND_MEAN" "-DWINDOWS_NO_FUTEX" "-DMESA_LLVM_VERSION_STRING=\"21.1.8\"" "-DLLVM_IS_SHARED=0" "-DDRAW_LLVM_AVAILABLE=1" "-DAMD_LLVM_AVAILABLE=1" "-DGALLIVM_USE_ORCJIT=0" "-DHAVE_SPIRV_TOOLS" "-DUSE_LIBELF" "-DTHREAD_SANITIZER=0" "-DHAVE_RENDERDOC_INTEGRATION=false" "-Werror=implicit-function-declaration" "-Werror=missing-prototypes" "-Werror=return-type" "-Werror=empty-body" "-Werror=incompatible-pointer-types" "-Werror=int-conversion" "-Wimplicit-fallthrough" "-Wmisleading-indentation" "-Wno-missing-field-initializers" "-Wno-format-truncation" "-fno-math-errno" "-fno-trapping-math" "-Qunused-arguments" "-fno-common" "-Wno-unknown-pragmas" "-Wno-microsoft-enum-value" "-Wno-unused-function" "-Werror=thread-safety" "-ffunction-sections" "-fdata-sections" "-pipe" "-Wp,-D_FORTIFY_SOURCE=2" "-fstack-protector-strong" "-Wp,-D__USE_MINGW_ANSI_STDIO=1" "-march=core2" "-Werror=pointer-arith" "-Werror=vla" "-Werror=gnu-empty-initializer" "-Wgnu-pointer-arith" -MD -MQ src/util/libmesa_util.a.p/u_process.c.obj -MF "src/util/libmesa_util.a.p/u_process.c.obj.d" -o src/util/libmesa_util.a.p/u_process.c.obj "-c" ../../src/util/u_process.c
In file included from ../../src/util/u_process.c:28:
../../src/util/os_misc.h:151:24: error: use of undeclared identifier 'NULL'
  151 |    os_set_option(name, NULL, true);
      |                        ^~~~
1 error generated.

```
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
(cherry picked from commit 128dc57436)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:32 +02:00
Faith Ekstrand
97105a1526 nir: Consider if uses in nir_def_all_uses_*
They check for if uses and want to return false but nir_foreach_use()
means the if uses are never seen.

Cc: mesa-stable
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
(cherry picked from commit 3f870d62b0)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:32 +02:00
Georg Lehmann
6462dac37d gallivm: don't optimize fadd(a, 0.0) with signed zero preserve
Fixes: 540e84bedb ("gallivm: Preserve -0 and nan")
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
(cherry picked from commit 284b4143f7)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:32 +02:00
Pierre-Eric Pelloux-Prayer
d5f9f12123 radeonsi: account for outputs_written when updating spi_shader_col_format
Variants can modify which outputs get written so we must update
these fields otherwise spi_shader_col_format will be incorrect.

This can happen for instance with uniforms inlining:

   uniform bool depth_only;
   void main() {
      if (depth_only) return;
      ...
   }

When depth_only is true, this shader becomes empty after uniforms
inlining but spi_shader_col_format wasn't updated properly,
causing a hang.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14737
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 88986dcc9c)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:32 +02:00
Pierre-Eric Pelloux-Prayer
a21f8ddf3d radeonsi: move spi_shader_*_format to si_shader_variant_info
Variants can affect theses value so it's best to store them
in this struct.

No functional changes.

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit da7c515783)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:32 +02:00
Ryan Zhang
57ef28bbde panvk: trivial fix to remove repeated assignment
Fixes: c0d9827 ("panvk: Use WB mappings for the global RW and executable memory pools")

Signed-off-by: Ryan Zhang <ryan.zhang@nxp.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
(cherry picked from commit 760ac320be)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:32 +02:00
kingstom.chen
5d8b53beea radv/rt: only run move_rt_instructions() for CPS shaders
move_rt_instructions() only makes sense for CPS recursive shaders, where
later rt_trace_ray calls can overwrite the current shader's RT system
values.

Running it on the function-call path can hoist load_hit_attrib_amd
above merged intersection writes, which corrupts any-hit
hitAttributeEXT. Move the pass into the existing CPS-only
non-intersection branch before nir_lower_shader_calls().

Fixes: c5d796c902 ("radv/rt: Use function call structure in NIR lowering")
Closes: #15074

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
(cherry picked from commit 5a7f4c62d8)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:32 +02:00
Valentine Burley
bb0c3b12b9 tu/drm/virtio: Fix GEM handle leak on failed dmabuf res_id lookup
When vdrm_handle_to_res_id fails in virtio_bo_init_dmabuf, the handle
obtained from vdrm_dmabuf_to_handle was leaked.
Closing the handle is safe despite the lack of vdrm refcounting
because dma_bo_lock is held and already-imported BOs return early.
At this point, we are the sole holder of the handle.

While here, use the local vdrm variable consistently.

Fixes: 6ca192f586 ("turnip: virtio: fix iova leak upon found already imported dmabuf")
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
(cherry picked from commit f2c89f0188)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:32 +02:00
Valentine Burley
e984faec26 tu/drm/virtio: Fix GEM handle leak in tu_bo_init error path
In tu_bo_init, if growing the submit BO list fails, the GEM handle
must be closed. However, bo->gem_handle is only populated later
via compound assignment. Use the gem_handle parameter directly
to ensure the correct handle is closed and not leaked.

Fixes: d67d501af4 ("tu/drm/virtio: Switch to vdrm helper")
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
(cherry picked from commit 316d9b0209)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:32 +02:00
Valentine Burley
9ca275f29a tu/drm/virtio: Do not free iova from heap for lazy BOs
When initializing a BO using a lazy VMA, the iova is provided by
the sparse VMA and was not allocated from the device's VMA heap.
Avoid calling util_vma_heap_free in the error path for such BOs
to prevent heap corruption and potential double-frees.

Fixes: 88d001383a ("tu: Add support for a "lazy" sparse VMA")
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
(cherry picked from commit eb7897f57b)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:32 +02:00
Valentine Burley
b6640c1609 tu/drm/virtio: Avoid freeing zombified tu_sparse_vma
This is d3cedd2fa5 ("tu/drm: msm's has_set_iova codepath should avoid
freeing zombified tu_sparse_vma") but for virtio.

Fixes: 764b3d9161 ("tu: Implement transient attachments and lazily allocated memory")
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
(cherry picked from commit f1366ca144)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:32 +02:00
Valentine Burley
2aa33f41e6 tu/drm/virtio: Move set_iova into success path of virtio_bo_init_dmabuf
set_iova() was called unconditionally after tu_bo_init(), even on the
failure path where the BO has been zeroed. This would call set_iova()
with res_id 0 and a stale iova, corrupting the iova mapping.

Move set_iova() into the success branch so it is only called when
tu_bo_init() succeeds.

Fixes: db88a490b8 ("tu: Avoid extraneous set_iova")
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
(cherry picked from commit 7a96bc3187)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:32 +02:00
Valentine Burley
28f24b21ee tu/drm/virtio: Add missing lock to virtio_bo_init_dmabuf
Lock vma mutex when freeing iova in virtio_bo_init_dmabuf.

Fixes: f17c5297d7 ("tu: Add virtgpu support")
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
(cherry picked from commit 28e3fb7052)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:32 +02:00
pal1000
0b54363202 clc: Fix static link with clang>=22
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/15090

Backport-to: 26.0

Reviewed-by: Karol Herbst <kherbst@redhat.com>

Tested-by: Rudi Heitbaum <rudi@heitbaum.com>
(cherry picked from commit 718afd787c)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:32 +02:00
Mary Guillemard
79c1ff9077 nak: Do not allow load_helper_invocation reordering
load_helper_invocation can not be reordered past a demote.

Signed-off-by: Mary Guillemard <mary@mary.zone>
Fixes: 7ece220f96 ("nak/nir: Lower systm values before lowering I/O")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
(cherry picked from commit cba5841d61)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:32 +02:00
Mary Guillemard
d4c73521c5 nir/dead_cf: Add missing load_global_bounded handling
Signed-off-by: Mary Guillemard <mary@mary.zone>
Fixes: caa0854da8 ("nir: plumb load_global_bounded")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
(cherry picked from commit bb6fc8cc20)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:32 +02:00
Mary Guillemard
7908d4e89f nir/dead_cf: Add missing load_ssbo_ir3 handling
Signed-off-by: Mary Guillemard <mary@mary.zone>
Fixes: 0092edfec0 ("nir/dead_cf: Do not remove loops with loads that can't be reordered")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
(cherry picked from commit 6013667d61)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:32 +02:00
Mike Blumenkrantz
d769e67c52 llvmpipe: fix color fbfetch
with the unlowering pass, there is no longer a separate gl_LastFragData variable,
so this workaround just breaks color outputs

fixes dEQP-GLES31.functional.shaders.framebuffer_fetch.basic.last_frag_data

cc: mesa-stable

(cherry picked from commit 4b2022a8f5)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:32 +02:00
Mike Blumenkrantz
ad2384db21 mesa/renderbuffer: always add PIPE_BIND_SAMPLER_VIEW to rendering textures
this fixes expectations around e.g., using u_blitter to copy textures

cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 929eb9a021)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:31 +02:00
Nick Hamilton
b3197d6821 pvr: Fix for multiple attachments being assigned to the same tile buffer.
When the first attachment is assigned to a tile buffer, the buffer
alloc mask was not been updated. This means when a second attachment
is added to the same tile buffer it will be assigned the same offset
as the first which will lead to incorrect behaviour.

Fixes for depq-vk:
dEQP-VK.renderpasses.dynamic_rendering.complete_secondary_cmd_buff.suballocation.attachment.4.568
dEQP-VK.renderpasses.dynamic_rendering.complete_secondary_cmd_buff.dedicated_allocation.attachment.4.568
dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.suballocation.attachment.4.568
dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.dedicated_allocation.attachment.4.568

Fixes: a7de9dae6b ("pvr: Add routine for filling out usc_mrt_setup from dynamic rendering state")

Signed-off-by: Nick Hamilton <nick.hamilton@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
(cherry picked from commit 96cfb1cb7f)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:31 +02:00
Luigi Santivetti
5594cb90ac pvr: keep compiler resources in sync with attachments
Do not assume that the application always provides images for backing
attachments. The app can provide a super set of attachments of which
only some are actually backed with images.

We want to filter-out attachments that aren't meaningful for rendering
or sampling, and create compiler resources only for relevant ones.

Fix assert in CTS:
  pvr_arch_mrt.c:215: pvr_rogue_init_usc_mrt_setup: Assertion `att_format != VK_FORMAT_UNDEFINED' failed.

Seen in pipeline monolithic, for instance:
  dEQP-VK.pipeline.monolithic.multisample.misc.dynamic_rendering.multi_renderpass.r8g8b8a8_unorm_r16g16b16a16_sfloat_r16g16b16a16_sint_d32_sfloat_s8_uint.random_127

Fixes: d549c1d045 ("pvr: add pipeline handling to use dynamic rendering info")
Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
(cherry picked from commit 5473ca3be3)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:31 +02:00
Luigi Santivetti
ff902ec44b pvr: expose partial usc mrt init routine
Expose the routine in preperation for a later commit.

Backport-to: 26.0

Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
(cherry picked from commit 6b0fea938b)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:31 +02:00
Simon Perretta
ee797f7159 pco: use vm/icm for tile buffer store coverage mask
Use the valid/input coverage masks for tile buffer store coverage masks
when running single/multi-sampled fragment shaders respectively.

Fixes: 297a0c269a ("pvr, pco: tile buffer support")

Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Reported-by: Nick Hamilton <nick.hamilton@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
(cherry picked from commit 8eee60fa78)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:31 +02:00
David Rosca
f1b6e15252 frontends/va: Fix leaks when create_video_codec fails
Cc: mesa-stable
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
(cherry picked from commit 089cd9d88e)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:31 +02:00
David Rosca
9c88f72f8c frontends/va: Fix leaking H264/5 PPS/SPS objects when decoder wasn't created
When destroying H264/5 decode context we check the profile from decoder to
free the H264/5 PPS/SPS objects, but decoder is only created when decoding
first frame so these objects will never get freed in case decoder is NULL.

Cc: mesa-stable
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
(cherry picked from commit 5134d37e7d)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:31 +02:00
Rhys Perry
123322b8ae aco/tests: fix assembler/isel tests with LLVM 23
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Backport-to: 26.0
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
(cherry picked from commit e2ebcba11b)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:31 +02:00
Rhys Perry
4f859cf584 aco/tests: fix assembler tests with LLVM 22
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Backport-to: 26.0
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
(cherry picked from commit 0826685f1b)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:31 +02:00
Iván Briano
b26c4014c6 brw: do not omit RT writes if dual_src_blend is on
Dual source blending when one of the sources is not written to leaves
those values undefined, but the other should still be valid.
By omitting unwritten outputs, we ended up not writing anything at all
for the case that OUT1 is written to but OUT0 is undefined.

Fixes new CTS tests: dEQP-VK.pipeline.*.blend.dual_source.undefined_output.first*

Cc: mesa-stable
Signed-off-by: Iván Briano <ivan.briano@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
(cherry picked from commit fd556e54f6)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:31 +02:00
Iván Briano
3794d34ad4 anv: fix anv_is_dual_src_blend_equation
Fixes new tests: dEQP-VK.pipeline.*.blend.dual_source.undefined_output.second*

Cc: mesa-stable
Signed-off-by: Iván Briano <ivan.briano@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
(cherry picked from commit 2ce8a9e1be)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:31 +02:00
Erik Faye-Lund
2953656a39 pan/lib: divide extent by tile-extend, not itself
Dividing this by itself is nonsensical, and just always gives us one.
That's obviously not what we want here.

But in this case we also know that the extent is divisible by the tile
extent, so there's no need for DIV_ROUND_UP, we can just divide.

Fixes: e6f8cab698 ("pan/layout: Split the logic per modifier")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
(cherry picked from commit 5280b80281)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:31 +02:00
Erik Faye-Lund
ad057adfd4 pan/lib: set srgb-flag for afrc render-targets
Without this, sRGB rendering to AFRC is broken.

Fixes: 7a763bb0a3 ("pan/genxml: Rework the RT/ZS emission logic")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
(cherry picked from commit b0c32fcc66)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:31 +02:00
Erik Faye-Lund
0a5c858f28 pan/lib: do not try to use stencil-aspect of color attachment
We can't use the stencil-aspect of a color-attachment. That's going to
fail, so let's use the color-aspect instead. We already have it around
anyway.

Fixes: 7a763bb0a3 ("pan/genxml: Rework the RT/ZS emission logic")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
(cherry picked from commit 322aaa88c6)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:31 +02:00
Erik Faye-Lund
4539139804 pan/genxml: remove non-existent YUV Enable for AFRC
This is controlled by the writeback-mode when using AFRC, not by an YUV
Enable field. This Filed doesn't exist in these, and should according to
the spec be zero.

Fixes: 7a763bb0a3 ("pan/genxml: Rework the RT/ZS emission logic")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
(cherry picked from commit 15e0ac0731)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:31 +02:00
Eric Engestrom
9e5e58aa38 .pick_status.json: Mark 538c3ee6c7 as denominated
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:31 +02:00
Samuel Pitoiset
111c2dacaa radv/amdgpu: free the VA range in case the BO allocation failed
Found by inspection.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit 02628a5eb7)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:31 +02:00
Robert Mader
eccd9df749 llvmpipe: Stop aligning height to raster block size for unbacked handles
This code path is usually used by lavapipe when importing dmabufs, not
for output.
The resulting size_required is then used to calculate the size
requirements for VkMemoryRequirements2 etc. Requiring a multiple of
LP_RASTER_BLOCK_SIZE - 4 - can eventually result in lavapipe rejecting
dmabuf imports.

An example is YUV420 at a resolution of 1680x1050 produced by Gstreamer
1.28 - e.g. from a screencasts. In this case we currently compute a size
of 3235840, while other drivers like radv compute 3225600. The actual
size is 3227648, fitting into the later but not the former.

Removing the alignment brings lavapipe in line with other drivers.

Cc: mesa-stable
Signed-off-by: Robert Mader <robert.mader@collabora.com>
(cherry picked from commit 0bbc26d2c4)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:30 +02:00
Eric Engestrom
676c9c7f0e ci: changing .gitlab-ci.yml itself also means the container jobs must exist
Fixes: 4b2a4dce78 ("ci: Skip check-only container jobs for pre-merge")
(cherry picked from commit 4466914680)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:30 +02:00
Eric R. Smith
0629cbe042 panfrost: fix typos in architecture detection
The preprocessor symbol we want is `PAN_ARCH`, not `MALI_ARCH`.

Fixes: a21ee564e2 ("pan/bi: Make texel buffers use Attribute Buffers")
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
(cherry picked from commit 3945421c17)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:30 +02:00