Commit graph

223323 commits

Author SHA1 Message Date
Caio Oliveira
596d18bbf7 intel/gen: Add various to_string/from_string functions
String with explicit size will be useful for the parser code later.

Assisted-by: Pi coding agent (Opus-4.7)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41413>
2026-05-30 00:53:58 +00:00
Caio Oliveira
03c32e90a9 intel/gen: Add gen encoding module
Add a new module that can produce the binary encoded representation of
the instructions.  Some key differences from existing encoding logic
in brw:

- Use a struct to represent the instructions before final encoding.
  This is similar to the struct we already use in validation.  This
  allows generator/validation code to ignore details of instruction
  formatting and just "set src0 to something".

- Split the encoding logic between Pre-Xe (Gfx9 and Gfx11) and Xe (from
  Gfx12 and up).  They are documented differently, so splitting makes
  both sides easier to deal with.

- Try to follow the bit range numbers as they are documented in the
  spec, programatically shifting them when needed.  This means numbers
  in code match PRMs / BSpec.

Later patches will add compaction and make use of the module in various
parts of the code.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41413>
2026-05-30 00:53:58 +00:00
Karol Herbst
87b5340831 nir/opt_dead_write_vars: cache is_entrypoint of the function
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
ends_program calls into nir_cf_node_get_function repeadtly to fetch the
same function and to check whether we are inside an entry point or not.

But we already got the information higher up the chain so use that
instead.

nir_cf_node_get_function is quite expensive, because it follows pointers
through the tree.

Speeds up compilation of more complex shaders by quite a bit. I am seeing
a 66% cut of compilation time spent in e.g. llama-bench.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41891>
2026-05-29 22:58:00 +00:00
Lionel Landwerlin
e24dc5bd1e anv: fake VK_EXT_image_compression_control on Xe2+
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
We're required to support this extension for Android VP17.

We've tried supporting it through the use of
CMF_DISABLE_WRITE_COMPRESSION but some regressions are measures
(-0.5~-1.0%).

We're not aware using CMF_DISABLE_WRITE_COMPRESSION would prevent any
application bug so it doesn't feel useful to implement.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41187>
2026-05-29 23:50:54 +03:00
Lionel Landwerlin
2218581c95 anv: move compression control drirc to feature section
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41187>
2026-05-29 23:49:48 +03:00
Lionel Landwerlin
b6a582cdf1 anv: move fake_sparse drirc to feature category
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41187>
2026-05-29 23:49:48 +03:00
Lionel Landwerlin
3c340e0b7c anv: rename drirc script
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41187>
2026-05-29 23:49:47 +03:00
Utku Iseri
2263576f59 v3dv: close display_fd on incompatible_driver path
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Currently, display_fd gets leaked during vulkan loader driver
probing on platforms where there's no v3dv device, as nothing
closes this fd before returning with INCOMPATIBLE_DRIVER. As
the display_fd also holds MASTER, this in turn prevents the
actual driver from becoming master on the display node.

Close the fd before returning to prevent this.

Fixes: bb532a7a ("v3dv: Fix assertion failure for not-found primary_fd during enumeration.")

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41058>
2026-05-29 19:55:33 +00:00
Job Noorman
e13c270d89 ir3/ra: fix killed src detection for spillall min limit
Same fix as in [1] but for the spillall min limit calculation.

[1]: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41154

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41724>
2026-05-29 19:33:22 +00:00
Job Noorman
d782c40be6 ir3/ra: add ir3_ra_src_is_killed helper
The same logic is needed in RA and the spiller.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41724>
2026-05-29 19:33:22 +00:00
Emma Anholt
6ec23e6c27 freedreno/ci: Add more explanation of a trace failure that's not our fault.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41662>
2026-05-29 19:05:39 +00:00
Emma Anholt
b104ff6ca9 freedreno/ci: Add restricted traces testing of D3D11 traces on a660.
Since the D3D11 traces were heavier, I needed to add support for traces
declaring about how much memory they use, so we can cut down the
parallelism and avoid hitting swap.  It's a bit of a nuisance to set up,
but it cut the job time after I'd added all the traces with necesstary
"singlehread" flags in half.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41662>
2026-05-29 19:05:39 +00:00
Emma Anholt
d7a94b02f5 ci: Build the Vulkan screenshot layer as part of VK test builds.
We'll use this in order to capture renderdoc replay under wine for
D3D10/11 traces.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41662>
2026-05-29 19:05:39 +00:00
Emma Anholt
ad8da52443 ci: Include Windows renderdoc in with wine and update gpu-trace-perf.
We'll use this for trace testing of the new D3D11 .rdc collection.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41662>
2026-05-29 19:05:39 +00:00
Emma Anholt
5415e6779c weston: Run at a more reasonable 1920x1080 resolution, not 1024x640.
The headless backend's defaults are quite low, and it was preventing
renderdoc replays from running any larger than that, which in turn cut off
the screenshots we wanted to take.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41662>
2026-05-29 19:05:38 +00:00
Emma Anholt
73234c7d71 screenshot-layer: Log when we can't open the output directory.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41662>
2026-05-29 19:05:38 +00:00
Paulo Zanoni
2d3dc35d55 anv: implement VK_KHR_copy_memory_indirect
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This implements the extension on the Graphics and Compute queues using
Blorp OpenCL compute shaders. Support for the Transfer queue will come
in a later patch. We also don't support 24/48/96 bpp formats yet.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39338>
2026-05-29 18:12:37 +00:00
Paulo Zanoni
a84addd941 libcl/vk: add VkCopyMemoryToImageIndirectCommandKHR and its members
The members are all naturally aligned to 4, but other
naturally-aligned-to-4 structs in this file still have the attribute
declared (such as VkDispatchIndirectCommand), so I'm adding the
attributes to these as well.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39338>
2026-05-29 18:12:37 +00:00
Paulo Zanoni
d3c87303da libcl/vk: add aligned(4) to VkCopyMemoryIndirectCommandKHR
This structure, despite containing 8-bit members, can be 4-byte
aligned:

    "VUID-VkCopyMemoryIndirectInfoKHR-copyAddressRange-10942
     copyAddressRange.address must be 4 byte aligned"

