Commit graph

218090 commits

Author SHA1 Message Date
Calder Young
826281a2f6 anv: Fix some usage flags not propagated to ISL for explicit layouts
Some vulkancts tests rely on vkGetImageMemoryRequirements to return the same
exact size after exporting and importing an image. This broke when we started
adding padding to sampled surfaces to manage overfetch, because the texture
usage flag does not get applied to the ISL surface when the image is recreated
using an explicit layout.

Fixes: 8d13628f7 ("isl: Add additional alignment/padding requirements to prevent overfetch")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
(cherry picked from commit efc6a3053d)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:18 +02:00
Mike Blumenkrantz
97ce385200 lavapipe: fix setting colormasks when attachments get remapped
this requires blend state updates

cc: mesa-stable

(cherry picked from commit 2e9e8e9a36)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:18 +02:00
Mike Blumenkrantz
fa31e5e295 lavapipe: unset attachment remap state if pColorAttachmentLocations==NULL
cc: mesa-stable

(cherry picked from commit abc6f351b1)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:18 +02:00
Mike Blumenkrantz
72b5aad56d lavapipe: update cbuf count when remapping attachments
handle cases where attachments are remapped to higher indices than
the renderpass was created with

fixes:
dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.local_read.mapping_*_attachments_to_locs_from_*

cc: mesa-stable

(cherry picked from commit 563259eaa9)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:18 +02:00
Jon Turney
9be16393a6 ddebug: Fix use of alloca() without #include "c99_alloca.h"
Fixes: 6fe6c18c12 ("util: add/use new os_mkdir() function")
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
(cherry picked from commit 2b9e491b67)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:18 +02:00
Ahmed Hesham
0cf06034da pan/bi: Restore b3210 as a valid swizzle
`b3210` was not removed in v11, and is causing a failure in
OpenCL-CTS when running `test_basic
vector_swizzle`. `invalid_instruction` assertion was triggered with
the message:
```
Invalid 8-bit widen:
                r3 = LSHIFT_OR.v4i8.flow2 u1.b3210, u256, u256.b0
```

Restore `b3210` in the ISA XML file, and handle the case for it in
`va_pack_widen`.

Fixes: c36326d3 ("pan/bi: Remove b3210 from valid swizzle")

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
(cherry picked from commit 2b1d9a2afc)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:18 +02:00
Job Noorman
a43eed5bf5 ir3/shared_ra: insert reloads before tied dst pcopies
The parallel copies use the reloaded values in their srcs so make sure
reloads happen before them.

Fixes a RA validation error in Windrose.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Fixes: fa22b0901a ("ir3/ra: Add specialized shared register RA/spilling")
(cherry picked from commit c67118a6eb)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:18 +02:00
Job Noorman
5d875c43af ir3/shared_ra: use ir3_cursor instead of instr in reload helpers
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Fixes: fa22b0901a ("ir3/ra: Add specialized shared register RA/spilling")
(cherry picked from commit c50c06d83f)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:18 +02:00
Emma Anholt
ae0a465217 screenshot-layer: Fix leftover VK queues in the map at DeviceDestroy.
Noticed when the compiler said device_destroy_queues() was unused.

Fixes: 111faf2158 ("vulkan/screenshot-layer: Correct queueFamilyIndex source")
(cherry picked from commit 25723e3a37)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:18 +02:00
Vinson Lee
08ab11f1c8 vulkan/screenshot-layer: initialize info to NULL
Initialize 'info' to NULL to avoid use of potentially uninitialized
value at the cleanup label when an earlier error causes a goto before
png_create_info_struct() is reached.

screenshot.cpp:808:9: warning: variable 'info' is used uninitialized whenever 'if'
condition is true [-Wsometimes-uninitialized]
screenshot.cpp:814:9: warning: variable 'info' is used uninitialized whenever 'if'
condition is true [-Wsometimes-uninitialized]

