Commit graph

205249 commits

Author SHA1 Message Date
Valentine Burley
97baa27dad freedreno/drm/virtio: Fix wait_fence ret ordering
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
ret was read after the timeout check, so breaking on timeout returned 0
instead of the actual fence status, potentially reporting a signaled
fence when it was still pending.

Fixes: 441f01e778 ("freedreno/drm/virtio: Drop blocking in host")

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41108>
2026-04-23 06:52:14 +00:00
Valentine Burley
dad72b414b tu/drm/virtio: Fix tu_wait_fence timeout handling
Fixes two bugs in the WAIT_FENCE polling loop:
1. Break on timeout returned VK_SUCCESS because ret was read too late.
2. UINT64_MAX timeout_ns overflowed end_time, causing immediate exit.

Fix by reading rsp->ret before the timeout check and using
OS_TIMEOUT_INFINITE (like virtio_pipe_wait in freedreno) to avoid
overflow.

This prevents premature BO teardown during host-side fault recovery.

Fixes: f17c5297d7 ("tu: Add virtgpu support")
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41108>
2026-04-23 06:52:14 +00:00
jinmiliu
809bf45c12 radeonsi: enable protected context support for Android
Enable protected context capability for Android
when TMZ support is available. This is needed for Widevine L1 secure
video playback on Android, which requires a protected context.

Signed-off-by: jinmiliu <jinming.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40980>
2026-04-23 05:23:57 +00:00
Qiang Yu
b41cd59790 ac,radeonsi,radv: use V_581A_* engine sel for non-pws acquire_mem packet
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
V_581B_PFP and V_581B_ME is for pws acquire_mem. Current code
does not cause any problem because we won't pass engine arg
directly to acqure_mem packet. But use a native V_581A_* arg
for better coding.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41069>
2026-04-23 02:48:06 +00:00
Qiang Yu
89c1bf34ed ac,radeonsi,radv: fix print IB assertion fail for reserved fields
New IB print will assert reserved packet field to be zero.

Fixes: 1c75cd958f ("ac: enable the new auto-generated CP packet parser")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41069>
2026-04-23 02:48:06 +00:00
Iván Briano
c5edb90046 anv: silence warning
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
../src/intel/vulkan/genX_init_state.c: In function ‘gfx9_CreateSampler’:
../src/intel/vulkan/genX_init_state.c:1507:40: warning: ‘border_color_offset’ may be used uninitialized [-Wmaybe-uninitialized]
 1507 |       sampler_state.BorderColorPointer = border_color_offset;

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41116>
2026-04-22 16:17:35 -07:00
GKraats
686266d2f1 crocus: Fix shader precompilation on Gen6 and higher
By default crocus precompiles shaders, to avoid stuttering at screens,
caused by compiling shaders at the drawing phase.
Unfortunately at intel Gen 6 and higher the precompiled version of the
fragment shaders is not used and every fragment shader is compiled twice.
These double fragment shaders also are added to the memory cache
and disk cache.
This is caused by setting wrong values to variables at the key during
precompiling at routine crocus_create_fs_state() at src/gallium/drivers/crocus/crocus_program.c,
which differ from values at crocus_populate_fs_key() at src/gallium/drivers/crocus/crocus_state.c.

This commit solves 3 problems:

it adjusts the predicted value 'input_slots_valid' at Gen 6
it adjusts the predicted value 'ignore_sample_mask_out' at Gen 6 and higher
it predicts the value 'multisample_fbo' , which helps if samplemask is used

Cc: mesa-stable
Signed-off-by: GKraats <vd.kraats@hccnet.nl>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35605>
2026-04-22 20:50:29 +00:00
GKraats
3c01e6139a hasvk: unbreak assert format != ISL_FORMAT_UNSUPPORTED
Format is set to ISL_FORMAT_UNSUPPORTED at anv_get_format_plane at src/intel/vulkan_hasvk/anv_formats.c,
because Ivy Bridge does not support enough 24 and 48-bits formats.

Problem solved by checking format after the call.

