Commit graph

223405 commits

Author SHA1 Message Date
Karol Herbst
d25e7e330f nir/lower_alu: fix lower_fminmax_signed_zero for denorms
When both inputs are denorms, the bcsel picks the integer min/max result,
which does not flush denorms and therefore might return the wrong result.

Fixes OpenCL fmin/fmax on asahi.

Fixes: d238d766c6 ("nir: add lower_fminmax_signed_zero")

Reviewed-by: Mary Guillemard <mary@mary.zone>
Reviewed-by Janne Grunau <j@jannau.net>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41386>
2026-06-01 13:43:01 +00:00
Ken Xue
641d9f35ae radv: remove checking on the gralloc handle->numFds
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
numFds could be no less than 1 based on the number of plane(s) and
metadata(optional) fd in a gralloc buf handle. and amdgpu backend
of gralloc should make sure all plane bufs within same dma_buf fd
but different offset.

handle->data[0] already indicates dma_buf fd of plane(s) well.

Signed-off-by: Ken Xue <Ken.Xue@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41879>
2026-06-01 11:33:53 +00:00
Patrick Lerda
fa5ce01ea3 r600: update muladd support configuration
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This change updates the configuration to fix some
regressions with the fpu64 emulation.

Note: The r600 has a single precision fma op code which
breaks the fpu64 emulation if used as nir_op_ffma (It
likely returns a double).

This change was tested on palm and barts.
Fixes: aeea2e7c1f ("nir: add fmad_or_ffma helpers and use it in lower_double_ops")

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41781>
2026-06-01 11:08:55 +00:00
Icenowy Zheng
19d786ae6a pipe-loader: use zink for powervr device nodes
The Mesa PowerVR driver is Vulkan only, and Zink is used solely for
APIs implemented by Gallium.

Change the driver name to "zink" if the device node's driver is
"powervr".

Backport-to: 26.1
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41737>
2026-06-01 09:32:08 +00:00
Icenowy Zheng
da11aac770 Revert "pipe-loader: fallback to zink instead of kmsro for render nodes"
This reverts commit adf18abb40.

Some setups rely on matching kmsro for render nodes (e.g. clients to
wlroot-based compositors).

Backport-to: 26.1
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41737>
2026-06-01 09:32:08 +00:00
Collabora's Gfx CI Team
e569df0145 Uprev VVL to 315d28985ebd1ff9a2e4380e34ed2d8ebe487531
36187ee9f2...315d28985e

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41792>
2026-06-01 08:57:49 +00:00
Kenneth Graunke
405c99d0a6 jay: Add URB load support
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41821>
2026-06-01 08:30:25 +00:00
Kenneth Graunke
9c8f7c481f brw: Fold constants after nir_lower_io for VS/GS/TES outputs
brw_nir_lower_deferred_urb_writes assumes that constant offsets will be
properly folded.  In brw itself we call the big optimization loop which
takes care of this, but jay doesn't do that in-between.

At any rate, nir_lower_io generates a lot of address math that really
ought to get cleaned up, so it seems like a good point to call it here.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41821>
2026-06-01 08:30:25 +00:00
Kenneth Graunke
fb99a109e4 brw: Fix mistake in brw_nir_lower_deferred_urb_writes
I meant to add these together, not put a random semicolon in the middle
of the expression which meant the offset got tossed on the floor.

Fixes: 6fbe201a12 ("brw: Convert VS/TES/GS outputs to URB intrinsics.")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41821>
2026-06-01 08:30:25 +00:00
Kenneth Graunke
c798a9df1c brw: Refactor urb_read_length setting for TES
We now calculate it when emitting push input loads at the NIR level,
rather than in the backend.

v2: Fix missing interaction with legacy tesslevel remapping

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41821>
2026-06-01 08:30:24 +00:00
Kenneth Graunke
4dfa11a9d6 brw: Ensure entire input load fits in push data
We were seeing if the start of the load was within the push range,
rather than the entire load.  (We could also split loads, but that
seems needlessly complex.)

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41821>
2026-06-01 08:30:24 +00:00
Kenneth Graunke
f4260b15cf brw: Fix URB read length for tessellation evaluation shaders
Calculate the end of our read as a byte offset and divide by the 32B
unit of URB reads.  We were calculating 1 byte beyond the start offset
and dividing by 8 (the number of 4 byte DWords in 1 unit of URB read).

