Commit graph

220806 commits

Author SHA1 Message Date
Rhys Perry
4d65a7d16e nir/propagate_invariant: be more conservative with aliasing variables
No fossil-db changes.

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/40740>
2026-04-08 07:10:26 +00:00
Rhys Perry
310c8a0a17 nir/propagate_invariant: be more conservative with NULL variables
If we can't determine what variable is accessed, we should assume it could
be any.

This might make things worse with Vulkan since it does
vulkan_resource_index+load_vulkan_descriptor, but I don't think it matters
much. SSBO stores are rarely used in vertex shaders.

fossil-db (navi21):
Totals from 1 (0.00% of 202427) affected shaders:
Instrs: 442 -> 445 (+0.68%)
Latency: 2038 -> 2043 (+0.25%)
InvThroughput: 432 -> 437 (+1.16%)
VALU: 295 -> 298 (+1.02%)

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/40740>
2026-04-08 07:10:26 +00:00
Rhys Perry
b6f9a9092a nir/propagate_invariant: include derefs
In case an array index is calculated using floating point.

fossil-db (navi21):
Totals from 1339 (0.66% of 202427) affected shaders:
MaxWaves: 30368 -> 30396 (+0.09%)
Instrs: 805468 -> 817035 (+1.44%); split: -0.00%, +1.44%
CodeSize: 4084432 -> 4130548 (+1.13%); split: -0.01%, +1.14%
VGPRs: 62000 -> 61952 (-0.08%)
Latency: 3885607 -> 3903915 (+0.47%); split: -0.01%, +0.48%
InvThroughput: 726350 -> 742176 (+2.18%); split: -0.03%, +2.21%
VClause: 22187 -> 22676 (+2.20%); split: -0.14%, +2.34%
SClause: 14663 -> 14616 (-0.32%); split: -0.42%, +0.10%
Copies: 65726 -> 65840 (+0.17%); split: -0.09%, +0.26%
Branches: 21075 -> 21076 (+0.00%); split: -0.02%, +0.03%
PreVGPRs: 48970 -> 48941 (-0.06%)
VALU: 454510 -> 466082 (+2.55%); split: -0.01%, +2.55%
SALU: 130543 -> 130521 (-0.02%); split: -0.03%, +0.01%
VMEM: 43876 -> 43896 (+0.05%)

Most of these changes are elden_ring shaders which can no longer optimize
f2u32(u2f32()).

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/40740>
2026-04-08 07:10:26 +00:00
Rhys Perry
75ccfd8fb2 nir/propagate_invariant: set fp_math_ctrl for intrinsics
No fossil-db changes.

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/40740>
2026-04-08 07:10:26 +00:00
Rhys Perry
20e85604ad nir/propagate_invariant: include intrinsics
No fossil-db changes.

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/40740>
2026-04-08 07:10:26 +00:00
Rhys Perry
b30c0d8264 nir/algebraic: optimize exact f2u32(fmul(unpack_norm))
fossil-db (navi21):
Totals from 16 (0.01% of 202427) affected shaders:
Instrs: 17730 -> 17226 (-2.84%)
CodeSize: 97500 -> 95708 (-1.84%)
InvThroughput: 44437 -> 44419 (-0.04%)
Copies: 1502 -> 1446 (-3.73%)
VALU: 9973 -> 9525 (-4.49%)
SALU: 3509 -> 3453 (-1.60%)

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/40740>
2026-04-08 07:10:26 +00:00
Rhys Perry
f52dace6e8 nir/tests: fix NaN/inf checks in skip_test()
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/40740>
2026-04-08 07:10:26 +00:00
Rhys Perry
72f2b8a034 util: fix UBSan error with _mesa_bfloat16_bits_to_float
runtime error: left shift of 65535 by 16 places cannot be represented in type 'int'

This fixes nir_opt_algebraic_pattern_test.bf2f.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Fixes: ecd2d2cf46 ("util: Add functions to convert float to/from bfloat16")
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40740>
2026-04-08 07:10:26 +00:00
Vinson Lee
ca6edbd9c8 nil: Fix Rust test link failure under Coverity due to missing -lm
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The nil Rust test fails to link when built under Coverity (cov-build):

  /usr/bin/ld: src/util/libmesa_util.a.p/format_u_format_other.c.o:
    undefined reference to symbol 'sqrtf@@GLIBC_2.2.5'
  /usr/bin/ld: /lib/x86_64-linux-gnu/libm.so.6:
    error adding symbols: DSO missing from command line