So do it like we do with the other structures.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39338>
2026-05-29 18:12:37 +00:00
Paulo Zanoni
4b58b25e24 intel/blorp: prepare for usage of mi_builder.h
In the next patch we will use mi_builder.h from blorp code, so this
commit prepares the terrain for that by adding the necessary
definitions that the header requires.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39338>
2026-05-29 18:12:37 +00:00
Lionel Landwerlin
e3c00aa2e1 mi_builder: mi_umax2 tests
v2 (From Paulo): add more magic numbers.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39338>
2026-05-29 18:12:37 +00:00
Paulo Zanoni
70d22963f4 intel/mi_builder: add mi_umax2()
We're going to use this for indirect copies, as we need to iterate
through the indirect buffer checking the copy sizes, then pick the
maximum copy size in order to launch the indirect compute shader.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39338>
2026-05-29 18:12:37 +00:00
Paulo Zanoni
9f7623723e intel/mi_builder: add mi_ixor()
Just like mi_ior(), but for xor. We're going to use it in one of the
next commits.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39338>
2026-05-29 18:12:37 +00:00
Georg Lehmann
36ad561fec aco/isel: never manually flush denorms after 32bit fma
This option is only meant for min/max, where gfx8 and older
didn't flush denorms. Fma flushes denorms on all hardware
and the optimizer removes the manual flushing again anyway.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41868>
2026-05-29 17:46:19 +00:00
Jhanani Thiagarajan
2a60e9e769 intel/mda: Change the default output directory
Directories are named using the process name and PID to avoid overwriting dumps from
subsequent runs of the same application.

v2 (Caio): Use util_get_process_name().  Change to be default behavior.
           Old behavior still accessible via MDA_OUTPUT_DIR="." env var.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39125>
2026-05-29 17:30:38 +00:00
Peyton Lee
04dfd3fe3f radeonsi/vpe: adjust message
Adjust debug message to display the correct format name

Signed-off-by: Peyton Lee <peytolee@amd.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41876>
2026-05-29 17:02:06 +00:00
Peyton Lee
5a088b1810 ac/gpu_info: add VPE_2_2 support
enable VPE_2_2 support

Signed-off-by: Peyton Lee <peytolee@amd.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41876>
2026-05-29 17:02:05 +00:00
Peyton Lee
99c4cd205e amd/vpelib: support vpe 2.2
Update vpelib to support vpe 2.2.

Signed-off-by: Peyton Lee <peytolee@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41876>
2026-05-29 17:02:05 +00:00
Michel Dänzer
2b2dbcc13a egl/gbm: Eliminate max_age local variable
Use oldest_buffer->age instead.

Cleanup, no functional change intended.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41845>
2026-05-29 16:38:01 +00:00
Michel Dänzer
485919779d egl/gbm: Use local variable for better readability
No functional change intended.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41845>
2026-05-29 16:38:01 +00:00
Michel Dänzer
3999b5d680 egl/gbm: Do not destroy BO of current front buffer
It's not always locked. If it's not, and we destroy its BO,
lock_front_buffer will set dri2_surf->current->locked = true but then
return NULL, so release_buffer will never be called, preventing the
buffer from being used again.

Fixes: dd7ae41091 ("egl/gbm: Destroy excess BOs")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41845>
2026-05-29 16:38:01 +00:00
Eric Engestrom
9be2f6ea57 Revert "drirc: move 00-$drv-defaults.conf to each driver's folder"
This reverts commit 97391328a3.

This broke devenv because DRIRC_CONFIGDIR doesn't point the folder that
contains everything anymore.