Cc: mesa-stable
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41821>
2026-06-01 08:30:24 +00:00
Kenneth Graunke
887c04239f anv: Drop TES dispatch mode asserts
SIMD4x2 mode is only supported by elk which anv doesn't use.  iris
doesn't check this.  Eventually we should probably just demote the
dispatch_mode field to the stages that still need it.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41821>
2026-06-01 08:30:23 +00:00
David Rosca
88577c5e54 ac/parse_ib: Add VCN timestamp command
Also remove OP_ prefix from other common commands.

Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41861>
2026-06-01 07:34:11 +00:00
David Rosca
2aec2e8dba ac/parse_ib: Add VCN decode queue parsing
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41861>
2026-06-01 07:34:11 +00:00
Samuel Pitoiset
e32d518819 radv: cleanup conditional header includes
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/41865>
2026-06-01 06:35:31 +00:00
Faith Ekstrand
fd9c2ce73d compiler/rust/nir: Add helpers for getting ALU input/output types
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/41896>
2026-06-01 03:24:17 +00:00
Faith Ekstrand
52e2439973 compiler/rust/nir: Add structured block iterators
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41896>
2026-06-01 03:24:17 +00:00
Faith Ekstrand
4d129b10ac compiler/rust: Add a nir_shader::to_string()
Annoyingly, this has to take a &mut nir_shader because printing
re-indexes SSA value.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41896>
2026-06-01 03:24:16 +00:00
Faith Ekstrand
5922db15bf compiler/rust: Add a nir_shader::get_entrypoint() helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41896>
2026-06-01 03:24:16 +00:00
Faith Ekstrand
8b71407672 compiler/rust/bindings: Add util_dyarray
NIR uses dynarray for predecessors now so we should include it in the
bindings to keep other users from pulling in a duplicate.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41896>
2026-06-01 03:24:16 +00:00
Faith Ekstrand
0d8ca7cc6c meson: Suffix compiler/rust bindings with _compiler_rs_extern
This prevents symbol collisions with other crates in Mesa.

Fixes: b60694b91e ("compiler/rust: Add a float16 wrapper")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41896>
2026-06-01 03:24:16 +00:00
Daivik Bhatia
993d4f5233 pan/nir: fix GNU compilation error with clang
Swapping `{}` for `{0}` to fix a GNU empty initializer
error when building with Clang.

Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41864>
2026-06-01 02:59:38 +00:00
Benjamin Otte
364ae96477 Revert "lavapipe: Don't advertise support for multiplane drm formats"
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
These formats are supported now, so we should not bail anymore.

This reverts commit 0941af995a.