Signed-off-by: GKraats <vd.kraats@hccnet.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40237>
2026-04-22 20:35:25 +00:00
Valentine Burley
96d17d18be zink/ci: Move Turnip flakes to correct list
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
These belong in the zink directory, not freedreno. Also add 2-sample
variants and document the origin.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41111>
2026-04-22 19:56:11 +00:00
Valentine Burley
d982092865 anv/ci: Revert ADL VKCTS job to stable 6.17 kernel
Xe is unstable on 6.19; revert to the previous stable kernel.
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/97945843
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/97944526

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41112>
2026-04-22 19:29:43 +00:00
Caio Oliveira
26ef12f7c1 brw: Use brw prefix to LSC helpers tied to brw
Mapping from BRW ops to LSC ops.  And the len() helpers
that use the REG_SIZE as unit -- which is a BRW convention.

Acked-by: Iván Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41006>
2026-04-22 18:25:41 +00:00
Silvio Vilerino
e56354661b mediafoundation: Create readable dpb buffers with PIPE_BIND_RENDER_TARGET and PIPE_BIND_SHARED for DX11 sharing
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Pohsiang (John) Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41110>
2026-04-22 18:08:30 +00:00
Silvio Vilerino
f07be3b416 d3d12: Create PIPE_BIND_SHARED resources with D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS
Reviewed-by: Pohsiang (John) Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41110>
2026-04-22 18:08:30 +00:00
Emma Anholt
3a8ff22336 ci: Delete references to various broken traces.
These are all being removed from the repos, so no need to leave the old
notes around.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40959>
2026-04-22 17:39:31 +00:00
Emma Anholt
ae510dc35b ci/turnip: add an a660 VK restricted traces job.
This covers the DX8/DX9 single-frame apitrace collection from
traces-db-private, and the job will appear for anyone in the group with
access to restricted traces.  Like other restricted traces jobs, it's set
to allow-failure, so that regressions in the job from changes by
developers not in the group don't block merging by developers with access,
but hopefully the increased visibility lets us catch rendering bugs faster
or avoid merging them in the first place.

The actual runtime for all of our dx8/9 trace collection is about 2:30,
and the whole job is about 7:30.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40959>
2026-04-22 17:39:31 +00:00
Emma Anholt
e19a7451e5 ci/turnip: Drop two 660 vk jobs and tune down the vk coverage fraction.
We want another runner so we can do trace replay pre-merge.  And the vk
job was pushing our time targets, and oversubscribed by a board, so we
have to drop a bunch of coverage.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40959>
2026-04-22 17:39:31 +00:00
Emma Anholt
886fd59951 ci/lavapipe: Use anholt's new GPU trace snapshot comparison tool.
The new tool has much better image diffing presentation (thanks to
Danilo's work on turnip's private trace CI), better performance, flake
checking within a single run, parallelized downloads along with replays,
and ability to cache downloaded files to improve runtime, and system
monitoring (for debugging OOM-related slowdowns).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40959>
2026-04-22 17:39:31 +00:00
Emma Anholt
2ee4da8677 ci/llvmpipe: Use anholt's new GPU trace snapshot comparison tool.
The new tool has much better image diffing presentation (thanks to
Danilo's work on turnip's private trace CI), better performance, flake
checking within a single run, parallelized downloads along with replays,
and ability to cache downloaded files to improve runtime, and system
monitoring (for debugging OOM-related slowdowns).

./bin/update_traces_checksum.sh still updates based on the output of a CI
run, but you can also apply a patch file that the tool generates, if you
do offline runs using your traces.toml.

New traces being replayed, in less overall runtime (2 minutes instead of 3):

