Commit graph

207087 commits

Author SHA1 Message Date
Mary Guillemard
145b8540e5 nvk: Advertises VK_EXT_mesh_shader
Signed-off-by: Mary Guillemard <mary@mary.zone>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Tested-by: Thomas H.P. Andersen <phomes@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27196>
2026-06-02 10:34:32 +00:00
Mary Guillemard
cdb0dea462 nvk: Lower mesh and task shaders
Signed-off-by: Mary Guillemard <mary@mary.zone>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Tested-by: Thomas H.P. Andersen <phomes@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27196>
2026-06-02 10:34:32 +00:00
Mary Guillemard
cf29933de1 nvk: Only lower shared memory for compute shaders
It's a no-op on other stages so let's not run this.

Signed-off-by: Mary Guillemard <mary@mary.zone>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Tested-by: Thomas H.P. Andersen <phomes@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27196>
2026-06-02 10:34:32 +00:00
Mary Guillemard
424c466cdb nvk: Do not set lower_cs_local_index_to_id
With task/mesh shaders, we need that lowering to not happen.

Move to conditionally lower local invocation index with
nir_lower_compute_system_values_options in case of compute shader.

Signed-off-by: Mary Guillemard <mary@mary.zone>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Tested-by: Thomas H.P. Andersen <phomes@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27196>
2026-06-02 10:34:32 +00:00
Mary Guillemard
50b3ae08e7 nak: Implement mesh and task shader stages
Signed-off-by: Mary Guillemard <mary@mary.zone>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Tested-by: Thomas H.P. Andersen <phomes@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27196>
2026-06-02 10:34:31 +00:00
Mary Guillemard
368a6693bc nvk: Implement mesh draw commands
Signed-off-by: Mary Guillemard <mary@mary.zone>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Tested-by: Thomas H.P. Andersen <phomes@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27196>
2026-06-02 10:34:31 +00:00
Mary Guillemard
96ade67e2b nvk: Add support for mesh and task shader binding
Signed-off-by: Mary Guillemard <mary@mary.zone>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Tested-by: Thomas H.P. Andersen <phomes@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27196>
2026-06-02 10:34:31 +00:00
Mary Guillemard
3286990481 nvk: Prepare cbuf for mesh shader support
Signed-off-by: Mary Guillemard <mary@mary.zone>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Tested-by: Thomas H.P. Andersen <phomes@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27196>
2026-06-02 10:34:31 +00:00
Mary Guillemard
3348003735 nvk: Prepare nvk_shader for GS header upload for mesh shaders
This define structure and a way to upload the GS header when present.

Signed-off-by: Mary Guillemard <mary@mary.zone>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Tested-by: Thomas H.P. Andersen <phomes@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27196>
2026-06-02 10:34:31 +00:00
Mary Guillemard
1f31ec46be nak: Add a lowering pass for shared memory atomics in mesh stages
This add a new lowering pass for shared memory atomics that will be used
for mesh/task stages.

Signed-off-by: Mary Guillemard <mary@mary.zone>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Tested-by: Thomas H.P. Andersen <phomes@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27196>
2026-06-02 10:34:31 +00:00
Mary Guillemard
b95dbc64bf nir,nak: Add match_any_nv
NVIDIA hardware have an instruction allowering you to retrive the mask
of active threads matching the same source value as the current
invocation.

This is going to be used by shared memory lowering for mesh / task
stages on NVK.

Signed-off-by: Mary Guillemard <mary@mary.zone>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Tested-by: Thomas H.P. Andersen <phomes@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27196>
2026-06-02 10:34:31 +00:00
Danylo Piliaiev
d88c183785 tu: Disable FS in some cases even when FS explicitly writes D/S
For example, the FS may write gl_SampleMask while color writes are
masked out and there is no depth attachment.
Note that the proprietary driver still considers more state when
disabling the FS, such as the depth test being disabled, and thus
disables the FS in cases where we do not. However, I think that is
too much of a stretch unless we find some real workload needing it.

This change also allows disabling an FS that has discard.

This requires being careful around occlusion queries, since when one
is enabled, we cannot disable an FS that can discard.

Found via gpu-ratemeter bench: vk.pix.noaa.output.color+z+samplemask.colormask=0

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41857>
2026-06-02 11:56:26 +02:00
Maíra Canal
c4a1d9583c etnaviv/ml: derive stride-2 destriding offsets from padding
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The destriding lowering hard-coded a special case for weight_width == 5
with a fallback "+1" branch that was only correct for 3x3 kernels.
Replace it with formulas derived from TFLite's SAME-padding rule for
stride 2:

The half-resolution expansion applied to the reshuffle output and to
the strided_to_normal() input is:

  weight_width / 2

which gives 1 for 3x3, 2 for 5x5, and 3 for 7x7 kernels.

The reshuffle window start offset is:

  (weight_width + input_width % 2 - 2) / 2

This folds the previous odd-input fixup into the same expression
preserves the existing 3x3 and 5x5 behavior while extending the
lowering to wider odd kernels such as 7x7.