Fixes: eda55c7c2f ("vulkan/screenshot-layer: Add Vulkan screenshot layer")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Casey Bowman <casey.g.bowman@intel.com>
(cherry picked from commit 4c46cd8e9d)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:18 +02:00
Lionel Landwerlin
5b6afc7ef6 anv: fix arc artifacts on Farming simulator 2022
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
(cherry picked from commit f111dedab6)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:18 +02:00
Job Noorman
7368c4e24c ir3/cf: fix rewriting uses with different dst types
When an instruction has multiple cov uses that have different dst types,
we cannot simple make them all a mov, as some may still have to perform
an actual conversion. Fix this by setting the use's src type to the dst
type of the conversion we just folded.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15395
Fixes: 3474ba53b5 ("freedreno/ir3/cf: handle multiple cov's properly")
(cherry picked from commit e60e5fe5ef)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:18 +02:00
Mike Blumenkrantz
fbf0ec0426 llvmpipe: always set view_index for linear rasterizer
if this is unset, the view index is garbage and any shader accessing it
will read garbage

this is the source of all lavapipe flakes.

cc: mesa-stable

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

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:18 +02:00
Louis Montagne
e33fee1e14 zink: relax build-id length assertion for Mach-O
`disk_cache_init` asserts `build_id_len == BUILD_ID_EXPECTED_HASH_LENGTH`
(20, the size of a GNU build-id SHA1 on ELF). Mach-O has no GNU
build-id; the closest equivalent is `LC_UUID`, which is 16 bytes.
`build_id_length()` therefore returns a non-20 value on macOS and the
assert fires as soon as `ENABLE_SHADER_CACHE` is on.

Relax the assertion to `<=` so any non-empty build id of acceptable
length is accepted while still catching impossibly long ones. The hash
only needs *some* unique-per-build identifier; the actual byte count
hashed is whatever `build_id_length()` returned.

Cc: mesa-stable
Suggested-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Louis Montagne <louis@askem.eu>
(cherry picked from commit 14992361a4)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:18 +02:00
Vinson Lee
9e2f55e816 st/mesa: fix implicit conversion warning in st_atom_framebuffer
../src/mesa/state_tracker/st_atom_framebuffer.c:203:27: warning: implicit conversion from 'unsigned int' to 'uint8_t' (aka 'unsigned char') changes value from 4294967295 to 255 [-Wconstant-conversion]

Fixes: 2b37f23314 ("gallium: fix pipe_framebuffer_state::view_mask")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
(cherry picked from commit 27c870a283)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:18 +02:00
Samuel Pitoiset
2b7615daaa radv: fix determining needed dynamic states when rasterization is disabled
The vertex input state can be NULL if rasterization is disabled with
dynamic vertex inputs.

The input assembly state can be NULL if rasterization is disabled
and both states are dynamic (primive topology and primitive restart
enable).

This fixes a segfault with gpu-ratemeter vk_dyn.prim

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

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:17 +02:00
Connor Abbott
2ccc5ca91e tu: Disable LRZ when resuming if the GPU doesn't support tracking
We rely on tu_lrz_flush_valid_at_suspending_rp_boundary() to make sure
that subsequent resuming renderpasses get the correct LRZ state. However
this doesn't work on early a6xx GPUs without tracking support. Disable
LRZ in this case, similar to secondaries.

Cc: mesa-stable
(cherry picked from commit 638b10c5e0)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:17 +02:00
Connor Abbott
9ceee2ca1c tu: Fix LRZ+FDM offset+secondaries
As the comment says, we need to have an image view in order to disable
LRZ so that secondaries know it's disabled. Noticed by inspection.

Cc: mesa-stable
(cherry picked from commit f590e46b9d)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:17 +02:00
Emma Anholt
953fca352b tu: Add capture/replay for sparse buffers and descriptor buffer.
This matches the behavior of radv for these two.

Fixes:
dEQP-VK.binding_model.descriptor_buffer.traditional_buffer.capture_replay.sparse_buffer_descriptor_data_consistency
dEQP-VK.binding_model.descriptor_buffer.traditional_buffer.capture_replay.sparse_buffer_descriptor_data_consistency_and_usage

Fixes: 8feed47fce ("tu: Initial support for sparse binding")
(cherry picked from commit 7372c7c9e2)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:17 +02:00
Dave Airlie
63e10b7be1 lavapipe: treat NULL pColorAttachmentLocations as no handles
this fixes a crash seen in:
dEQP-VK.renderpasses.dynamic_rendering.partial_secondary_cmd_buff.local_read.interaction_with_color_write_enable

Cc: mesa-stable
(cherry picked from commit 9cb688af88)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:17 +02:00
Mike Blumenkrantz
9e1bd0a030 lavapipe: allow fbfetch with shader objects
required by DRLR