- minetest/minetest-high-v3.trace (new version, not the old flaky one)
- neverball/neverball-v2.trace
- ror/ror-default.trace
- supertuxkart/supertuxkart-mansion-egl-gles-v2.b.trace
- valve/counterstrike-v2.trace
- valve/portal-2-v2.trace
- xonotic/xonotic-keybench-high-v2.trace

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40959>
2026-04-22 17:39:31 +00:00
Emma Anholt
f7d1f59948 spirv: Demote the SPIRV 1.6 OpTypeSampledImage on Buffer failure to a warning.
The hangover DXVK builds we want to use for arm64 CI hit this path, and we
have a perfectly reasonable fallback for handling this case (ignore the
sampler, as glslang should have done).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40959>
2026-04-22 17:39:30 +00:00
Martin Roukala (né Peres)
a2ac64918b turnip/ci: document recent flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41100>
2026-04-22 17:19:22 +00:00
Martin Roukala (né Peres)
931d7d1fad zink/ci: mark blender-demo-cube_diorama as flaky on gfx1201
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41100>
2026-04-22 17:19:22 +00:00
Caio Oliveira
9329da6d88 brw: Don't set saturate for SYNC instruction
This helper might be used as by another instruction emission,
which itself might have set the saturate bit in the default
state.  This might result in the SYNC being created already
with saturate bit set.

Since SYNC doesn't have saturate, clear that field
instead of sometimes having it set.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41005>
2026-04-22 16:06:42 +00:00
Lars-Ivar Hesselberg Simonsen
82592433e6 panvk: Fix debug flag overlap
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
PANVK_DEBUG_HSR_PREPASS and PANVK_DEBUG_NO_EXTENDED_VA_RANGE have the
same value, meaning they both get toggled when one is.

This commit moves PANVK_DEBUG_HSR_PREPASS to the following value.

Fixes: 2d9be41706 ("panvk/v13: Support HSR Prepass")
Reviewed-by: John Anthony <john.anthony@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41106>
2026-04-22 15:14:23 +00:00
David Rosca
3d0239cff9 radv/video: Fix initializing rc structs with default rate control
Fixes: 32a02720a8 ("radv/video: Init session and update rate control in ControlVideoCoding")
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41027>
2026-04-22 14:49:27 +00:00
David Rosca
906be9bc7e radv: Fix uint32 overflow in slice offset calculation
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41027>
2026-04-22 14:49:27 +00:00
Tapani Pälli
a76e3c2616 drirc: use anv_disable_drm_ccs_modifiers for any GTK version
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15297
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41070>
2026-04-22 12:54:40 +00:00
Daniel Schürmann
806fcc6193 nir/opt_loop: always try to peel initial break from loops with unrolling hint
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This allows to unroll these loops, even if loop analyze is unable
to calculate the iteration count.
As always with loops, the throughput stats are meaningless.

Totals from 6 (0.00% of 202440) affected shaders: (Navi48)
Instrs: 7825 -> 6201 (-20.75%)
CodeSize: 37056 -> 30412 (-17.93%)
Latency: 21563 -> 16934 (-21.47%)
InvThroughput: 144649 -> 77962 (-46.10%)
SClause: 139 -> 133 (-4.32%)
Copies: 536 -> 388 (-27.61%)
Branches: 156 -> 84 (-46.15%)
PreVGPRs: 298 -> 296 (-0.67%); split: -1.01%, +0.34%
VALU: 2493 -> 2378 (-4.61%); split: -4.65%, +0.04%
SALU: 3263 -> 2199 (-32.61%)
SMEM: 188 -> 183 (-2.66%)

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40349>
2026-04-22 10:34:58 +00:00
Daniel Schürmann
738cc6a7db nir/opt_loop: stop recursion at loop header phi in can_constant_fold()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40349>
2026-04-22 10:34:58 +00:00
Daniel Schürmann
1f9a0490c6 nir/opt_loop: Don't peel initial break from do-while loops
As the main purpose of this optimization is to transform
while- into do-while loops, don't apply on loops which are
already in do-while form. Also set nir_loop::do_while after
this transformation, so that it is only applied once.