Fixes Models.Op/inception_000, which uses Inception V1's Conv2d_1a_7x7,
in the Teflon test suite.

Signed-off-by: Maíra Canal <mairacanal@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41774>
2026-06-02 08:13:11 +00:00
David Rosca
c24e4085a1 radeonsi/mm: Set PIPE_RESOURCE_FLAG_UNMAPPABLE for buffers
This creates the BO with AMDGPU_GEM_CREATE_NO_CPU_ACCESS for buffers
that we don't map.

Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41850>
2026-06-02 07:06:50 +00:00
David Rosca
633d931a95 radeonsi/mm: Add si_vid_create_buffer and use it
Add a buffer create function that takes PIPE_RESOURCE_FLAG_* flags.
Disable suballocation for all buffers on UVD/VCE without VM support.

Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41850>
2026-06-02 07:06:50 +00:00
Serdar Kocdemir
ff67b27f48 gfxstream: disallow maintenance6 extension due to serialization bugs
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
VkBindMemoryStatus is using a pointer to VkResult but the value cannot
be correctly encoded and decoded with the current code generator. Until
the issues are fixed, the extension should not be used as it'll cause
cts failures and invalid behavior.

Test: dEQP-VK.memory.binding.maintenance6.*

Reviewed-by: Gurchetan Singh <gurchetan.singh.foss@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41893>
2026-06-01 22:41:37 +00:00
Bo Hu
3294675513 gfxstream: vk-snapshot: update handling of bufferview in vkUpdateDescriptorSets
Reviewed-by: Serdar Kocdemir <kocdemir@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41893>
2026-06-01 22:41:37 +00:00
Serdar Kocdemir
b786e19608 gfxstream: Fix codegen causing missing vulkan structures
Ordering of the extensions was affecting the codegen and some structures
were missing due to errors during codegen. One example is the custom
border color structure for the samplers, due to the reference from new
vkRegisterCustomBorderColorEXT function that's introduced with a
different extension VK_EXT_descriptor_heap. This CL adds a sorting
mechanism to generate code for supported extensions first to ensure
deepcopy and transform functions are created correctly.

Test: dEQP-VK.pipeline.*

Reviewed-by: Gurchetan Singh <gurchetan.singh.foss@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41893>
2026-06-01 22:41:37 +00:00
Serdar Kocdemir
ad2565bcc6 gfxstream: update codegen for host side vulkan header update to v1.4.350
Also enables VK_KHR_swapchain_maintenance1, as the EXT now aliases the
KHR version.

Test: codegen && CI

Reviewed-by: Gurchetan Singh <gurchetan.singh.foss@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41893>
2026-06-01 22:41:37 +00:00
Alyssa Rosenzweig
b4cd4428b3 intel/gen: drop noisy build spam
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Otherwise this shows up in the ninja build.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41944>
2026-06-01 21:02:09 +00:00
Alyssa Rosenzweig
7eb248ba9f intel/gen: remove dead #include
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41944>
2026-06-01 21:02:09 +00:00
Mary Guillemard
90d963d353 nir/nir_format_convert: Add missing u2f32 in nir_format_unpack_r9g9b9e5
Fix
"dEQP-VK.api.copy_and_blit.*.image_to_image.all_formats.color.2d_to_1d.*.e5b9g9r9_ufloat_pack32.*"
on HK.

Signed-off-by: Mary Guillemard <mary@mary.zone>
Fixes: 5f5f4474f6 ("nir: Add a format unpack helper and tests")
Reviewed-by: Janne Grunau <j@jannau.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41929>
2026-06-01 20:28:44 +00:00
Faith Ekstrand
00a407bbae nak: Use EnumAsU8 for RegFile
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41915>
2026-06-01 19:51:17 +00:00
Faith Ekstrand
3f18c81d4f compiler/rust: Add an EnumAsU8 trait
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41915>
2026-06-01 19:51:17 +00:00
Faith Ekstrand
fdc5d446ee compiler/rust/bitset: Add a new ConstBitSet type
Unlike BitSet, which is backed by a Vec<u32>, this is backed by a
fixed-length array is therefore Copy.  It's also mostly const so it can
be constructed and used from const contexts.  Because of the const
rules, it's a bit more rigid and can only really accept keys which are
unsigned integer types.

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41915>
2026-06-01 19:51:17 +00:00
Faith Ekstrand
76e3ecd97a compiler/rust/bitset: Implement Into/FromBitIndex for more types
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41915>
2026-06-01 19:51:17 +00:00
Faith Ekstrand
63d2ccd64b compiler/rust/bitset: Generalize BitSetIterator
It now iterates over a slice instead of a BitSet

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41915>
2026-06-01 19:51:17 +00:00
Faith Ekstrand
f43e57b3c0 compiler/rust/bitset: Add find_next_[un]set() helpers
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41915>
2026-06-01 19:51:17 +00:00
Faith Ekstrand
ffe6cdd52d compiler/rust/bitset: Don't reserve space in remove()
If the requested bit is past the end of the set, we can just return
false.  We don't have to grow the bitset.

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41915>
2026-06-01 19:51:16 +00:00
Faith Ekstrand
81c9eddb69 compiler/rust/bitset: Add a BitIndex helper struct
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41915>
2026-06-01 19:51:16 +00:00
Mike Blumenkrantz
fa867cf189 zink/bo: check for usage before completion when reclaiming bos
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
checking completion alone disregards submit_count, which is used to
determine the validity of any existing usage pointer. this could lead to
large numbers of bos with stale usage and infinite memory ballooning

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41936>
2026-06-01 19:20:59 +00:00
Mike Blumenkrantz
cf1ca02bd0 zink/bo: use pb_buffer_lean to save a little mem
vtbl is not used

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41936>
2026-06-01 19:20:59 +00:00
Mike Blumenkrantz
47142da666 zink/bo: use only a single layer of slabs
this is simpler and apparently faster