DRIRC_CONFIGDIR will be modified to take the standard `:`-separated list
of paths, but until then, revert this.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41890>
2026-05-29 16:01:06 +00:00
Samuel Pitoiset
9dfc83079c radv: enable radv_force_64_byte_sampled_image for Crimson Desert
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Seems the same issue as FH6 after all.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15563
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41851>
2026-05-29 15:36:52 +00:00
Georg Lehmann
0f542c7049 radv: enable fp64 float controls on gfx6-7
There is no reason why these should be disabled.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41852>
2026-05-29 15:09:20 +00:00
Georg Lehmann
45532ad306 aco/gfx6: always use rtne adds for fround_even lowering
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41852>
2026-05-29 15:09:20 +00:00
Georg Lehmann
a3b4cf9f1f aco/gfx6: fix fround_even(-0.0)
We need to account for the sign bit after the add/sub trick,
otherwise -0.0 gets turned into +0.0.

Cc: mesa-stable
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41852>
2026-05-29 15:09:20 +00:00
Georg Lehmann
ed5ab76879 aco/gfx6: always use rtne for floor/ceil lowering
This fixes floor(-DBL_MIN) and ceil(DBL_MIN) with rtz.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41852>
2026-05-29 15:09:20 +00:00
Georg Lehmann
cbf3f4220c aco: add rtne pseudo opcodes for fp64 add and fract
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41852>
2026-05-29 15:09:19 +00:00
Georg Lehmann
e0ccd24fb6 aco/gfx6: use shorter lowering for ftrunc
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41852>
2026-05-29 15:09:19 +00:00
Georg Lehmann
843219010f aco/gfx6: fix fceil lowering
The old one wasn't signed zero correct.

Cc: mesa-stable
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41852>
2026-05-29 15:09:19 +00:00
Georg Lehmann
76a68032cb radv: don't lower dfloor in NIR
The aco lowering was fixed in the previous commit.

If v_fract_f64 had precision issues, we would be in bigger trouble.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41852>
2026-05-29 15:09:19 +00:00
Georg Lehmann
bc639abb04 aco/gfx6: fix fp64 floor lowering
The v_min_f64 was broken, because we needs to allow 1.0 as fract result.

Otherwise floor(-DBL_MIN) will not return -1.0.

NaN also doesn't need any special handling, because fadd(NaN, b) is NaN.

Cc: mesa-stable
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41852>
2026-05-29 15:09:18 +00:00
Caio Oliveira
159dbc40e0 jay: Use TGL_PIPE_NONE when RegDist is zero
Avoids simulator complaining about invalid dependency.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41880>
2026-05-29 14:36:45 +00:00
Romaric Jodin
bb15c00343 anv: Declare 00-mesa-defaults.conf as an input to anv_dricrc_gen.py
The `libanv_drirc` custom target passes `00-mesa-defaults.conf` to the
generator script via the `--validate` flag, but it was hardcoded as a
path rather than being declared as an input dependency.

When translating the build to a hermetic build system, this missing
dependency causes the build to fail because the undeclared file is not
provisioned in the sandboxed build environment.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41886>
2026-05-29 14:05:30 +00:00
Konstantin Seurer
bef2148ab7 llvmpipe: Fix sparse binding large areas
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The size needs to be taken into account when tracking residency.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41327>
2026-05-29 13:32:23 +00:00
Konstantin Seurer
ac27f93e54 llvmpipe: Implement sparse residency feedback for buffers
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41327>
2026-05-29 13:32:23 +00:00
Konstantin Seurer
6b999c4cab llvmpipe: Use i1 for sparce residency and expand as needed
Avoids potential size mismatch.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41327>
2026-05-29 13:32:23 +00:00
Christian Gmeiner
010678968b lavapipe: Enable extendedDynamicState3ColorBlendAdvanced
Advanced blend with dynamic state is now lowered correctly at draw time, so
advertise the feature. It is required because lavapipe supports VK_EXT_shader_object.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15564
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41885>
2026-05-29 11:58:34 +00:00
Christian Gmeiner
d80bf97e5e lavapipe: Lower advanced blend at draw time when its state is dynamic
With VK_DYNAMIC_STATE_COLOR_BLEND_ADVANCED_EXT the advanced blend op and its
parameters are only known at draw time. The static color_blend_op still
carries the pipeline's blend equation op, so lowering advanced blend in the
fragment shader already at pipeline creation used a stale op and, together with
the draw-time lowering, blended the result twice.

Fixes: 0444b5877f ("lavapipe: Implement VK_EXT_blend_operation_advanced")
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41885>
2026-05-29 11:58:34 +00:00
Christian Gmeiner
94299202f9 lavapipe: Skip advanced blend lowering when blending is disabled
When color blending is disabled for an attachment the fragment shader output
is written unmodified, so an advanced blend op on that attachment must have no
effect. lavapipe decided whether to lower advanced blend from the blend op
alone and ignored the blend enable, so the output got blended instead of being
left untouched.

Fixes: 0444b5877f ("lavapipe: Implement VK_EXT_blend_operation_advanced")
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41885>
2026-05-29 11:58:33 +00:00