Totals from 576 (0.28% of 202440) affected shaders: (Navi48)
Instrs: 1337529 -> 1253438 (-6.29%); split: -6.36%, +0.07%
CodeSize: 8390852 -> 7837328 (-6.60%); split: -6.61%, +0.01%
VGPRs: 50856 -> 50844 (-0.02%)
SpillSGPRs: 42198 -> 35395 (-16.12%); split: -16.13%, +0.01%
SpillVGPRs: 47608 -> 44620 (-6.28%)
Latency: 31043828 -> 44143753 (+42.20%); split: -0.06%, +42.26%
InvThroughput: 6973433 -> 10079000 (+44.53%); split: -0.08%, +44.61%
VClause: 26839 -> 24718 (-7.90%); split: -7.91%, +0.00%
SClause: 21831 -> 21583 (-1.14%); split: -1.52%, +0.38%
Copies: 183503 -> 150040 (-18.24%); split: -18.84%, +0.61%
Branches: 27738 -> 26848 (-3.21%); split: -5.12%, +1.91%
PreSGPRs: 40233 -> 39083 (-2.86%); split: -2.88%, +0.02%
PreVGPRs: 38745 -> 38903 (+0.41%); split: -0.02%, +0.43%
VALU: 688396 -> 645948 (-6.17%); split: -6.17%, +0.01%
SALU: 189792 -> 177642 (-6.40%); split: -6.97%, +0.57%
VMEM: 121500 -> 112748 (-7.20%)
SMEM: 38765 -> 37767 (-2.57%); split: -2.58%, +0.00%
VOPD: 102488 -> 89071 (-13.09%); split: +0.24%, -13.33%

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40349>
2026-04-22 10:34:58 +00:00
Daniel Schürmann
a9a2edfbb6 glsl_to_nir: set nir_loop::do_while
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40349>
2026-04-22 10:34:58 +00:00
Daniel Schürmann
42663165a2 vtn: set nir_loop::do_while during spirv_to_nir()
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40349>
2026-04-22 10:34:58 +00:00
Daniel Schürmann
32436731a3 nir: add nir_loop::do_while to indicate do-while loops
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40349>
2026-04-22 10:34:58 +00:00
Pavel Ondračka
485586b184 r300,i915/ci: update expectations
More accurate asin and atan push few tests over the instruction limit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41094>
2026-04-22 10:16:43 +00:00
Valentine Burley
220d01fd2a zink/ci: Document recent flakes
These flakes have caused job failures in the last two weeks.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41095>
2026-04-22 09:46:30 +00:00
Lionel Landwerlin
6031d52393 anv: implement VK_EXT_primitive_restart_index
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40776>
2026-04-22 08:52:57 +00:00
Lionel Landwerlin
a4737d0430 vulkan: add tracking for VK_EXT_primitive_restart_index
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40776>
2026-04-22 08:52:57 +00:00
Lars-Ivar Hesselberg Simonsen
98c298cf4d pan/va/disasm: Align indentation
The disassembly file had a lot of inconsitencies in indentation, so
align on the standard IndentWidth: 3

Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41062>
2026-04-22 08:31:01 +00:00
Lars-Ivar Hesselberg Simonsen
17f1a2c184 pan/va/disasm: Align FAU printing
The current implementation prints FAU entries as 32-bit entries. While
this works, it does not align with the DDK.

Rather than treating FAU as a set of 32-bit entries, treat is as 64-bit
entries that can be split in two words.

This aligns with the DDK and has allows for differentiating 32-bit and
64-bit reads based on whether a word modifier is used.

Finally, add entry values to FAU printing to easily look up specific
reads.

For example:

Vertex FAU @ffd93950:
  43000000 43000000
  3F800000 43000000
  43000000 00000000
  C7000000 47000000
  00000001 00000000

FMAX.f32 r3, r3^, u6
FMIN.f32 r3, r3^, u7

vs

Vertex FAU @ffd93950:
u0  43000000 43000000
u1  3F800000 43000000
u2  43000000 00000000
u3  C7000000 47000000
u4  00000001 00000000

FMAX.f32 r3, r3^, u3.w0
FMIN.f32 r3, r3^, u3.w1

Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41062>
2026-04-22 08:31:01 +00:00
Lars-Ivar Hesselberg Simonsen
829eafa076 pan/va/disasm: Print 64 bit src/dest regs as reg pairs
This makes it clear that both registers are read/written, and aligns
with DDK disassembly.

For example:

STORE.i128.istream.slot2.reconverge @r0:r1:r2:r3, r4^, offset:0
vs
STORE.i128.istream.slot2.reconverge @r0:r1:r2:r3, [r4^:r5^], offset:0

Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41062>
2026-04-22 08:31:01 +00:00
Lars-Ivar Hesselberg Simonsen
9f049032be pan/genxml: Print shader hex in trace for Valhall
Enable verbose disassembly for Valhall in traces, which adds hex values
to shader printing. Useful for debugging.