Fixes: 77c630b0b01eaf1f078338296d02d952277c4e33
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41776>
2026-05-31 18:53:28 +02:00
Konstantin Seurer
40087f9be2 lavapipe: Perform shader object compatibility check early
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
To avoid allocating (and leaking) a lvp_shader.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39496>
2026-05-31 12:36:29 +00:00
Konstantin Seurer
9f11d59f9a llvmpipe: Fix memory leak when allocating sample functions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39496>
2026-05-31 12:36:29 +00:00
Mike Blumenkrantz
e41ad705a9 lavapipe: Implement VK_EXT_descriptor_heap
Co-authored-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39496>
2026-05-31 12:36:29 +00:00
Konstantin Seurer
a12e7c85f5 lavapipe: Add lvp_nir_lower_push_constants
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39496>
2026-05-31 12:36:29 +00:00
Konstantin
a4bdc0ba0d lavapipe: Fix push_constant_size for shader objects
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39496>
2026-05-31 12:36:28 +00:00
Konstantin
327093a306 lavapipe: Re-emit push constants if the size changed
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39496>
2026-05-31 12:36:28 +00:00
Mike Blumenkrantz
644041cf0b lavapipe: stop using pipeline layouts in some places
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39496>
2026-05-31 12:36:28 +00:00
Konstantin Seurer
5b050154ed lavapipe: Implement VK_KHR_shader_untyped_pointers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39496>
2026-05-31 12:36:28 +00:00
Konstantin Seurer
f2de5f8088 lavapipe: Reduce descriptor sizes even further
This works by splitting lp_descriptor into image, sampler and buffer
descriptor types. The lavapipe side needs to be adjusted to handle
descriptor set layouts with varying descriptor sizes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39496>
2026-05-31 12:36:28 +00:00
Konstantin Seurer
3416cc5f90 llvmpipe: Remove lp_llvm_descriptor_base
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39496>
2026-05-31 12:36:28 +00:00
Konstantin
5251cd7236 vulkan/cmd_queue: Handle struct copies that are not pointers
Structs that need explicit copies can be inline members.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39496>
2026-05-31 12:36:28 +00:00
Konstantin Seurer
f48f681fb5 nir: Duplicate the name in nir_def_set_name
nir_sweep expects that nir_instr_debug_info::variable_name is owned by
nir_instr_debug_info.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40706>
2026-05-31 13:31:55 +02:00
Konstantin Seurer
9c596cd05b lavapipe: Bump maxRayDispatchInvocationCount to the min requirement
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40706>
2026-05-31 13:31:55 +02:00
Alyssa Rosenzweig
e22cdebfdc brw: nir_lower_constant_convert_alu_types only once
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: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40762>
2026-05-30 21:00:39 -07:00
Faith Ekstrand
154d3b5812 nak: Simplify SSARef construction with try_push()
Some checks failed
macOS-CI / macOS-CI (dri) (push) Has been cancelled
macOS-CI / macOS-CI (xlib) (push) Has been cancelled
This is what LowerBoundedU32Array is doing internally and it's unlikely
faster to have all these extra cases.  This also gets rid of a bunch of
transmute(), which is always nice.  It does mean a small copy in the
case of large SSARefs but those should be uncommon.

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41462>
2026-05-30 01:20:10 +00:00
Faith Ekstrand
f279bcdaef nak: Allow SSA value 0 again
We no longer need the index to be non-zero because we add 17.

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41462>
2026-05-30 01:20:10 +00:00
Faith Ekstrand
8629f5cb3e nak: Use LowerBoundedU32 for SSAValue
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41462>
2026-05-30 01:20:10 +00:00
Faith Ekstrand
e6bc41ed44 compiler/rust: Add LowerBoundedU32[Array] types
This is a generalization of NAK's SSAValue and SSAValueArray structs.
But instead of depending on NAK's bespoke invariants, this depends on
something far simpler: A lower bound on the u32.  As long as you can
guarantee that the maximum array length is strictly less than the
minimum U32 value, we can pull the same trick as NAK and generalize it
into a LowerBoundedU32Array type.

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41462>
2026-05-30 01:20:10 +00:00
Faith Ekstrand
48b234d78b meson: Bump the minimum rust version to 1.85.0
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41462>
2026-05-30 01:20:10 +00:00
Caio Oliveira
181eaee52e brw: Remove old encoder, generator and related tools
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41413>
2026-05-30 00:54:00 +00:00
Caio Oliveira
15e53be9c9 intel/compiler: Add and use gen_update_reloc_imm()
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41413>
2026-05-30 00:54:00 +00:00
Caio Oliveira
f5eb84daf8 iris: Use gen_print instead of brw_disasm
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41413>
2026-05-30 00:54:00 +00:00
Caio Oliveira
159ab10712 intel/tools: Use gen_print instead of brw_disasm
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41413>
2026-05-30 00:54:00 +00:00
Caio Oliveira
4010129227 anv: Use gen_print instead of brw_disasm
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41413>
2026-05-30 00:54:00 +00:00
Caio Oliveira
ddc9383eed brw: Make brw_generator an implementation detail of brw_to_binary.cpp
Now that every caller goes through brw_to_binary(), brw_generator has
a single user (brw_to_binary.cpp itself).  Move the class definition
into that .cpp inside an anonymous namespace and delete the header,
so it can no longer leak into other translation units.

No functional change.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41413>
2026-05-30 00:54:00 +00:00
Caio Oliveira
74583d3db6 brw: Add brw_to_binary() as the single codegen entrypoint
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41413>
2026-05-30 00:54:00 +00:00