Commit graph

222111 commits

Author SHA1 Message Date
Samuel Pitoiset
8a1c9a614f vulkan: stop forcing independent sets for shader object
VK_KHR_maintenance11 added a new flag for ESO, forcing it shouldn't
be required anymore.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41377>
2026-05-06 10:43:56 +00:00
Samuel Pitoiset
9764225ff1 vulkan: replace VK_SHADER_CREATE_INDEPENDENT_SETS_BIT_MESA with the maint11 flag
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41377>
2026-05-06 10:43:56 +00:00
Christian Gmeiner
567a65bbbf etnaviv: Use shader R/B swap for LINEAR_PE shared resources
On LINEAR_PE GPUs, shared linear resources are render-compatible so
no render shadow exists - the PE renders directly into the shared
buffer. Rather than adding a dedicated flush-time blit to swap R/B
(which would introduce bandwidth that doesn't exist today), use the
frag_rb_swap shader key to swap channels at render time.

In etna_draw_vbo, detect LINEAR_PE + shared + linear + RB_SWAP format
and set the per-RT frag_rb_swap bits. Track shared_native_order so
etna_flush_resource can skip the dedicated blit when the shader
already produced correct byte order.

Fixes: a5766e75e48 ("etnaviv: Use BGRA-internal texture format with BLT/RS R/B swizzle")
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40029>
2026-05-06 10:26:58 +00:00
Christian Gmeiner
99bf43dd08 etnaviv: Add per-RT frag_rb_swap shader key and NIR lowering
Add a per-RT bitmask to the shader key that triggers R/B channel
swapping in the fragment shader output. Handles scalar through vec4
outputs by widening to vec4 first, then swapping channels 0 and 2
with adjusted writemask.

Preparation for LINEAR_PE GPUs where shared linear resources have no
render shadow, so the shader must produce correct byte order directly.

No functional change - nothing sets frag_rb_swap yet.

Fixes: a5766e75e48 ("etnaviv: Use BGRA-internal texture format with BLT/RS R/B swizzle")
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40029>
2026-05-06 10:26:58 +00:00
Christian Gmeiner
cfa8deaad9 etnaviv: Select texture format dynamically for shared RB_SWAP resources
The previous patches statically remapped the texture format at sampler
view creation time (A8R8G8B8 -> A8B8G8R8) for shared resources with
RB_SWAP formats. This is correct when the shared buffer holds
externally-produced RGBA data (import) or after flush_resource has done
the R<->B swap.

However, if the PE renders directly to a shared buffer (LINEAR_PE, no
render shadow), the data becomes BGRA. The static A8B8G8R8 format then
reads BGRA as RGBA - R and B are swapped.

Fix this by tracking whether the shared buffer holds native (RGBA) or
PE-internal (BGRA) byte order via a new shared_native_order flag, and
selecting the texture format dynamically at emit time.

The flag is set to true on import and export (data is native byte order
at that point), cleared when the PE renders directly to a shared buffer
without a render shadow, and set back to true after flush_resource
performs the R<->B swap.

Both the state-based and descriptor-based texture paths pre-compute the
native format variant at sampler view creation time, avoiding any
per-frame overhead beyond a single branch in the emit path.

Fixes: a5766e75e48 ("etnaviv: Use BGRA-internal texture format with BLT/RS R/B swizzle")
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40029>
2026-05-06 10:26:58 +00:00
Christian Gmeiner
4172e9a918 etnaviv: Convert PE-internal BGRA to RGBA when flushing shared resources
The PE renders RB_SWAP formats (e.g. R8G8B8A8_UNORM) using the A8R8G8B8
hardware format, which stores data in BGRA byte order internally. For
shared/dmabuf resources, external consumers expect the byte order
mandated by the DRM FourCC.

Hook into flush_resource to apply an R<->B swap during the existing
shadow-to-base copy, using the BLT dest swizzle or RS SWAP_RB.

Fixes: a5766e75e48 ("etnaviv: Use BGRA-internal texture format with BLT/RS R/B swizzle")
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40029>
2026-05-06 10:26:58 +00:00
Christian Gmeiner
377f2ec49c etnaviv: Bypass BGRA-internal optimization for shared resources
The rb-swap rework (commit a5766e75e48) uses A8R8G8B8 as the texture
format for RB_SWAP pipe formats and performs R<->B conversion during
transfer blits. This breaks dmabuf import/export: external producers
write RGBA bytes, but A8R8G8B8 interprets them as BGRA; transfer blits
incorrectly swap R<->B on data already in the correct byte order.

For shared/imported resources, bypass the optimization: use the native
texture format (A8B8G8R8) so the sampler reads RGBA bytes correctly in
both the descriptor and state-based texture paths, skip the R<->B
swizzle in BLT and RS transfer blits since shared resources already
store data in standard byte order, and re-enable the texture shadow
shortcut for shared RB_SWAP resources since the BLT swap is no longer
applied.

Internal-only resources continue using the BGRA-internal optimization
unchanged.

Fixes: a5766e75e48 ("etnaviv: Use BGRA-internal texture format with BLT/RS R/B swizzle")
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40029>
2026-05-06 10:26:57 +00:00
Lionel Landwerlin
fee5106b53 anv: add Gfx9 support VK_EXT_device_generated_commands
This platform just needs a bit more care around vertex buffer state
emission.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31384>
2026-05-06 09:49:52 +00:00
Lionel Landwerlin
afabf6e350 anv: add a device generated command debug option
It prints out the constant of the generated commands.

$ ANV_DEBUG=dgc-dump ./deqp-vk -n dEQP-VK.dgc.ext.compute.smoke.4_sequences_device_local_from_host_preprocess_state_same_universal_queue

Test case 'dEQP-VK.dgc.ext.compute.smoke.4_sequences_device_local_from_host_preprocess_state_same_universal_queue'..
call from 0xffffeffeffe04694
0x0000000400000000: MI_STORE_DATA_IMM
   0x10000403 0x00000178 0x00000004 0xffe047b8 0xffffeffe
0x0000000400000014: MI_BATCH_BUFFER_START
   0x18800101 0x00000020 0x00000004
0x0000000400000020: MI_ARB_CHECK
   0x02800100
0x0000000400000024: MEDIA_CURBE_LOAD
   0x70010002 0x00000000 0x00000020 0x40000180
0x0000000400000034: GPGPU_WALKER
   0x7105000d 0x00000000 0x00000000 0x00000000 0x40000003 0x00000000 0x00000000 0x00000001
   0x00000000 0x00000000 0x0000004c 0x00000000 0x00000001 0x0000ffff 0xffffffff
0x0000000400000070: MEDIA_STATE_FLUSH
   0x70040000 0x00000000
0x0000000400000078: MEDIA_CURBE_LOAD
   0x70010002 0x00000000 0x00000020 0x40001400
0x0000000400000088: GPGPU_WALKER
   0x7105000d 0x00000000 0x00000000 0x00000000 0x40000003 0x00000000 0x00000000 0x00000017
   0x00000000 0x00000000 0x00000001 0x00000000 0x00000001 0x0000ffff 0xffffffff
0x00000004000000c4: MEDIA_STATE_FLUSH
   0x70040000 0x00000000
0x00000004000000cc: MEDIA_CURBE_LOAD
   0x70010002 0x00000000 0x00000020 0x40002680
0x00000004000000dc: GPGPU_WALKER
   0x7105000d 0x00000000 0x00000000 0x00000000 0x40000003 0x00000000 0x00000000 0x00000001
   0x00000000 0x00000000 0x00000001 0x00000000 0x000000d5 0x0000ffff 0xffffffff
0x0000000400000118: MEDIA_STATE_FLUSH
   0x70040000 0x00000000
0x0000000400000120: MEDIA_CURBE_LOAD
   0x70010002 0x00000000 0x00000020 0x40003900
0x0000000400000130: GPGPU_WALKER
   0x7105000d 0x00000000 0x00000000 0x00000000 0x40000003 0x00000000 0x00000000 0x00000001
   0x00000000 0x00000000 0x000000dc 0x00000000 0x00000001 0x0000ffff 0xffffffff
  Pass (Pass)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31384>
2026-05-06 09:49:52 +00:00
Lionel Landwerlin
50aee34651 anv: expose VK_EXT_device_generated_commands by default on Gfx12.5+
Prior generations are kept under experimental until we implement a
more memory efficient preprocess buffer solution.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/14890
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/12380
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31384>
2026-05-06 09:49:51 +00:00
Lionel Landwerlin
e69062f8c9 anv: track generated commands work with perfetto
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31384>
2026-05-06 09:49:50 +00:00
Lionel Landwerlin
badcfc164d anv: handle preprocess buffer creation on <= Gfx12.0
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31384>
2026-05-06 09:49:48 +00:00
Lionel Landwerlin
d1ef313466 anv: add barrier flags handling for preprocess buffers
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31384>
2026-05-06 09:49:48 +00:00
Lionel Landwerlin
71732d79ac anv: implement generated preprocess & execute
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31384>
2026-05-06 09:49:48 +00:00
Lionel Landwerlin
80bb2ddb77 anv: handle descriptor binding with DGC
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31384>
2026-05-06 09:49:47 +00:00
Lionel Landwerlin
08c5e2854a anv: enable generation shader calls
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31384>
2026-05-06 09:49:47 +00:00
Lionel Landwerlin
5c3deebd6f anv: allow simple shader spilling for complex ones
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31384>
2026-05-06 09:49:46 +00:00
Lionel Landwerlin
068351f848 anv: add unspecified internal kernel send count support
Some kernel will be to large and potentially change too often to
really have a consistent count.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31384>
2026-05-06 09:49:46 +00:00
Lionel Landwerlin
fb26ed6bf7 anv: add indirect command layout support
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31384>
2026-05-06 09:49:45 +00:00
Lionel Landwerlin
68885511d2 anv: add support for indirect execution set
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31384>
2026-05-06 09:49:45 +00:00
Lionel Landwerlin
c6dc2df9e5 vulkan: add pipeline helper to retrieve scratch-size/ray-queries
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31384>
2026-05-06 09:49:45 +00:00
Lionel Landwerlin
35b0d3569e anv: program relative push set offset for descriptor buffers device bindable shaders
Up to now all push descriptor accesses where going through the binding
table. That's not going to be the case anymore with descriptor buffers
device bindable shaders. Those will do A64 messages to read the
descriptor buffer (for example when build a bounded 64bit address for
storage buffers, or 64bit image format atomic emulation, etc...)

We need to have the offset relative to the push descriptor heap
(internal_state_heap in this case).

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31384>
2026-05-06 09:49:45 +00:00
Lionel Landwerlin
4960e103ef anv: add a helper to flush the descriptors for indirect compute execution
When we don't know what shader is executed. We'll still have the bind
map from the indirect execution set.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31384>
2026-05-06 09:49:44 +00:00
Lionel Landwerlin
6f5d30c0a2 anv: add apply_layout support for device bindable shaders/pipelines
We consider them like bindless stages (no binding table) as much as
possible.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31384>
2026-05-06 09:49:44 +00:00
Lionel Landwerlin
af8c85b5bd anv/apply_layout: use the resource index to compute descriptor buffer addresses
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31384>
2026-05-06 09:49:44 +00:00
Lionel Landwerlin
1281e2b9a0 anv/intel: add device generated commands shaders
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31384>
2026-05-06 09:49:43 +00:00
Lionel Landwerlin
c85647b968 anv: move a bunch of structures to anv_types.h
We'll want to access those on the device, so having them without any
host related things is nice.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31384>
2026-05-06 09:49:43 +00:00
Lionel Landwerlin
edc2fdf258 anv: enable compute state flushing with indirect state
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31384>
2026-05-06 09:49:43 +00:00
Lionel Landwerlin
22ab95ae10 anv: expose RT state flushing
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31384>
2026-05-06 09:49:42 +00:00
Lionel Landwerlin
0ef0b358da anv: expose non binding-table/push-pointer flushing
It'll be useful for DGC preprocessing where we need to extract some
state programming from the command buffer, yet pointer programming is
not required to be flushed.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31384>
2026-05-06 09:49:42 +00:00
Lionel Landwerlin
c30a4d4fdb anv/brw/nir: fix wa_18019110168
Several things were wrong :
  - incorrect offset in the FS push constant data
  - incorrect encoding of the 32bit values with 2 fields (remap table offset & provoking vertex)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31384>
2026-05-06 09:49:41 +00:00
Lionel Landwerlin
b8f5b58bf1 anv: print out the content of the printf buffer at vkDestroyDevice
In case the device wasn't waited on to be idle.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31384>
2026-05-06 09:49:41 +00:00
Daivik Bhatia
a8c7a25fb1 broadcom/compiler: Add explicit NOP instruction at page boundaries
The QPU prefetches the next instruction during shader execution.
If the shader assembly size perfectly aligns with a page boundary,
the prefetching mechanism reads past the compiled boundary,
leading to an MMU error.

This commit insert an explicit NOP instruction at the end of the shader
and increases the qpu_inst_count by one when the instruction count
exactly hits a page boundary. This ensures we don't fall off the end
of the last executable instruction page and into invalid memory.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40983>
2026-05-06 09:21:28 +00:00
Valentine Burley
864ccf6cf5 panfrost/ci: Document recent g610 flake
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: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41379>
2026-05-06 08:47:13 +00:00
Valentine Burley
f326f86ab0 panfrost/ci: Move t860 jobs to nightly
The rk3399-gru-kevin devices are not reliable enough to host pre-merge
jobs, so move them to nightly.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41379>
2026-05-06 08:47:13 +00:00
Jakob Sinclair
20cb81d389 panvk: Enable scissor_mode for draws
With some of the AFBC-fixes that went along with: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37771>,
we now set frame bounding boxes to the renderPass::renderArea instead
of the full frame size. By enabling scissor_mode, we can therefore
benefit from issuing less fragment jobs in certain cases.

Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41357>
2026-05-06 08:26:47 +00:00
Lishin
c50210ba7c broadcom/qpu: add V3D 7.1 disasm tests
Add QPU disassembler tests for V3D 7.1, covering
small immediates in both add and mul slots, as well
as setnnmode_uu paired with v8dot.

Assisted-by: OpenAI Codex
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41280>
2026-05-06 07:33:42 +00:00
Ahmed Hesham
2b1d9a2afc 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>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41098>
2026-05-06 06:57:58 +00:00
Collabora's Gfx CI Team
f6b7a40571 Uprev VVL to 8474616c3095756c52c1b810b21bd1366b3fc909
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
cb2acdf7f4...8474616c30

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40883>
2026-05-06 05:59:18 +00:00
Job Noorman
f267e7797f ir3: allow const src0 for ldg.a/stg.a/ray_intersection
While they allow a const src, they don't allow the full range of const
registers since the encoding only uses 8 bits. Add a new helper
(ir3_valid_const) that indicates this and use that in ir3_cp.

Totals from 2278 (1.29% of 176266) affected shaders:
MaxWaves: 30124 -> 30376 (+0.84%)
Instrs: 1472806 -> 1468750 (-0.28%); split: -0.44%, +0.16%
CodeSize: 2990430 -> 2967568 (-0.76%); split: -0.88%, +0.11%
NOPs: 244627 -> 246385 (+0.72%); split: -1.71%, +2.43%
MOVs: 51408 -> 45667 (-11.17%); split: -13.16%, +1.99%
Full: 35639 -> 35216 (-1.19%)
(ss): 46519 -> 42591 (-8.44%); split: -12.16%, +3.71%
(sy): 16763 -> 17269 (+3.02%); split: -1.35%, +4.37%
(ss)-stall: 187784 -> 180294 (-3.99%); split: -9.06%, +5.07%
(sy)-stall: 922477 -> 936696 (+1.54%); split: -3.40%, +4.94%
Cat0: 268783 -> 270558 (+0.66%); split: -1.54%, +2.20%
Cat1: 63982 -> 58277 (-8.92%); split: -10.59%, +1.68%
Cat2: 523798 -> 523707 (-0.02%)
Cat7: 47476 -> 47441 (-0.07%); split: -0.11%, +0.03%

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41365>
2026-05-06 05:26:49 +00:00
Job Noorman
8bd0212874 ir3/cp: support propagating const vecs
Some instructions (e.g., cat6) support using a const vec (i.e., multiple
consecutive const registers) as src. Add support for cp'ing collects of
consecutive const registers.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41365>
2026-05-06 05:26:49 +00:00
Job Noorman
c67118a6eb 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")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41263>
2026-05-06 05:03:14 +00:00
Job Noorman
c50c06d83f 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")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41263>
2026-05-06 05:03:14 +00:00
Emma Anholt
5674327297 screenshot-layer: Wait on the fence before fallible operations.
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
We want to be sure that the fence isn't destroyed before we've waited on
it, so do that before the fallible fs/png operations.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41299>
2026-05-06 01:10:04 +00:00
Emma Anholt
25b2865146 screenshot-layer: Fix race on writing the .pngs vs device destroy.
The writePNG thread function accessed the VkDevice, but the layer had no
joining of the thread on device destroy.  Instead of rolling our own job
queue for the writePNG job, reuse u_queue, which handles all the hard
stuff for us.

Assisted-by: Claude Opus 4.6
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41299>
2026-05-06 01:10:04 +00:00
Emma Anholt
3512886aa7 screenshot-layer: Clean up the lifetime management of the copyDone fence.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41299>
2026-05-06 01:10:04 +00:00
Emma Anholt
0fc106823c screenshot-layer: Fix rename() to final png before the file is flushed.
If the app exited before the thread was finished, then we might get an
incomplete png at the final filename.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41299>
2026-05-06 01:10:04 +00:00
Emma Anholt
a2f4977e7f screenshot-layer: Fix a bunch of unused variable warnings.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41299>
2026-05-06 01:10:04 +00:00
Emma Anholt
25723e3a37 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")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41299>
2026-05-06 01:10:04 +00:00
Vinson Lee
4c46cd8e9d 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>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41325>
2026-05-06 00:39:35 +00:00