Commit graph

222035 commits

Author SHA1 Message Date
Samuel Pitoiset
87be392251 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>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41335>
2026-05-05 06:37:57 +00:00
Valentine Burley
39406b8e83 tu: Add shared image support on Android
ANB shared image is required for KHR_shared_presentable_image support.

https://android.googlesource.com/platform/frameworks/native/+/refs/heads/android16-qpr2-release/vulkan/include/vulkan/vk_android_native_buffer.h#154

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41195>
2026-05-05 06:09:21 +00:00
Valentine Burley
924e86b957 tu: Move Android extensions into main list
No reason for these to be separated or be guarded by DETECT_OS_ANDROID.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41195>
2026-05-05 06:09:21 +00:00
Job Noorman
6d6efc332a ir3: enable opt_offsets for load/store_global_offset
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41342>
2026-05-05 06:25:49 +02:00
Job Noorman
97edf88d5f ir3: move feature check down in ir3_nir_max_imm_offset
We want to start using this function for non-SSBO intrinsics, so don't
bail out early.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41342>
2026-05-05 06:25:49 +02:00
Job Noorman
0703f27d6a nir/opt_offsets: add support for @load/store_global_ir3
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41342>
2026-05-05 06:25:49 +02:00
Job Noorman
c784af5ca0 ir3: always use byte offset for @load/store_global_ir3
Before a7xx, ldg/stg.a use an offset in units of their type size while
on a7xx and later, the offset is always in bytes. Currently,
@load/store_global_ir3 take their offset in dwords (32-bits). This has a
few downsides: offsets need an extra shl during codegen on a7xx and
addressing sub-dword-aligned addresses is only possible by doing 64-bit
math on the base address.

Improve the situation by always using a byte offset for
@load/store_global_ir3 and adding the offset_shift index to support type
units pre-a7xx. While we're at it, add the base index as well to support
all ldg/stg.g features in @load/store_global_ir3.

Supporting these renewed intrinsics consists of two parts:
- ir3_nir_lower_io_offsets legalizes the offset_shift on a6xx: for
  ldg.a/stg.a, the offset has to be in units of the type size so extra
  shifts are inserted to accomplish this if necessary. On a7xx, offsets
  are always in bytes so nothing needs to be done.
- The intrinsics are emitted as ldg/stg if the offset is a small enough
  constant and as ldg.a/stg.a otherwise. a6xx supports an extra shift
  for ldg.a/stg.a that only applies to the GPR offset (not the immediate
  base); NIR is pattern matched at this point to extract this if
  possible.

All users of @load/store_global_ir3 are updated to generate the offset
in units of bytes. ir3_nir_analyze_ubo_ranges is updated to take the new
offset_shift into account.