For example:

Shader 0xffffbe3ec000 (GPU VA ffdd3000) sz 16384
   LD_ATTR_IMM.v4.f32.slot0.wait0 @r0:r1:r2:r3, r60^, r61^, index:0x0, table:0x0
   FRCP.f32 r3, r3^
   FMAX.f32 r3, r3^, u6

vs

Shader 0xffffa8bf7000 (GPU VA ffdd3000) sz 16384
7c 7d 00 32 08 80 66 08    LD_ATTR_IMM.v4.f32.slot0.wait0 @r0:r1:r2:r3, r60^, r61^, index:0x0, table:0x0
43 00 00 00 00 c3 9c 00    FRCP.f32 r3, r3^
43 86 03 00 00 c3 a4 00    FMAX.f32 r3, r3^, u6

Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41062>
2026-04-22 08:31:00 +00:00
Samuel Pitoiset
a73fc90bcd radv: fix GPU hangs with PS epilogs and secondaries properly
The previous fix was incomplete because if the same graphics pipeline
and the same PS epilog are rebind after vkCmdExecuteCommands(), the PS
epilog state wouldn't be re-emitted, and it will use a wrong VA (in case
both fragment shader user SGPRs aren't similar either).

Resetting the PS epilog to NULL in the primary should prevent any
issues, but this tracking still need to be improved because it caused
two issues recently.

Fixes: 1a00587c44 ("radv: fix a GPU hang with PS epilogs and secondary command buffers")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15176
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41056>
2026-04-22 08:03:35 +00:00
Samuel Pitoiset
9d17a7bdb4 spirv,treewide: rework specialization constant
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
With SPV_KHR_constant_data, it's allowed to specialize array of
constants.

RustiCL changes are from Karol Herbst <kherbst@redhat.com>.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41046>
2026-04-22 06:57:55 +00:00
squidbus
7d023db5b2 kk: Enable VK_AMD_shader_image_load_store_lod
This extension is already supported by the shader compiler,
it just needs to be enabled.

Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41082>
2026-04-22 06:42:08 +00:00
Sagar Ghuge
12f81eaa88 anv: Enable dynamic stack ID control on Xe3+
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This patch enables dynamic stack ID control on Xe3+.

Programmed values are the recommended settings from the Bspec.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41066>
2026-04-22 01:48:19 +00:00
Sagar Ghuge
acecc0f1b3 intel/genxml: Update xml for dynamic stack ID control fields
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41066>
2026-04-22 01:48:18 +00:00
Timothy Arceri
5f37490855 glcpp: fix paste within macro function expansion
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Note the tests added in 89cd6df034 were wrong (confirmed in gcc)
I've updated them to the expected outcome and enabled the paste
test from 475222b022.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13863
Fixes: d5cd40343f ("Expand macro arguments before performing argument substitution.")

Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40062>
2026-04-21 23:53:19 +00:00
Timothy Arceri
35eda3f3e2 glcpp: update out of date comment
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40062>
2026-04-21 23:53:19 +00:00
Karol Herbst
4cd64165a3 nak/lower_cf: remove single src phis
When lowering cf we go out of SSA which translates phis into reg
intrinsics. However when converting them back to SSA, initially single
source phis now have an undef source leading to increased register
pressure on the NAK side. This also hinders copy propagation as it's not
designed to handle sources through phis yet.

Totals from 50621 (4.17% of 1212873) affected shaders:
CodeSize: 1605273744 -> 1621029728 (+0.98%); split: -0.34%, +1.32%
Number of GPRs: 4673586 -> 4067935 (-12.96%); split: -12.97%, +0.01%
SLM Size: 263428 -> 258176 (-1.99%)
Static cycle count: 2599838439 -> 2586392435 (-0.52%); split: -1.11%, +0.59%
Spills to memory: 23512 -> 15527 (-33.96%)
Fills from memory: 23512 -> 15527 (-33.96%)
Spills to reg: 64590 -> 57328 (-11.24%); split: -13.83%, +2.58%
Fills from reg: 55559 -> 44319 (-20.23%); split: -22.66%, +2.42%
Max warps/SM: 1189396 -> 1347600 (+13.30%)

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41042>
2026-04-21 23:37:55 +00:00
Sagar Ghuge
620835926d brw: Pass write back register for ray query messages
For DG2 (Bspec 47937) has the same programming note as of Xe2+,

   "When this bit is set in the header, Trace Ray Message behaves like a
   Ray Query. This message requires a write-back message indicating
   RayQuery for all valid Rays (SIMD lanes) have completed."