ref cf2dc2d512

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41936>
2026-06-01 19:20:58 +00:00
Mike Blumenkrantz
d898eee030 zink/bo: stop using pb_buffer vtable for destroy
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41936>
2026-06-01 19:20:58 +00:00
Mike Blumenkrantz
6df38a29e1 zink/bo: add an enum to disambiguate bo types
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41936>
2026-06-01 19:20:58 +00:00
Mike Blumenkrantz
4e000c1d98 zink/bo: reduce wasted memory due to the size tolerance in pb_cache
ref 5a3bacc376

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41936>
2026-06-01 19:20:58 +00:00
Mike Blumenkrantz
fce97b7f44 zink: handle uint wrapping with batch submit count
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41936>
2026-06-01 19:20:57 +00:00
Emma Anholt
10c227e934 tu: Always set the kernel's name for BOs.
Given the relative cost of the extra syscall and kmalloc for the name
versus actually allocating pages, we can just always do this and give a
better debugging experience by default.  We expect infrequent memory
allocation on Vulkan, anyway.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41878>
2026-06-01 18:32:10 +00:00
jglrxavpok
0ecffddaf0 RADV: Add object names inside address binding report and vm_fault
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41875>
2026-06-01 18:00:30 +00:00
Karmjit Mahil
3366fcff27 vc4: Use os_get_gpu_heap_size()
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: Karmjit Mahil <karmjit.mahil@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41242>
2026-06-01 17:32:50 +00:00
Karmjit Mahil
b8786ccf64 pvr: Add heap_memory_percent driconf support
To use the common function, this gives up the warning about the
memory being too small to meet the Vulkan spec for low end
devices.

Note: the common helper expose 25% for devices with <=1GiB but
to adhere to the Vulkan spec, the value is clamped to 1GiB.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41242>
2026-06-01 17:32:50 +00:00
Karmjit Mahil
16ab12fc5f crocus: Add heap_memory_percent driconf support
Note: the final `video_memory` size still involves
`aperture_threshold`.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41242>
2026-06-01 17:32:50 +00:00
Karmjit Mahil
de3b96ccd8 nvk: Add heap_memory_percent driconf support
The budget calculation has changes slightly as the budget scaling
is applied prior to adding the used up heap memory.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41242>
2026-06-01 17:32:50 +00:00
Karmjit Mahil
40076a2860 panfrost: Add heap_memory_percent driconf support
This also changes `video_memory` to use the heuristic instead of
the 10%, consistent with `max_mem_alloc_size`.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41242>
2026-06-01 17:32:50 +00:00
Karmjit Mahil
1090dd8427 panvk: Add heap_memory_percent driconf support
The budget calculation has changes slightly as the budget scaling
is applied prior to adding the used up heap memory.

This also introduces a new tier since the common helper exposes
25% of memory as heap on devices with <=1GiB memory. Previously
50% was being used.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41242>
2026-06-01 17:32:50 +00:00
Karmjit Mahil
77a7e390d4 freedreno: Add heap_memory_percent driconf support
Note: instead of using the common heuristic, the old behavior is
maintained.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41242>
2026-06-01 17:32:50 +00:00
Karmjit Mahil
aa09887c54 tu: Add heap_memory_percent driconf support
Also remove the clamping to va_size in the budget calculation
since the heap_size is already clamped to va_size and the budget
is clamped to heap_size.

This also introduces a new tier since the common helper exposes
25% of memory as heap on devices with <=1GiB memory. Previously
50% was being used.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41242>
2026-06-01 17:32:50 +00:00
Karmjit Mahil
f01837c8bb v3d: Add heap_memory_percent driconf support
Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41242>
2026-06-01 17:32:50 +00:00
Karmjit Mahil
72736c621a v3dv: Add heap_memory_percent driconf support
This also introduces a new tier since the common helper exposes
25% of memory as heap on devices with <=1GiB memory. Previously
50% was being used.

This also fixes `device->heap_used` not using atomic read.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41242>
2026-06-01 17:32:50 +00:00
Karmjit Mahil
926dad811e asahi: Add heap_memory_percent driconf support
Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41242>
2026-06-01 17:32:50 +00:00