Commit graph

223077 commits

Author SHA1 Message Date
Rhys Perry
81925d7f41 nir/algebraic: optimize ishl(iadd(iadd(iadd(a, #b), c), d), #e)
This improves combining of constants offsets into memory accesses in
dEQP-VK.compute.pipeline.cooperative_matrix.khr_a.subgroupscope.mul.float16_float16.buffer.colmajor.linear

fossil-db (gfx1201):
Totals from 121 (0.06% of 208640) affected shaders:
Instrs: 204278 -> 204199 (-0.04%); split: -0.06%, +0.03%
CodeSize: 1110856 -> 1110076 (-0.07%); split: -0.10%, +0.03%
VGPRs: 7620 -> 7680 (+0.79%); split: -0.16%, +0.94%
Latency: 1225169 -> 1225067 (-0.01%); split: -0.02%, +0.01%
InvThroughput: 191629 -> 191580 (-0.03%); split: -0.03%, +0.01%
SClause: 5732 -> 5731 (-0.02%)
Copies: 16358 -> 16356 (-0.01%); split: -0.02%, +0.01%
PreSGPRs: 5715 -> 5711 (-0.07%)
PreVGPRs: 5907 -> 5905 (-0.03%)
VALU: 112808 -> 112742 (-0.06%); split: -0.06%, +0.00%
SALU: 27121 -> 27113 (-0.03%)

fossil-db (gfx1201, dEQP-VK.compute.pipeline.cooperative_matrix.*):
Totals from 198 (12.20% of 1623) affected shaders:
Instrs: 13011 -> 11584 (-10.97%)
CodeSize: 90188 -> 77920 (-13.60%)
VGPRs: 3456 -> 2724 (-21.18%)
Latency: 144421 -> 142553 (-1.29%)
InvThroughput: 11158 -> 10608 (-4.93%)
Copies: 1119 -> 1117 (-0.18%)
PreSGPRs: 1954 -> 1857 (-4.96%)
PreVGPRs: 1675 -> 1354 (-19.16%)
VALU: 4894 -> 3476 (-28.97%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41653>
2026-05-27 14:44:59 +00:00
Rhys Perry
c3db34a525 nir/algebraic: optimize ishl(iadd(ishl, ishl))
This reduces arithmetic for cooperative matrix loads:
v_mbcnt_lo_u32_b32 v0, -1, 0
v_and_b32_e32 v1, 15, v0
v_lshrrev_b32_e32 v0, 4, v0
v_lshlrev_b32_e32 v1, 4, v1
v_lshl_add_u32 v0, v0, 3, v1
v_lshlrev_b32_e32 v0, 1, v0
->
v_mbcnt_lo_u32_b32 v0, -1, 0
v_and_b32_e32 v1, -16, v0
v_and_b32_e32 v0, 15, v0
v_lshl_add_u32 v0, v0, 5, v1

fossil-db (gfx1201):
Totals from 38 (0.02% of 208640) affected shaders:
Instrs: 42234 -> 42181 (-0.13%)
CodeSize: 232656 -> 232384 (-0.12%)
Latency: 128807 -> 128759 (-0.04%)
InvThroughput: 20860 -> 20850 (-0.05%)
VALU: 23035 -> 23013 (-0.10%)
SALU: 4790 -> 4784 (-0.13%)

fossil-db (gfx1201, dEQP-VK.compute.pipeline.cooperative_matrix.*):
Totals from 44 (2.71% of 1623) affected shaders:
Instrs: 46834 -> 46802 (-0.07%)
CodeSize: 287536 -> 287272 (-0.09%)
Latency: 100960 -> 100918 (-0.04%); split: -0.10%, +0.06%
InvThroughput: 21808 -> 21796 (-0.06%)
VALU: 19336 -> 19328 (-0.04%)
SALU: 10790 -> 10782 (-0.07%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41653>
2026-05-27 14:44:59 +00:00
Ahmed Hesham
b1c40839f2 pan/bi: Fix MKVEC.v2i8 src2 swizzle lowering
`MKVEC.v2i8` only has explicit lane selection for `src0` and `src1`.
`src` is implicitly read as `.b01`, so having a byte swizzle on `src2`
results in an instruction that cannot be encoded.

This fixes a failure in OpenCL-CTS when running `test_relationals
shuffle_copy`:
```
Invalid swizzle:
r0 = MKVEC.v2i8 r0^.b0, r0^.b3, r0^.b0

invalid_instruction: Assertion `!"Invalid instruction"' failed.
```

Fixes: bc7053a ("pan/bi: Add a lowering pass for MKVEC and SWZ")

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41109>
2026-05-27 14:06:44 +00:00
David Rosca
70329cf51f radeonsi/mm: Remove comment about kernel AV1 instance scheduling bug
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This has already been fixed. We still want to always use new context
with multi instance VCNs to utilize all instances, so the kernel bug
being present or not won't change the decision there.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41796>
2026-05-27 12:45:41 +00:00
David Rosca
187c723798 radeonsi/mm: Add support for 2-ref H264 encode
Two l0 refs are only supported for P-frames, so we must override
number of active refs in slice header in case the app tries to use
two l0 refs with B-frame.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15539
Tested-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41795>
2026-05-27 12:27:05 +00:00
Ahmed Hesham
617d4810c1 pan/bi: Fix function temp lowering with 64-bit pointers
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
OpenCL-CTS `test_basic vload_private` fails with the following
assertion:
```
src/compiler/nir/nir_lower_explicit_io.c:1649: lower_explicit_io_deref:
Assertion `addr->bit_size == deref->def.bit_size' failed.
```

Use `nir_address_format_32bit_offset_as_64bit` when the shader has
64-bit pointers. The scratch offset is still 32-bit, but the NIR address
value now matches the 64-bit derefs being lowered.

Fixes: 01e6a0555c ("pan/compiler: Rework scratch memory strategy")

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41769>
2026-05-27 11:49:20 +00:00
Luigi Santivetti
87e5fb2dcb pvr: re-use texture state words for each load op
When setting texture state words for load op clears simply inherit
them from the image view for a given attachment. The only piece of
information that needs updating is the offset relative to the view
index, because unknown at image creation time.

Fix dEQP-GLES:
  dEQP-GLES3.functional.texture.specification.texsubimage2d*

Fixes: e08916677 ("pvr: Add support for VK_ATTACHMENT_LOAD_OP_LOAD.")
Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41797>
2026-05-27 11:30:42 +00:00
Ahmed Hesham
2757fd1c44 pan/nir: Fix 8 and 16 bool reduction lowering
OpenCL-CTS `test_relationals relational_any` fails on Panfrost with an
assertion:
```
src/panfrost/compiler/pan_nir_lower_bool_to_bitsize.c:296:
lower_alu_instr: Assertion `alu->def.bit_size > 1' failed.
```

Bool to bitsize pass handles 2, 3 and 4-wide boolean reduction, but does
not handle 8 and 16, which fall-through to the default case, producing
1-bit bools.

Fixes: 5de5987678 ("nir,panfrost: Move lower_bool_to_bitsize to
panfrost")

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
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/41770>
2026-05-27 10:42:53 +00:00
Juan A. Suarez Romero
5a9e40f028 v3dv: disable threadeded submissions under drm-shim
Threaded submit relies on DRM syncobj wait ioctls blocking until the
GPU signals completion. Under drm-shim there is no real GPU, so
SYNCOBJ_WAIT returns immediately, creating a race between the submit
thread and vkQueueWaitIdle that leads to use-after-free crashes.

Detect if we are running under drm-shim by checking the DRM version
description, skip enabling threaded submit in that case.

Assisted-by: Cursor Agent (Opus 4.6)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41779>
2026-05-27 10:19:51 +00:00
Juan A. Suarez Romero
788979594e v3d/drm-shim: add GPU selection
So far with drm-shim we were always emulating V3D 4.2.

Now we always emulate V3D 7.1, but we allow selecting 4.2 through an
envvar: `V3D_GPU_ID=(42|71)`

Borrowed from etnaviv.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41779>
2026-05-27 10:19:50 +00:00
Juan A. Suarez Romero
1eae5ca94f v3dv: allow device with only render node
When using drm-shim there is no primary node for the driver. This is
fine, and hence we only mark that we don't have primary device.

This fixes using v3dv with drm-shim.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41779>
2026-05-27 10:19:50 +00:00
Juan A. Suarez Romero
6f8a692abc broadcom/simulator: V3D is always 4.2 or above
This is a leftover from when we were supporting V3D 4.1 or below.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41779>
2026-05-27 10:19:50 +00:00
Juan A. Suarez Romero
ddd12f2f3e loader: check if the kernel driver is amdgpu
This allows using drm-shim for an emulated driver in AMD GPU host.

Otherwise we need to set MESA_LOADER_DRIVER_OVERRIDE to the emulated
driver in order to make it working.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41779>
2026-05-27 10:19:50 +00:00
Marc Alcala Prieto
60d7aa4cb5 panfrost: Advertise Mali-G1-Premium and Mali-G1-Ultra support
Also, fix texel rate for G1-Pro variant 1.

And mention G1-Ultra, G1-Premium and G1-Pro in the release notes.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41639>
2026-05-27 11:33:20 +02:00
Pavel Ondračka
ec7fc5b61d i915/ci: update expectations
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41819>
2026-05-27 08:42:11 +00:00
Pavel Ondračka
d6714822b9 r300/ci: update expectations
Fallout from 7f2130c8

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41819>
2026-05-27 08:42:11 +00:00
Samuel Pitoiset
8444977b87 radv: rename master_fd to wsi_master_fd
It's only used for KHR_display.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41802>
2026-05-27 08:12:37 +00:00
Samuel Pitoiset
ff7c70cb5b radv: remove useless checks when creating a physical_device
drm_device can never be NULL now.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41802>
2026-05-27 08:12:37 +00:00
Samuel Pitoiset
9ab3828d5e radv: close the local fd slightly later when enumerating physical devices
So that it can be used to print GPU info.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41802>
2026-05-27 08:12:37 +00:00
Samuel Pitoiset
8c9995e7fa nir: add nir_lower_abort
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: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41651>
2026-05-27 06:37:03 +00:00
Samuel Pitoiset
88fb73c883 spirv: implement SPV_KHR_abort
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41651>
2026-05-27 06:37:03 +00:00
Samuel Pitoiset
f431d6bc87 nir: add new intrinsics for SPV_KHR_abort
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41651>
2026-05-27 06:37:03 +00:00
Andrzej Datczuk
691371a176 radv/rra,rmv: fix device id written into trace files
Both RRA and RMV used the PCI bus slot index in the trace device_id
field. On a typical single-GPU system, this resulted in "Device ID =
0000" displayed in RRA and RMV when traces were opened.

Match RGP dump, which reports device ids correctly.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41788>
2026-05-27 06:10:48 +00:00
Calder Young
bec5d3fff5 anv: Add workaround for vertex explosions in Split Fiction
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The game tries to use anisotropic filtering deep in some control flow
while updating a procedural displacement map, our sampling hardware
does not check the channel enable mask before calculating the
derivatives for each subspan, which causes it to get garbage for any
subspans that have partially disabled lanes.

This workaround converts any sample messages in fragment shaders that
have divergent control flow into a sample_d message with the derivatives
zero'd by software if some of the lanes are disabled.

Closes: #12796
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41716>
2026-05-26 21:21:55 +00:00
Calder Young
abe41f3acf brw: Add workaround pass for shaders using derivatives in control flow
Using derivatives in control flow that is not uniform across a subspan
will produce "undefined behavior" in GLSL.

On Intel hardware, this means the sampler will just always compute the
derivatives from whatever values are in each lane of a subspan in the
raw payload, regardless if some have been disabled and contain garbage.

Unfortunately, some applications seem to expect the sampler to ignore
disabled lanes in these cases instead of computing their derivatives
anyway from garbage, so for those we need a pass that finds any sample
messages in divergent control flow and converts them to a sample_d with
the derivatives zero'd by software if one or more lanes required to
calculate them have been disabled.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41716>
2026-05-26 21:21:55 +00:00
Olivia Lee
a1d6a34154 panvk: fix executable properties handling for IDVS varying shaders
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The previous implementation assumed that VS would have exactly two
executables, the HW variant position shader and the HW variant varying
shader, and that non-VS shaders would only have one executable per
variant. These assumptions are violated by avalon (which only has one
IDVS executable), by SW VS (which is a second VS variant, for three
total variants) and GS rast variants (which execute as a VS on the
hardware and so have two executables pre-avalon).

The new logic allows VS-staged variants to occur as a variant in any API
shader stage, and gives them either one or two executable indices
depending on whether the secondary is used.

Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Fixes: ff9907927f (panvk: Add basic infrastructure for shader variants)
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41631>
2026-05-26 19:57:35 +00:00
Benoît du Garreau
7683d552be docs: Add many missing features
I have only looked for unconditionally enabled features, so some are
probably still missing.

Signed-off-by: Benoît du Garreau <benoit@dugarreau.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40680>
2026-05-26 20:54:24 +02:00
ZhengMing
f0a6360e05 vulkan/wsi/win32: Prefer the more popular surface format on Windows
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15148
Signed-off-by: ZhengMing <zhengming@sanway.tech>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41777>
2026-05-26 15:23:24 +00:00
Valentine Burley
14be25c5fa tu: Merge tu_image_init and tu_image_update_layout
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
No longer need to split these up after c22e4022a8.
This is essentially a revert of 4b024a15f2.
No functional change.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41674>
2026-05-26 13:51:07 +00:00
Wujian Sun
cf8a61a071 mesa: Fix clipping order in _mesa_clip_blit()
The source and destination clipping were performed in the wrong order.
We should first clip the source rectangle against the source buffer
bounds, then clip the destination rectangle against the destination
buffer bounds (including scissor).

Fixed the webgl 2.0.0 test case:
conformance2/rendering/blitframebuffer-filter-outofbounds.html

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Wujian Sun <wujian.sun_1@nxp.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41718>
2026-05-26 13:15:45 +00:00
Gert Wollny
b22315f9a9 r600/sfn: run nir_opt_idiv_const
Suggested by Emma.

This reduces the number of ALU groups in the query result shader by
more than 50%.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41328>
2026-05-26 13:00:45 +00:00
Gert Wollny
fc582adfcb r600: replace TGSI query shader with nir
v2: - remove a few useless helpers
    - rename some variables
    - use some more nir with immediate codes (Emma)

v3: - use 64 bit integer ops
    - optimize generated code

v4: - fix typo (Emma)
    - Use boolean for available (Emma)
    - simplify some calculations (Emma)
    - replace "if" in timestamp code and bool conversion
      with "bcsel" (Emma)
    - clean up some variable names

v5: - remove iadd3 (Konstantin)

Assisted-by: Copilot (Auto mode)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41328>
2026-05-26 13:00:45 +00:00
Gert Wollny
60daea17ca r600: replace TGSI TCS passthrough with NIR version
We don't actually need to copy the vertex attributes because if no
TCS shader was given by the user TES simply is pointed to the VS
output in LDS that has the same layout the TCS shader would provide.

v2: with the lowering of the relevant intrinsics in place
    use nir_create_passthrough_tcs_impl to create the passthrough
    shader (like suggested by Mareco and Emma)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41328>
2026-05-26 13:00:45 +00:00
Gert Wollny
9e2d961e56 r600/sfn: Add lowering of tess inner and outer default intrinsics
These are UBO loads and so we do the lowering in nir.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41328>
2026-05-26 13:00:45 +00:00
squidbus
2d6ad3cba1 kk: Support VK_KHR_shader_untyped_pointers
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
With memcpy lowering and fix for infinite optimize loop on 4x16 packs,
passes `dEQP-VK.spirv_assembly.instruction.compute.untyped_pointers.*`.

Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41695>
2026-05-26 11:09:12 +00:00
Arjob Mukherjee
8ee23ece2b pvr: increase maxPerStageDescriptorStorageBuffers to 16
Zink implementation splits `maxPerStageDescriptorStorageBuffers` between
atomic buffers and `MaxShaderStorageBlocks` causing CTS tests to fail
because there is not enough SSBO blocks.

Also updated 'maxPerStageResources' for the current limits.

Fixes the following tests:

* KHR-GLES31.core.program_interface_query.ssb-types
* KHR-GLES31.core.compute_shader.pipeline-compute-chain
* KHR-GLES31.core.shader_storage_buffer_object.advanced-indirectAddressing-case1-cs
* KHR-GLES31.core.shader_storage_buffer_object.advanced-usage-sync-cs
* KHR-GLES31.core.shader_storage_buffer_object.advanced-indirectAddressing-case2-cs

Signed-off-by: Arjob Mukherjee <arjob.mukherjee@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41708>
2026-05-26 10:54:12 +00:00
squidbus
35ac0f78b1 kk: De-duplicate geometry unroll logic
Original poly code supports what we need now, so remove the
duplicated code and switch to that.

Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41568>
2026-05-26 10:39:00 +00:00
squidbus
7b938e8fe3 kk: Fix compute system value and algebric lowering in pre-compiles
Changes are the result of two issues:

- In library form, workgroup size is not lowered. Only once the
  pre-compiles are distinct variants with entry-points can we
  lower uses of the workgroup size input.

- Some unimplemented instructions like `ufind_msb` would make their
  way through to the final shader, if they are generated by other
  algebraic optimizations. `nir_opt_algebraic` needs to be run in a
  loop to ensure they are eliminated.

Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41568>
2026-05-26 10:39:00 +00:00
squidbus
bed2ba22f2 poly: Fix range used for index unroll bounds checks
The index buffer pointer is offset by the draw first index, so the
index buffer range needs to be offset by the same.

Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41568>
2026-05-26 10:39:00 +00:00
squidbus
69a5105aad poly: Refactor poly_unroll_restart for general purpose unrolling
Defines a more general purpose version of `poly_unroll_restart`
named `poly_unroll_geometry`, which allows unrolling without an
input index buffer by separating the input and output index sizes.
This allows it to be used for additional use cases, such as
unrolling triangle fans or changing index types, where the draw
may not necessarily be indexed or the input and output index types
are not the same.

`poly_unroll_restart` remains as an alias with the same declaration
as before.

Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41568>
2026-05-26 10:39:00 +00:00
Samuel Pitoiset
72f02d6e89 radv/amdgpu: fix releasing the mutex for virtio and RADV_PERFTEST=localbos
Found by inspection.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41755>
2026-05-26 10:18:50 +00:00
Samuel Pitoiset
473551ecd0 radv: determine supported syncobj types directly in the physical device
To remove the dependency on the winsys.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41755>
2026-05-26 10:18:50 +00:00
Samuel Pitoiset
b5403ff331 radv/amdgpu: simplify syncobj verifications during submissions
These are equivalent but do not rely on syncobj_sync_type.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41755>
2026-05-26 10:18:50 +00:00
Samuel Pitoiset
f8ce76e996 radv: remove declared but unused create_null_physical_device()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41755>
2026-05-26 10:18:50 +00:00
Samuel Pitoiset
921eedee8b radv: add a separate function to query allocated/usage for each heap
This is just a cleanup that will be useful for upcoming changes.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41755>
2026-05-26 10:18:50 +00:00
Samuel Pitoiset
25a53ab412 radv: pre-compute a mask of supported global queue priorities
That removes the winsys dependency when querying that.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41755>
2026-05-26 10:18:49 +00:00
Samuel Pitoiset
c1a3619d2c radv: use radv_device::ws directly for quering sync payloads
Easier to spot the remaining occurrences.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41755>
2026-05-26 10:18:49 +00:00
Christian Gmeiner
99400f272d etnaviv: blt: Add BLT format conversion support
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Until now the BLT engine only handled same-format blits. Teach it to
convert between the UNORM formats it can represent, so format-converting
blits no longer fall back to the 3D blitter.

The supported formats are A8R8G8B8, X8R8G8B8, A4R4G4B4, A1R5G5B5,
R5G6B5, R8G8, R8 and A2R10G10B10.

The BLT format names are BGRA-based, matching the PE-internal byte order,
so an identity swizzle is correct for all of these except A2R10G10B10.
That one the PE keeps in RGBA order, so pipe R lands in the BLT B position
and vice versa. blt_conversion_needs_channel_swap() captures this and
find_blt_conversion() derives the per-image swizzle.

SRGB variants share the BLT format of their UNORM sibling. For example
R8G8B8A8_UNORM and R8G8B8A8_SRGB both map to BLT_FORMAT_A8R8G8B8, and
the sRGB handling is carried separately via img->srgb.

No regressions in dEQP-GLES3.functional.fbo.blit.conversion.*.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39879>
2026-05-26 10:03:27 +00:00
Christian Gmeiner
4e5363a66c etnaviv: Map R8G8B8A8_SRGB to BLT_FORMAT_A8R8G8B8
Required for SRGB format conversion blits via the BLT engine.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39879>
2026-05-26 10:03:27 +00:00
Christian Gmeiner
4cb7c63f21 etnaviv: blt: Add sRGB support to blt_imginfo
Add sRGB field to blt_imginfo and use it to conditionally set the
BLT_SRC_IMAGE_CONFIG_SRGB and BLT_DEST_IMAGE_CONFIG_SRGB bits in
the BLT config register setup.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39879>
2026-05-26 10:03:27 +00:00