cc: mesa-stable

(cherry picked from commit 547dc7a131)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:17 +02:00
Mike Blumenkrantz
90a31051f5 lavapipe: rework immutable samplers
samplers can be destroyed whenever, which makes it problematic to store
the pointers into descriptor layouts for embedded samplers. instead,
directly store the descriptor info into the layout, since this is all
constant data which is unaffected by object lifetimes

cc: mesa-stable

(cherry picked from commit 1da8528bbc)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:17 +02:00
Mike Blumenkrantz
ab5864a688 lavapipe: use the right type for DGC mesh draws
cc: mesa-stable

(cherry picked from commit 965beb520c)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:17 +02:00
Mike Blumenkrantz
2a321c87e1 util/format: support 256-bit formats in util_format_get_tilesize()
Fixes: eb64ce4386 ("util: Add a helper for querying sparse tile sizes")
(cherry picked from commit 43051547b6)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:17 +02:00
Mike Blumenkrantz
0f499aab47 lavapipe: fix pushconst data updating
in a sequence like:
* CmdPushConstants
* CmdBindPipeline (doesn't use push constants)
* CmdDispatch
* CmdBindPipeline (uses push constants)
* CmdDispatch

the previous code would never update pushconsts and the second dispatch
would have no valid data

cc: mesa-stable

(cherry picked from commit f4461b66b6)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:17 +02:00
Mike Blumenkrantz
3c8d2ae5fb lavapipe: fix indirect memory copies
this was using the wrong size for the copy

cc: mesa-stable

(cherry picked from commit 87764963f2)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:17 +02:00
Eric R. Smith
3a7b05dbb0 panfrost: add helper function for checking for active queries
Add a convenience helper function, and use this for checking
whether queries are active. This fixes a bug where we were
basically always using a software fallback for indirect
rendering rather than the CSF hardware loop.

Cc: mesa-stable
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
(cherry picked from commit 80e6b468f4)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:17 +02:00
Eric R. Smith
7650063040 panfrost: make sure INDEX_OFFSET is cleared
Ensure the INDEX_OFFSET CSF register is set to 0 before an ordinary
draw. This is normally the case, but indirect draws can change it.

Cc: mesa-stable
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
(cherry picked from commit 2b10a6c37f)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:17 +02:00
Dave Airlie
70546eeb08 gallivm: handle llvm 22 scatter/gather intrinsic changes.
The intrinsics moved alignment to an attribute on the pointer.

Cc: mesa-stable
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
(cherry picked from commit 645de2b433)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:17 +02:00
Dave Airlie
ec048c1aaf gallivm: handle llvm 22 coroutine end change
the coroutine end changed return value.

Cc: mesa-stable
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
(cherry picked from commit 469270b914)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:17 +02:00
Mike Blumenkrantz
2c934e2020 llvmpipe: fix min_samples + A2C
running a2c in its usual loop fails to update the mask for the current
sample, which breaks successive operations BUT ONLY WHEN RUNNING PER-SAMPLE

cc: mesa-stable

(cherry picked from commit d998456d21)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:17 +02:00
Calder Young
951c6a9103 anv: Fix support for indirect SBTs on Xe3+
Fixes: 6deb195 ("anv: Update RT dispatch globals to use 64bit data structure")
(cherry picked from commit 6aabe5482e)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:17 +02:00
Calder Young
b5ad25f7c8 anv: Fix address bit masking for indirect SBTs
Fixes: ce68824 ("anv: fix invalid masking of 48bit address")
(cherry picked from commit 8f7309d9a9)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:17 +02:00
Emma Anholt
088761575d ir3: Fix shared IMAD24 lowering.
Caught by
dEQP-VK.spirv_assembly.instruction.compute.opsdotkhr.all_us_v2i16_out32
and friends in !41178

Fixes: b4874aa5cf ("ir3: Use scalar ALU instructions when possible")
(cherry picked from commit d8b525466c)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:17 +02:00
Paulo Zanoni
ee751f8799 intel/isl: warn about excessive num_elements only once
Commit f3c7e14f09 ("isl: don't assert(num_elements > (1ull << 27))")
replaced an assert(num_elements <= (1 << 27)) with a mesa_logw(). At
that time, the only games I knew that printed this message (Marvel's
Spider-Man Remastered and Assassin's Creed: Valhalla) only printed
it a few times during startup.

It turns out that The Last Of Us Part II Remastered constantly prints
this message during gameplay. Downgrade it to mesa_logw_once() so we
don't spam the terminal, don't fill disks with log messages and don't
make things slower in general.

Fixes: f3c7e14f09 ("isl: don't assert(num_elements > (1ull << 27))")
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
(cherry picked from commit 4167b7d51f)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:17 +02:00
Paulo Zanoni
f5f4c818b3 intel/isl: fix assert when surf->size_B is > UINT_MAX
I have some local tests for Sparse Resources that I wrote when I was
working on that for Anv. One of them tries to create a sparse buffer
with size 4294967296 (which doesn't fit in an uint32_t). Without this
patch, the right side of the assertion overflows and we get:

sparse: ../../src/intel/isl/isl.c:3787: isl_surf_from_mem: Assertion `surf->size_B == surf->row_pitch_B * extent.h * extent.a' failed

Fixes: fcdae4d4c0 ("intel: Add and use isl_surf_from_mem()")
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
(cherry picked from commit c4b6df29bf)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:16 +02:00
Adrián Larumbe
055b652c43 pan/kmod: fix double syncop count sum when populating vm_bind syncs
In order to assign bind_ops[i].syncs a slice of the sync_ops array,
op_sync_cnt must record the exact number sync operations for that vm_bind
operation, so that &sync_ops[syncop_ptr - op_sync_cnt] will give us the
right start of its slice.

Fixes: 97f6a62f7e ("pan/kmod: Add a backend for panthor")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
(cherry picked from commit 293b264b7d)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:16 +02:00
Adrián Larumbe
de581c7a5b pan/kmod: Fix minor version number check for USER_MMIO_OFFSET ioctl
It has been available in the Panthor KMD since 1.5

Fixes: 590ad83b98 ("panfrost: Use pan_image_test_modifier_with_format() to do our modifier check")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
(cherry picked from commit 9145ce0bb2)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:16 +02:00
Lorenzo Rossi
4b620bb641 panvk/jm: Fix tls_size overwrite in indirect draws
Only caused problems when the VS/FS has more TLS than our internal shaders
that doesn't usually happen but will cause bugs when we start to
compress local memory.

Fixes: 005703e5b5 ("panvk: Move TLS preparation logic to cmd_dispatch_prepare_tls")
Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
(cherry picked from commit f0d2ad9840)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:16 +02:00
David Rosca
cb4cbcad6e frontends/va: Add missing NULL check for additional output surface
Fixes: efc6d27fd4 ("frontends/va: Add support for decode/encode processing")
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
(cherry picked from commit 3d16845e9a)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:16 +02:00
David Rosca
eda2a46f1f frontends/va: Fix setting output color properties from color standard
Fixes: 6e8a8d8ee7 ("frontends/va: Stop using vpp colors standard")
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
(cherry picked from commit 69db546936)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:16 +02:00
Raviraj Uppal
17ff747bd7 driconf: disable allow_rgb16_configs for SPECviewperf
Commit f2aaa9ce00 added 16 bpc unorm display formats gated behind the flag
allow_rgb16_configs driconf option, defaulting to true.

This causes SPECviewperf's maya_06 viewset to fail. Disabling
allow_rgb16_configs for SPECviewperf alongside the existing
allow_rgb10_configs workaround.

Fixes: f2aaa9ce00 ("dri,gallium: Add support for RGB[A]16_UNORM display formats.")

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
(cherry picked from commit 3359de8247)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:16 +02:00
Jose Maria Casanova Crespo
c01759a704 broadcom/compiler: move nir_lower_undef_to_zero out of optimization loop
The combination of nir_opt_if and nir_lower_undef_to_zero running inside
the optimization loop could make it to not converge.

This was exercised by ollama running gemma3 compute shaders.

Removing the pass from the optimization loop results in No changes in
shader-db.

Assisted-by: Claude Opus 4.6
Fixes: cbe24a0e9c ("broadcom/compiler: use nir_lower_undef_to_zero")
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
(cherry picked from commit 2cd51a6efc)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:16 +02:00
Lionel Landwerlin
aa683482a9 anv: fix null pointer access
Reproduces with dEQP-VK.pipeline.no_queues.pipeline_binary.compute

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 595889018a ("anv: implement VK_KHR_maintenance9")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
(cherry picked from commit dad8f65611)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:16 +02:00
Icenowy Zheng
253e48a3bd pvr: record deferred RTA clears for secondary cmdbuf subcmds
Currently the code handling deferred RTA clears cannot handle them for
secondary command buffers within render passes, because the code
immediately configures the transfer command for the deferred clear
operation, but the specific attachment image view isn't known when
recording secondary command buffers to be executed inside render passes.

Add code to record parameters for deferred RTA clears in secondary
command buffers when the attachment is unknown, and bind the recorded
clears to the attachment's image view when executing the secondary
command buffer inside a render pass.

Fixes many dynamic rendering random tests.

Backport-to: 26.0
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Reviewed-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
(cherry picked from commit 9960637b26)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:16 +02:00
Icenowy Zheng
d2241f3ff6 pvr: add deferred RTA clear command to list after checking it's not NULL
The code that adds deferred RTA clear transfer commands checks whether
the newly allocated transfer command is NULL. However the list_addtail
call is before the check, which means that the check does not prevent
NULL dereference.

Reorder the code to ensure no NULL transfer commands would ever be added
to the deferred clear list.

In addition, pvr_transfer_cmd_alloc() has already set the command
buffer's error status when it returns NULL, so it's not needed to set it
again.

Fixes: 2eabbbe57d ("pvr: use linked list to back deferred clears")
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Reviewed-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
(cherry picked from commit ecd4e93456)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:16 +02:00
Icenowy Zheng
f253c60791 pvr: properly handle deferred RTA clears for 2D array view of 3D image
For 2D array views of 3D images, the layer of the view corresponds to
the depth (instead of the layer, which should be always 0) of the image.

Fix the code emitting deferred RTA clears to set the depth instead of
the layer of the image to clear.

Fixes the flakiness of `dEQP-VK.renderpasses.renderpass*.
remaining_array_layers.multi_layer_fb.*`.

Fixes: 95820584d0 ("pvr: Add deferred RTA clears for cores without gs_rta_support.")
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Reviewed-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
(cherry picked from commit 40e0f0f933)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:16 +02:00
Icenowy Zheng
b7a94f8b3d pvr: do not setup deferred RTA clear for active render targets
Deferred RTA clear will happen after the current graphics subcommand is
executed, which may override rendered image in the graphics subcommand.
In addition, the active render targets do not need "emulated" clear --
they can be really cleared by drawing rectangles.

Skip set up deferred RTA clear for active render target layers, and
continue to do immediate clear for these layers.

Fixes a few dynamic rendering random CTS tests, but the issue should
also exist in legacy renderpasses RTA clears.

Fixes: 95820584d0 ("pvr: Add deferred RTA clears for cores without gs_rta_support.")
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Reviewed-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
(cherry picked from commit 43b22a477c)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:16 +02:00
Nick Hamilton
70c5654789 pvr: Revert don't csb emit multi-layer clear attachments without rta support
While testing HW without gs_rta_support it was raised that this
change had been made in error. After retesting with the change
reverted the listed tests still pass.

This reverts commit d68344bffe.

Backport-to: 26.0
Reported-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Signed-off-by: Nick Hamilton <nick.hamilton@imgtec.com>
Reviewed-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
(cherry picked from commit 08c13564d6)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:16 +02:00
Icenowy Zheng
88047cbda5 pvr: increase maxPerStageResources for new maxPerStageDescriptorStorageBuffers
When maxPerStageResources is less than 128, it must be at least the sum
of maxPerStageDescriptorUniformBuffers,
maxPerStageDescriptorStorageBuffers, maxPerStageDescriptorSampledImages,
maxPerStageDescriptorStorageImages,
maxPerStageDescriptorInputAttachments and maxColorAttachments.

As maxPerStageDescriptorStorageBuffers is previously increased, the
value of maxPerStageResources should be increased too.

This fixes regression on two limit validation tests in the Vulkan CTS --
dEQP-VK.info.device_properties and dEQP-VK.api.info.
vulkan1p2_limits_validation.general .

Fixes: 35f57a2739 ("pvr: increase value of maxPerStageDescriptorStorageBuffers")
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Reviewed-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
(cherry picked from commit 1027059baa)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
2026-05-13 15:39:16 +02:00