Totals from 2029 (1.15% of 176266) affected shaders:
MaxWaves: 26728 -> 26660 (-0.25%); split: +0.01%, -0.26%
Instrs: 1314089 -> 1278603 (-2.70%); split: -2.72%, +0.02%
CodeSize: 2739108 -> 2633236 (-3.87%); split: -3.87%, +0.01%
NOPs: 197537 -> 200843 (+1.67%); split: -1.62%, +3.30%
MOVs: 43771 -> 44025 (+0.58%); split: -1.11%, +1.69%
Full: 31849 -> 31948 (+0.31%); split: -0.03%, +0.34%
(ss): 37965 -> 42027 (+10.70%); split: -3.47%, +14.17%
(sy): 13752 -> 13566 (-1.35%); split: -4.04%, +2.68%
(ss)-stall: 154238 -> 170353 (+10.45%); split: -1.72%, +12.16%
(sy)-stall: 804442 -> 806518 (+0.26%); split: -4.65%, +4.91%
Preamble Instrs: 326728 -> 293488 (-10.17%)
Cat0: 217926 -> 220947 (+1.39%); split: -1.58%, +2.96%
Cat1: 50182 -> 50446 (+0.53%); split: -0.97%, +1.49%
Cat2: 460987 -> 452101 (-1.93%); split: -2.26%, +0.33%
Cat3: 390696 -> 361271 (-7.53%)
Cat7: 39148 -> 38688 (-1.18%); split: -1.24%, +0.06%

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41342>
2026-05-05 06:25:49 +02:00
Job Noorman
6158072e6f ir3/isa: use same src for ldg.a OFF field on a6xx/a7xx
This makes it slightly easier to generate ldg.a for the different
generations in the same code path.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41342>
2026-05-05 06:25:49 +02:00
Job Noorman
53d96aed05 nir/get_io_offset_src_number: support @load/store_global_ir3
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41342>
2026-05-05 06:25:49 +02:00
Faith Ekstrand
a9b28b9838 pan/nir: Lower texel buffers in nir_lower_tex()
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41036>
2026-05-05 01:27:16 +00:00
Faith Ekstrand
84bbfaa7e5 pan/bi: Delete the old texel buffer intrinsics
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41036>
2026-05-05 01:27:16 +00:00
Faith Ekstrand
b496d8e4f3 pan/nir: Use HW NIR intrinsics for texel buffer addresses
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41036>
2026-05-05 01:27:16 +00:00
Faith Ekstrand
7d5cb2884c pan/bi: Allow setting the table on lea_attr_pan
Also allow us to set AUTO32 while we're at it.

Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41036>
2026-05-05 01:27:16 +00:00
Faith Ekstrand
bf9fa6e619 pan/nir: Load texel buffer conversion descriptors in NIR
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41036>
2026-05-05 01:27:16 +00:00
Faith Ekstrand
6c9ffd782b pan/nir: Lower texturing ops in NIR on Bifrost
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41036>
2026-05-05 01:27:16 +00:00
Faith Ekstrand
05a066c921 pan/nir: Add bifrost support to pan_nir_lower_tex()
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41036>
2026-05-05 01:27:16 +00:00
Faith Ekstrand
2369808cd1 pan,nir: Add Bifrost texturing intrinsics
These are funky enough that they make more sense as intrinsics than
texture opcodes.

Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41036>
2026-05-05 01:27:16 +00:00
Faith Ekstrand
4dfb07e7eb pan/bi: Implement nir_op_f2[iu]32_rtne
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41036>
2026-05-05 01:27:16 +00:00
Faith Ekstrand
0d549f5bde nir: Add a new nir_op_f2u32_rtne
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41036>
2026-05-05 01:27:16 +00:00
Faith Ekstrand
55c4595b2a pan/nir: Use the NIR lowering on Valhall+
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41036>
2026-05-05 01:27:16 +00:00
Faith Ekstrand
ddfde51985 pan/nir: Add a pass for lowering texture ops in NIR on Valhall+
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41036>
2026-05-05 01:27:16 +00:00
Faith Ekstrand
ffae24bfe2 panvk: Implement bitfield_select
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41036>
2026-05-05 01:27:16 +00:00
Faith Ekstrand
58cba7887a nir: Add a new nir_texop_gradient_pan
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41036>
2026-05-05 01:27:16 +00:00
Faith Ekstrand
e0fffabda7 nir/builder: Allow backend1/2 in nir_build_tex()
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41036>
2026-05-05 01:27:16 +00:00
Faith Ekstrand
337aaa0ab9 pan,nir: Add cube face intrinsics
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41036>
2026-05-05 01:27:15 +00:00
Faith Ekstrand
c99f97efd3 panfrost: Add and use a new pan_nir_res_handle() helper
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41036>
2026-05-05 01:27:15 +00:00
Yiwei Zhang
1883f3094f ci: uprev virglrenderer
This uprev:
- brings in vrend fixes with virgl ci expectation updated
- enables new venus extensions support
- drops render-server-worker since process isolation is the default
- updates venus ci expectations

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41331>
2026-05-05 00:41:46 +00:00
Jesse Natalie
758a0e1ad9 d3d12: proactively trim completed pending-free entries
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Assisted-by: Claude Opus 4.7
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41322>
2026-05-05 00:22:44 +00:00
Jesse Natalie
955b2672d3 d3d12: drop peer-batch peeking in resource_is_busy / wait_idle
Assisted-by: Claude Opus 4.7
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41322>
2026-05-05 00:22:44 +00:00
Jesse Natalie
18012b69ab d3d12: implement pb_fence vtbl for cache/slab reuse
Assisted-by: Claude Opus 4.7
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41322>
2026-05-05 00:22:44 +00:00
Jesse Natalie
b8f2b968de d3d12: reclaim in-flight BO memory on allocation failure
Assisted-by: Claude Opus 4.7
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41322>
2026-05-05 00:22:43 +00:00
Jesse Natalie
a1c7f7479d d3d12: transfer batch->bos refs to screen at submit
Assisted-by: Claude Opus 4.7
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41322>
2026-05-05 00:22:43 +00:00
Jesse Natalie
a518b7f103 d3d12: transfer batch local_bos refs to screen at submit
Assisted-by: Claude Opus 4.7
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41322>
2026-05-05 00:22:42 +00:00
Jesse Natalie
3e47a65811 d3d12: clear stale per-context BO state at context destroy
Assisted-by: Claude Opus 4.7
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41322>
2026-05-05 00:22:41 +00:00
Jesse Natalie
381b56389c d3d12: add screen pending-free list plumbing
Assisted-by: Claude Opus 4.7
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41322>
2026-05-05 00:22:41 +00:00
Konstantin Seurer
af746cc2a6 radv/rt: Use 64-bit keys for gfx11-
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This has a bit of sorting overhead, but can significantly increase BVH
quality especially in big BVHs. gfx12 is faster at intersecting, so only
enable for gfx11 and earlier right now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41300>
2026-05-04 20:42:50 +00:00
Konstantin Seurer
c432ffc5ce vulkan: Implement 64-bit morton codes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41300>
2026-05-04 20:42:50 +00:00
Konstantin Seurer
74e21c2c59 vulkan: Rename key_id_pair to key32_id_pair
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41300>
2026-05-04 20:42:49 +00:00
Konstantin Seurer
04463fe91e vulkan: Rename radix_sort to radix_sort_u64
Preparation for optionally building with 96bit radix sort.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41300>
2026-05-04 20:42:49 +00:00
Konstantin Seurer
a1c2b96cd1 vulkan/radix_sort: Add support for 96-bit keys
64-bit morton codes are required for decent lbvh tlas builds since the
scene bounds are usually much bigger than the area that is actually
important.