So this patch is just passing a write back destination register when we
have ray query message.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41039>
2026-04-21 23:16:09 +00:00
José Roberto de Souza
64bc538f5e intel/brw: Explicitly upcast UB to UW for SHR with vector immediates
HW does not allow instructions with vector immediates to cross a GRF boundary if
it has a stride.

Under register pressure, the register allocator may place a temporary register
across such a boundary.

To resolve this, we now explicitly emit a MOV to upcast the UB payload into a
UW VGRF.
This ensures the SHR instruction operates on a dense, well-aligned region that
satisfies hardware alignment constraints.

Below is the portion of the shader exhibiting this issue:

Native code for unnamed fragment shader GLSL6 (src_hash 0x9c84a007) (sha1 48745e7dae90d08f8a9bbe4dbf837de23440c841f0344e669cb8af9df79bce58)
SIMD32 shader: 44 instructions. 0 loops. 354 cycles. 0:0 spills:fills, 2 sends, scheduled with mode latency-sensitive. Promoted 0 constants. GRF registers: 22. Non-SSA regs (after NIR): 11. Compacted 800 to 800 bytes (0%)
mov(1)          f1<1>UW         g0.30<0,1,0>UW                  { align1 WE_all 1N };
mov(1)          f1.1<1>UW       g1.30<0,1,0>UW                  { align1 WE_all 1N I@1 };
mov(32)         g2<2>UW         g0.20<2,8,0>UW                  { align1 WE_all };
mov(32)         g4<2>UW         g0.21<2,8,0>UW                  { align1 WE_all };
mov(32)         g8<2>UW         g1.20<2,8,0>UW                  { align1 WE_all };
mov(32)         g10<2>UW        g1.21<2,8,0>UW                  { align1 WE_all };
mov(16)         g12<4>UB        g0.60<1,8,0>UB                  { align1 1H };
mov(16)         g13<4>UB        g1.60<1,8,0>UB                  { align1 2H };
add(32)         g0<1>UW         g2<16,8,2>UW    0x01000100V     { align1 WE_all I@6 };
add(32)         g1<1>UW         g4<16,8,2>UW    0x01010000V     { align1 WE_all I@6 };
add(32)         g2<1>UW         g8<16,8,2>UW    0x01000100V     { align1 WE_all I@6 };
add(32)         g3<1>UW         g10<16,8,2>UW   0x01010000V     { align1 WE_all I@6 };
shr(16)         g4<1>UW         g12<32,8,4>UB   0x76543210V     { align1 1H I@6 };
mov(16)         g14.32<4>UB     g13<32,8,4>UB                   { align1 2H I@6 };
sync nop(1)                     null<0,1,0>UB                   { align1 WE_all 1N I@6 };
mov(16)         g5<1>UW         g0<16,8,2>UW                    { align1 1H };
sync nop(1)                     null<0,1,0>UB                   { align1 WE_all 1N I@6 };
mov(16)         g0<1>UW         g1<16,8,2>UW                    { align1 1H };
sync nop(1)                     null<0,1,0>UB                   { align1 WE_all 5N I@6 };
mov(16)         g5.16<1>UW      g2<16,8,2>UW                    { align1 2H };
sync nop(1)                     null<0,1,0>UB                   { align1 WE_all 5N I@6 };
mov(16)         g0.16<1>UW      g3<16,8,2>UW                    { align1 2H };
shr(16)         g4.16<1>UW      g14.32<32,8,4>UB 0x76543210V    { align1 2H I@5 };
    ERROR: Invalid register region for source 0.  See special restrictions section.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40856>
2026-04-21 22:51:45 +00:00