This does not reproduce with plain GCC or Clang builds.

When rustc invokes the linker for the nil test binary, the generated
link command is structured as:

  cc ... [Rust rlibs] -Bdynamic -lm -ldl -lc ...
     -fuse-ld=lld -B.../gcc-ld ...
     [static archives: libmesa_util.a ...]

The -lm appears before libmesa_util.a in both Coverity and non-Coverity
builds. With --as-needed enabled, the linker only records a shared
library as needed if it resolves an undefined symbol at the point it
is encountered. Since no symbols need -lm when it is first seen, the
outcome depends on the linker implementation:

- lld (rustc's bundled linker, used in plain builds): Tolerates
  back-references from later static archives to earlier shared
  libraries, so libmesa_util.a's sqrtf reference is still resolved
  by the previously-seen libm.so.

- ld.bfd (GNU ld): Strict single-pass left-to-right. Once -lm is
  skipped by --as-needed, it cannot satisfy sqrtf when libmesa_util.a
  is processed later.

Coverity's cov-build wrapper intercepts rustc's call to the linker
and strips the -fuse-ld=lld and -B.../gcc-ld arguments, causing the
linker to fall back to the system's ld.bfd. This exposes the latent
link-order problem that lld was masking.

The underlying issue is that rustc places default libraries (-lm, -lc,
etc.) before user-specified static archives in the link command, which
is a known rustc limitation.
See also: https://github.com/rust-lang/rust/issues/154975

Fix this by passing -lm via rust_args with --no-as-needed brackets.
This forces ld.bfd to record libm as needed regardless of when it
appears on the command line, so sqrtf from libmesa_util.a is resolved
correctly under both lld and ld.bfd.

Fixes: 0920e0afb5 ("nil: Add zcull support")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40793>
2026-04-07 21:17:27 -07:00
Ian Romanick
cfdb3ddb93 brw: brw_reg::nr for an accumulator is not part of the offset
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Without this, reg_offset will return 1024 for acc0. This causes
has_invalid_dst_region to decide that the destination region is invalid
(because 1024 != 0), and the lowering code tries to treat the floating
point accumulators as integers. It's a mess.

v2: Add and use set_gfx_platform. Suggested by Caio.

Fixes: 937373eb25 ("i965/fs: Handle fixed HW GRF subnr in reg_offset().")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40716>
2026-04-08 00:36:39 +00:00
Jason Macnak
bc848da244 gfxstream: fix goldfish guards on fence functions
... to ensure that "mSyncHelper->close()" still happens on
non goldfish devices.

Android equivalent ag/39315505 for b/500332164

Tested with CtsGraphicsTestCases after the build file changes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40836>
2026-04-08 00:21:15 +00:00
Mary Guillemard
5a5febfccd nvk: Ensure that shader I-cache prefetch is enabled on Ada+
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/40700>
2026-04-08 00:05:40 +00:00
Mary Guillemard
55a279e8b8 nvk: Wire up shader program prefetch method
On Ampere B and later, we can specify the prefetch size in blocks of a
gfx shader we are binding.

NVIDIA proprietary driver always set it with the
max size possible. (up to 127 blocks)

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/40700>
2026-04-08 00:05:40 +00:00
Mary Guillemard
742c91ce68 nvk: Move shader size and offset calculations to nvk_shader_get_shader_size
We are going to need the total shader size (without embedded data),
let's move this out of the upload codepath.

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/40700>
2026-04-08 00:05:40 +00:00
Ian Romanick
ffdc310bf1 brw/const: Don't allow type changes when accumulators are involved
Integer accumulators and float accumulators do not occupy the same bits,
so the types cannot be arbitrarily changed.

No shader-db or fossil-db changes on any Intel platform.

v2: Use is_accumulator() instead if brw_reg_is_arf(). Add an extra test
to show the desired behavior when an accumulator is not
involved. Suggested by Caio.

Fixes: 64c251bb3a ("intel/fs: Combine constants for SEL instructions too")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40638>
2026-04-07 23:37:26 +00:00
Mixie
11c3173890 xlib: clear currentDpy when switching current context
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
When making a new context current, the previously current context may be
unbound as part of the transition.

In this path, current->currentDpy was not cleared for the old context,
leaving a stale display association behind after the context was no
longer current.

Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14947

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40422>
2026-04-07 22:39:49 +00:00
Mixie
96cbc791d5 xlib: remove vishandle from XMesaVisual and fix XVisualInfo leak
Remove the unused vishandle pointer and rely solely on visualid-based
matching. This also eliminates the leak.

This mirrors the cleanup previously done in fakeglx.c. (781232e0ac)

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40422>
2026-04-07 22:39:49 +00:00
Mixie
59ef73d71f xlib: fix skipping visuals in destroy_visuals_on_display
This commit decrements the loop index after deletion to ensure
all visuals for the display are properly destroyed.

Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14947
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40422>
2026-04-07 22:39:49 +00:00
Mixie
61d1e8fc85 xlib: use XMesaDestroyVisual instead of manual free
Replace it with XMesaDestroyVisual() to properly handle deallocation.

Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14947
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40422>
2026-04-07 22:39:49 +00:00
Mixie
8131af3f77 xlib: use XMesaDestroyVisual when destroying display visuals
destroy_visuals_on_display() frees XMesaVisual objects directly, but
XMesaVisual has a dedicated destructor.

Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14947
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40422>
2026-04-07 22:39:49 +00:00
Mixie
447a1d2e8d xlib: clear currentDpy when releasing the current context
After abe6d750e5, glXDestroyContext() can defer destruction by marking
the context with xid == None while it is still current.

However, the release-current path did not clear current->currentDpy,
so a context that had already been marked for deletion could remain
associated with a display after unbinding.

Fixes: abe6d750e5 ("xlib: fix glXDestroyContext in Gallium frontends")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14947
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40422>
2026-04-07 22:39:49 +00:00
Marek Olšák
cec1024b22 ac,radv: remove AC_TRACKED_DB_VRS_OVERRIDE_CNTL as well
AC_TRACKED_DB_PA_SC_VRS_OVERRIDE_CNTL can be used instead because
the DB and PA registers are mutually exclusive.

2 definitions are moved because consecutive enums aren't allowed
to cross a multiple of 32 because of static assertions in the bitset.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40586>
2026-04-07 22:07:48 +00:00
Marek Olšák
623d2a9f3c radv,radeonsi: don't set PA_SC_HIS_INFO
the preamble sets it

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40586>
2026-04-07 22:07:48 +00:00
Marek Olšák
9c26b8b924 ac,radv: use AC_TRACKED_DB_PA_SC_VRS_OVERRIDE_CNTL for PA_SC_VRS_OVERRIDE_CNTL
The enum is meant to be used for both.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40586>
2026-04-07 22:07:48 +00:00
Caio Oliveira
3b4a7f2d1a brw: In "Clear Accumulator" workaround, never set predicate_inverse
Since there's no predicate, the inverse bit is not relevant, so always
set it to false instead of using whatever was set by the previous
instruction.  Hardware already ignores this but will make verifying
later changes easier.

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40800>
2026-04-07 20:33:46 +00:00
Caio Oliveira
e382d82ca9 anv: Fix assert in anv_nir_compute_push_layout
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
When per-primitive padding is needed, max_push_buffers is set to 3
(instead of 4) to reserve the last slot for it.

The assert was requiring `n_push_ranges < max_push_buffers`, which
incorrectly fired when the 3 ranges were used.

Fixes: a8ba682919 ("anv: assert we haven't gone over the maximum number of push_buffers")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15155
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40803>
2026-04-07 19:56:55 +00:00
Alyssa Rosenzweig
959ec01ac8 brw/nir_lower_fs_load_output: optimize pixel coord
this saves a conversion or two.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40829>
2026-04-07 19:32:15 +00:00
Alyssa Rosenzweig
1d0f42c264 brw/eu_emit: relax assertion to allow ARF NULL
On new platforms, it's valid to use a NULL destination in conjunction with a
cmod, where you care about the implicit flag write but you don't need to clobber
any GRF. Something like:

   if (x * y > z) {

compiling (with fast-math) to

        mad.gt.f0 _, -z, x, y
   (f0) if

This patch allows us to emit that instruction.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40829>
2026-04-07 19:32:15 +00:00
Alyssa Rosenzweig
2ed6ff728a brw: explicitly pad tgl_swsb
This lets us treat it as a packed data structure without worrying about garbage.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40829>
2026-04-07 19:32:15 +00:00
Samuel Pitoiset
33676d8296 spirv: mark all resources as non-uniform by default with descriptor heap
It's required by descriptor heap. There is already a NIR pass that
optimizes non-uniform access, so this should be mostly safe.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40768>
2026-04-07 18:55:49 +00:00
Samuel Pitoiset
74aa40f6ed nir: remove resource/sampler heap ptrs sysvals
They are no longer used.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40768>
2026-04-07 18:55:49 +00:00
Samuel Pitoiset
d2b9ccf20b vulkan: adjust lowering of descriptor heaps
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40768>
2026-04-07 18:55:49 +00:00
Samuel Pitoiset
fb96f85d19 spirv: implement SpvOpUntypedImageTexelPointerEXT
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40768>
2026-04-07 18:55:49 +00:00
Samuel Pitoiset
7088621874 spirv: emit nir_intrinsic_image_heap when resource/sampler ptrs are used
This seems better because there are no variables at all.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40768>
2026-04-07 18:55:49 +00:00
Samuel Pitoiset
f1afce673b spirv: set the image format for image intrinsics
This isn't required for deref instructions because it's possible to
get the image format back from the variable but it will be useful for
descriptor heap.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40768>
2026-04-07 18:55:49 +00:00
Samuel Pitoiset
7dbef85365 spirv: change the resource/sampler builtins variable mode
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40768>
2026-04-07 18:55:49 +00:00
Samuel Pitoiset
457eac7d66 nir: add new variable modes for the resource/sampler heap pointers
These two new variable modes are used to relax restrictions on deref
casts through because it's possible to cast different modes from the
heap pointers.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40768>
2026-04-07 18:55:49 +00:00
Valentine Burley
e5144bcd6a Revert "ci: Disable Collabora's farm due to network issues"
Internet is back.

This reverts commit 994ead31bd.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40827>
2026-04-07 18:25:48 +00:00
Daniel Schürmann
daa3d5292f nir/opt_if: allow undef instructions on ELSE side for if-simplification
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Totals from 72 (0.04% of 202440) affected shaders: (Navi48)

Instrs: 213900 -> 213873 (-0.01%); split: -0.03%, +0.02%
CodeSize: 1215012 -> 1214924 (-0.01%); split: -0.01%, +0.01%
Latency: 4458993 -> 4458679 (-0.01%)
Copies: 18840 -> 18816 (-0.13%)
Branches: 5044 -> 5043 (-0.02%)
VALU: 116547 -> 116529 (-0.02%)
SALU: 28686 -> 28669 (-0.06%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40738>
2026-04-07 17:28:11 +00:00
Daniel Schürmann
1394f79517 nir/opt_if: allow load_const instructions on ELSE-side for if-simplifaction
Totals from 1974 (0.98% of 202440) affected shaders: (Navi48)

Instrs: 6438920 -> 6437055 (-0.03%); split: -0.06%, +0.03%
CodeSize: 35080732 -> 35075136 (-0.02%); split: -0.04%, +0.02%
SpillSGPRs: 2106 -> 2122 (+0.76%)
Latency: 52684517 -> 52677236 (-0.01%); split: -0.02%, +0.01%
InvThroughput: 8977644 -> 8976740 (-0.01%); split: -0.01%, +0.00%
VClause: 124447 -> 124444 (-0.00%)
SClause: 117561 -> 117560 (-0.00%); split: -0.00%, +0.00%
Copies: 413450 -> 410708 (-0.66%); split: -0.67%, +0.01%
Branches: 136429 -> 136169 (-0.19%); split: -0.20%, +0.01%
PreSGPRs: 114813 -> 114918 (+0.09%); split: -0.01%, +0.10%
PreVGPRs: 108142 -> 108145 (+0.00%); split: -0.00%, +0.00%
VALU: 3275624 -> 3274927 (-0.02%); split: -0.03%, +0.00%
SALU: 1166159 -> 1165039 (-0.10%); split: -0.17%, +0.07%
VOPD: 333456 -> 333183 (-0.08%); split: +0.02%, -0.10%
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40738>
2026-04-07 17:28:11 +00:00
Alyssa Rosenzweig
dbb7050ca7 util/sparse_bitset: add u_sparse_bitset_clear_all
It is sometimes useful to remove all elements of a bitset while retaining the
backing storage. With a dense bitset, we would just memset everything to 0,
which is O(capacity). With a sparse bitset, previously we would have to free and
reallocate, which is O(capacity) in the dense case and O(cardinality) in the
sparse case. That is the correct asymptoptic behaviour O(cardinality) in the
worst case, but there is an unfortunate constant-factor associated with the
redundant allocation & free in the dense case.

Therefore, we add a new helper to clear all elements of the sparse bitset in one
go, avoiding reallocation in the dense case.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Natalie Vock <natalie.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40806>
2026-04-07 16:59:11 +00:00
Valentine Burley
994ead31bd ci: Disable Collabora's farm due to network issues
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Cambridge office has lost internet connection.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40824>
2026-04-07 14:30:35 +00:00
Mary Guillemard
6d700284ac nvk: Use SET_PRIMITIVE_TOPOLOGY instead of MME scratch
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Instead of keeping track of the topology with some scratch value in MME,
we can rely on SET_PRIMITIVE_TOPOLOGY to directly set it.

This simplify some of the MME codegen but does not seems to have any
impact on performance in general.

Signed-off-by: Mary Guillemard <mary@mary.zone>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40749>
2026-04-07 14:11:16 +00:00
Valentine Burley
bbed00ac81 ci/freedreno: Move remaining lazor a618 jobs, retire device type
The sc7180-trogdor-lazor-limozeen devices have been dying off over the
past few weeks, so move the last two jobs to sc7180-trogdor-kingoftown
and retire the device type.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40818>
2026-04-07 11:55:59 +00:00
Natalie Vock
fded5e321d aco: Nuke ACO-side prolog selection
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/40008>
2026-04-07 11:28:05 +00:00
Natalie Vock
afe519406b radv: Rewrite the RT prolog in NIR
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40008>
2026-04-07 11:28:05 +00:00
Natalie Vock
b53dc3f052 aco/lower_to_hw_instr: Run p_init_scratch if the program has a call
Callees may use scratch even if the caller doesn't.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40008>
2026-04-07 11:28:05 +00:00
Natalie Vock
378c9536de aco/isel: Fix stack_ptr synthesis
info.stack_ptr.is_reg is always true. We have a stack pointer to use
if and only if the program is a callee.

Also, apply_scratch_offset needs to be true in a few more places.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40008>
2026-04-07 11:28:05 +00:00
Natalie Vock
31e08322d7 aco/spill_preserved: Only compute preserved registers if in a callee
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40008>
2026-04-07 11:28:05 +00:00
Xianzhong Li
248b0b47b7 panfrost: Fix GEM handle refcount leak in panfrost_bo_import
panfrost_bo_import() calls drmPrimeFDToHandle() then pan_kmod_bo_import(),
which also calls drmPrimeFDToHandle() internally. This double import causes
GEM handle refcount leaks because each drmPrimeFDToHandle() increments the
kernel's GEM handle refcount, but only one drmCloseBufferHandle() is called
during cleanup by panfrost_kmod_bo_free(or panthor_kmod_bo_free).

Fix by removing the redundant drmPrimeFDToHandle() and using
pan_kmod_bo_import() directly. On re-import of existing buffers, properly
release the extra pan_kmod_bo reference with pan_kmod_bo_put().

This ensures GEM handle refcount, pan_kmod_bo refcount, and panfrost_bo
refcount are all properly balanced.

Fixes: 5089a758df ("panfrost: Back panfrost_bo with pan_kmod_bo object")

Signed-off-by: Xianzhong Li <xianzhong.li@nxp.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40778>
2026-04-07 11:06:34 +00:00