The changes were done without understanding the code but they seem to
work.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41300>
2026-05-04 20:42:49 +00:00
José Roberto de Souza
a2175b7ec3 iris: Improve and standardize the behavior of madvice in i915
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This removes the conversion between iris_madvice and i915 values, placing it by
a static assert in case this values ever don't match.

Also adds a warn once in case of DRM_IOCTL_I915_GEM_MADVISE ever fails.

As at last in case of failure of DRM_IOCTL_I915_GEM_MADVISE returns as if the
bo is not retained anymore to have a safe behavior.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Suggested-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40573>
2026-05-04 20:11:23 +00:00
José Roberto de Souza
cbc1ec206d intel: Add support for madvise purgeable VMAs in Xe KMD
Initially this uAPI was part of the first public version of Xe KMD uAPI but as
it did not had any users it was removed in some of fixes releases of the
Linux version that added Xe KMD but I missed to update the comment in Mesa.

At that time this uAPI had a restriction that did not allowed us to use, it
was compatible with VMs created with DRM_XE_VM_CREATE_FLAG_SCRATCH_PAGE but now
this flag is supported so here implementing it.

Link: https://patchwork.freedesktop.org/series/156651/
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40573>
2026-05-04 20:11:23 +00:00
José Roberto de Souza
b2293977e4 intel: Sync xe_drm.h
Sync with:
    commit a6fe8bd56f7344b0c42f287c4b744d4d43e31ebe
    Merge: 0389aa700912 314f6179e370
    Author: Dave Airlie <airlied@redhat.com>
    Date:   Thu Apr 23 16:01:08 2026 +1000

        Merge tag 'drm-intel-next-fixes-2026-04-22' of https://gitlab.freedesktop.org/drm/i915/kernel

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40573>
2026-05-04 20:11:23 +00:00
Caleb Callaway
0d9ae02665 docs: fix Intel tracepoints.py path
Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40988>
2026-05-04 20:06:17 +00:00
Gurchetan Singh
b5f91ed589 gfxstream: emit global state wrapped decoding for vkCmdEvent
Helpful for gfxstream-on-lavapipe.

Test: launch_cvd --gpu_mode=gfxstream_guest_angle_host_lavapipe

Reviewed-by: David Gilhooley <djgilhooley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41306>
2026-05-04 19:49:52 +00:00
Serdar Kocdemir
4ac60d221f gfxstream: some cleanup on device extension allow list
Remove duplicated items, use KHR version of vertex attrib divisor
extension, re-enable VK_KHR_16bit_storage.

Test: CI

Reviewed-by: David Gilhooley <djgilhooley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41306>
2026-05-04 19:49:52 +00:00
Mike Blumenkrantz
7a56d8112f vulkan: update spec to 1.4.350
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41317>
2026-05-04 19:11:49 +00:00
Eric Guo
352a8d6beb pan/compiler: Clamp fp16 ldexp exponent range
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Fix OpenCL-CTS error in `math_brute_force/test_bruteforce -w ldexp`

Valhall LDEXP.v2f16 takes a 16-bit exponent, while NIR ldexp uses a
32-bit exponent. Truncating large exponents can flip overflow into
underflow or leave huge 16-bit exponents to hardware behavior that does
not match OpenCL's expected signed infinity/zero results.

Clamp the exponent to a range sufficient to overflow or underflow all
fp16 values before lowering to ldexp16_pan.

Signed-off-by: Eric Guo <eric.guo@nxp.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/41234>
2026-05-04 17:59:18 +00:00
Rhys Perry
081feabf9c nir/search: fix nir_algebraic_automaton after constant folding op(bcsel)
Likely fixes https://gitlab.freedesktop.org/mesa/mesa/-/jobs/98917704

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Fixes: f4812dc11d ("nir/opt_constant_folding: constant-fold op(bcsel(), #c) -> bcsel(.., #c1, #c2)")
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41343>
2026-05-04 17:27:38 +00:00
Samuel Pitoiset
f47e7b7bd5 radv: bump VkConformanceVersion to 1.4.5.3
This property is unrelated to the CTS conformance process from Khronos,
it just means that the driver passes that CTS version, even if not
"officially" conformant.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41258>
2026-05-04 17:05:47 +00:00