Commit graph

212744 commits

Author SHA1 Message Date
Eric Engestrom
2f9fd1768a intel/meson: generate spirv_info.h before compiling brw_spirv.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37544>
2025-09-24 10:23:18 +00:00
Eric Engestrom
618038860d gfxstream/meson: generate git_sha1.h before compiling ResourceTracker.cpp
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37544>
2025-09-24 10:23:18 +00:00
Eric Engestrom
cb780bc42a panvk/meson: generate git_sha1.h before compiling panvk_vX_physical_device.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37544>
2025-09-24 10:23:18 +00:00
Eric Engestrom
f4b86d8e0c egl/meson: generate wayland presentation-time header before it gets included
It is needed by src/loader/loader_wayland_helper.h which is included in
a couple of places in egl when wayland is enabled.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37544>
2025-09-24 10:23:18 +00:00
Eric Engestrom
91e5e7d79d util/meson: make sure shader_stats.h is generated in time for anything that depends on mesautil
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37544>
2025-09-24 10:23:18 +00:00
Simon Perretta
6e3573127c vulkan/runtime: only set shader subgroup info if non-zero
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Fixes: 67c4b762a5 ("vulkan: setup max_subgroup_size for drivers without var...")
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37533>
2025-09-24 09:14:38 +00:00
Lionel Landwerlin
e9910fa955 brw: fix type conversion in tex operation params
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Fix a bunch of tests in dEQP-VK.glsl.texture_gather.* on Xe2+

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: bddfbe7fb1 ("brw/blorp: lower MCS fetching in NIR")
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37532>
2025-09-24 08:47:03 +00:00
Rhys Perry
bf9a3bfd86 rusticl: support NIR_DEBUG=progress_validation
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: @LingMan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35069>
2025-09-24 08:20:29 +00:00
Rhys Perry
20c316718c rusticl: support NIR_DEBUG=invalidate_metadata/extended_validation
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: @LingMan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35069>
2025-09-24 08:20:29 +00:00
Rhys Perry
7538167096 nir: add NIR_DEBUG=progress_validation
Fails if a shader was changed but the pass didn't report progress.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35069>
2025-09-24 08:20:28 +00:00
Rhys Perry
706ba80057 nir: fix NIR_DEBUG=extended_validation
This broke after divergence became metadata because the divergence
analysis pass does not support all instructions.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35069>
2025-09-24 08:20:28 +00:00
Rhys Perry
026e2527bf nir/opt_if: rewrite progress reporting and metadata invalidation
This would unconditionally invalid all metadata except
nir_metadata_control_flow and then invalidate that if opt_if_safe_cf_list
and opt_if_regs_cf_list made no progress.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35069>
2025-09-24 08:20:27 +00:00
Rhys Perry
da23b17c8b nir/opt_if: fix progress reporting with multiple function impls
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35069>
2025-09-24 08:20:27 +00:00
Rhys Perry
591b498e1f radv: fix progress reporting in lower_rt_derefs
Only create nir_load_rt_arg_scratch_offset_amd if needed.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35069>
2025-09-24 08:20:27 +00:00
Rhys Perry
12ee2b0fd4 nir: fix progress reporting in nir_io_add_const_offset_to_base
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35069>
2025-09-24 08:20:27 +00:00
Rhys Perry
92a2ab8b64 ac/nir: fix progress reporting in ac_nir_lower_tex
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35069>
2025-09-24 08:20:27 +00:00
Lionel Landwerlin
66e9a2f61d anv: fix crash in ESO tests
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
dEQP-VK.shader_object.misc.state.shaders.vert_geom_frag.geometry_streams.enabled
dEQP-VK.shader_object.misc.state.shaders.vert_tess_geom_frag.geometry_streams.enabled

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 1d8847afcf ("anv: fix streamout config comparison")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37535>
2025-09-24 00:34:50 +03:00
Iván Briano
f97b51186f anv: intermediate RGB <-> RGBX copy for HIC
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
For 3-component RGB images with OPTIMAL tiling, we need to create the
surface as RGBX or RGBA. When a host image copy to/from this image
happens, we calculate sizes and offsets based on the 4-component surface
and blow past the end of the 3-component API provided buffer.
Hilarity^WSegfault ensues.

Ideally we'd calculate the right sizes and have the tiled copy functions
handle the conversion, but they are format unaware and expect to just
copy bytes in blocks of equal sizes from both sides.

Handle this case by making an intermediate copy to/from linear RGB
from/to linear RGBX, and pass that intermediate slice to the tiled copy
functions.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36453>
2025-09-23 18:06:14 +00:00
Iván Briano
5a18d8d867 anv: drop height_pitch parameter from anv_copy_image_memory
Calculate the start of the memory pointer in the caller instead.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36453>
2025-09-23 18:06:14 +00:00
Iván Briano
c02a27bce1 anv: handle multiple aspects in vkCopyImageToImage
Per VUID-VkCopyImageToImageInfo-srcImage-09069,
srcImage and dstImage must have been created with identical image
creation parameters, so we are not going to have copies from color <->
depth/stencil, but we can copy both D/S aspects of an image at the same
time.

Nothing says that we can't copy from one plane of a multiplanar image to
another, so handle that case too (though nothing is currently testing
it).

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36453>
2025-09-23 18:06:14 +00:00
Iván Briano
68e4fd7de2 anv: drop EXT from host_image_copy stuff
It became core in 1.4

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36453>
2025-09-23 18:06:13 +00:00
Iván Briano
5c5d2b1e9f anv: pass only isl_format to helper functions
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36453>
2025-09-23 18:06:13 +00:00
Connor Abbott
c2eb768eb2 tu: Expose VK_EXT_dynamic_rendering_unused_attachments
We only use attachment formats for things used by the pipeline, so we
can trivially enable this.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37529>
2025-09-23 17:33:19 +00:00
Lionel Landwerlin
1d8847afcf anv: fix streamout config comparison
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: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: e76ed91d3f ("anv: switch over to runtime pipelines")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37251>
2025-09-23 16:01:30 +00:00
Lionel Landwerlin
8e93e7cd72 brw: layout patch in VUE in position independent way
Only if required. I somehow misunderstood that those would need to be
independent too, not just the vertex slots.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 8dee4813b0 ("brw: add ability to compute VUE map for separate tcs/tes")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37251>
2025-09-23 16:01:30 +00:00
Lionel Landwerlin
73383fe7ef brw: fix split_sends with txf combining
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37527>
2025-09-23 15:37:40 +00:00
Lionel Landwerlin
6dbcc81c85 brw: simplify texture surface/sampler handle sources
We had twice surface/sampler sources for no good reason, just add a
boolean to tell whether they are bindless or not.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37527>
2025-09-23 15:37:40 +00:00
Lionel Landwerlin
06cf911ab4 brw: lower shader opcode into tex_instr
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37527>
2025-09-23 15:37:40 +00:00
Lionel Landwerlin
bddfbe7fb1 brw/blorp: lower MCS fetching in NIR
One advantage here of moving a bunch of stuff to NIR is that we can
now have consistent payload types straight from the NIR conversion to
BRW.

This massively simplifies the BRW lowering code and avoids type errors
that are quite common to make in the backend.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37527>
2025-09-23 15:37:40 +00:00
Lionel Landwerlin
d4ab2087cf brw: lower non coherent FS load_output in NIR
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37527>
2025-09-23 15:37:39 +00:00
Mike Blumenkrantz
3b6b03bd3b zink: convert task_payload offset to array index in prepass
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37528>
2025-09-23 10:56:50 -04:00
José Roberto de Souza
5a482a7a3d gallium/llvmpipe/test: Rename rsqrtf() to _rsqrtf()
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Some versions of math.h exports rsqrtf() while others don't, so this
was causing compilation to fail when it is supported.
I have not found a easy way to detect if rsqrtf() is supported and
as this is only used in a llvmpipe tests it is not worthy do changes
in Meson files to detected if it is supported.

So here just renaming the Mesa function to _rsqrtf() and fixing the
build for both math.h versions.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13797
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12934
Reviewed-by: Roland Scheidegger <roland.scheidegger@broadcom.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37515>
2025-09-23 14:02:23 +00:00
Michel Dänzer
dd7ae41091 egl/gbm: Destroy excess BOs
Calculate the minimum available buffer age in addition to the maximum,
and if they differ for 1000 frames in a row, destroy the BO for the
highest-age unused buffer.

Without this, Wayland compositors using dynamic triple buffering always
get buffer age 3 once a third BO has been allocated.

v2:
* Rename function to destroy_oldest_unused_bo. (Marek Olšák)
* Move function call into if block.
* Use == instead of > as the condition for the function call.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37511>
2025-09-23 13:32:13 +00:00
Michel Dänzer
15b8d3ca43 egl/dri: Name struct dri2_egl_buffer
This will allow referencing it outside of struct dri2_egl_surface.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37511>
2025-09-23 13:32:13 +00:00
Danylo Piliaiev
fce9dbc493 tu/perfetto: Init perfetto datasources once
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37465>
2025-09-23 12:04:01 +00:00
Danylo Piliaiev
0621d5cd39 tu/perfetto: Make GPU clock sequence-scoped
When CPU clock is the same with the authoritative trace clock (normally
default to CLOCK_BOOTTIME), perfetto drops the non-monotonic snapshots
to ensure validity of the global source clock in the resolution graph.
When they are different, the clocks are marked invalid and the rest of
the clock syncs will fail during trace processing.

There's no central daemon emitting consistent snapshots for
synchronization between CPU and GPU clocks on behalf of renderstages and
counters producers. The sequence-scoped clock (64 <= ID < 128) is unique
per producer + writer pair within the tracing session.

Turnip is a bit tricky here, since clocks may be synchronized before
`tu_perfetto_end_submit` is called (in case of KGSL), but emission of
perfetto event has to happen on the same thread as other renderstage events.
To solve this I save the clocks in `tu_perfetto_state` and emit them in
`stage_end` when needed.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37465>
2025-09-23 12:04:01 +00:00
Danylo Piliaiev
09f5c9d0ad tu/perfetto: Track GPU timestamps per-device
In preparation for using sequence-scope perfetto clocks.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37465>
2025-09-23 12:04:01 +00:00
Danylo Piliaiev
e2b63472e4 tu/perfetto: Don't check sync_gpu_ts when emitting renderstage
In short, perfetto doesn't require the initial clock snapshot to be
earlier than the timestamp to be converted. So we don't have to do
complex handling for it.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37465>
2025-09-23 12:04:01 +00:00
Danylo Piliaiev
ea849b5557 tu: Destroy all mutexes used for device
We never destroyed most of mutexes we used, it was likely fine on
platforms turnip is running on, but still not correct.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37465>
2025-09-23 12:04:00 +00:00
Job Noorman
f536d76341 ir3/parser: don't use instr as ralloc context
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Instructions are allocated using a linear context so cannot themselves
be used as a ralloc context anymore. Use the variant's ir instead.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Fixes: 114e6a3104 ("ir3: Use a linear allocation context for ir3_instructions.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37523>
2025-09-23 11:45:07 +00:00
Valentine Burley
e2e13f23a0 zink/ci: Re-enable ASan leak detection and drop VVL filter on CML
This job is stable again with the fix in c85168160e ("zink: reset batch
states on destroy")

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37519>
2025-09-23 10:56:31 +00:00
Danylo Piliaiev
518008c3b0 tu/a7xx: Update reg stomping info to fix GPU crashes when stomping
- Removed DBG/CHICKEN regs from being stomped, because they randomly
  cause issues, and there is no even point of stomping them.
- *ATTR_BUF_GMEM regs are not emitted at every renderpass.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37372>
2025-09-23 10:12:30 +00:00
Sergi Blanch Torne
51c3f56aa3 ci,crnm: migrate colorama to rich
The links in the console are broken depending on the console type; for example,
when it runs within a GitLab job. This can be improved using rich. But as we
have a dependency on colorama too, we can migrate all the coloring to use this
other library too.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37454>
2025-09-23 09:57:37 +00:00
Calder Young
a6b11b58d9 anv: Fix tiling for AV1 IntraBC surface on Gfx125+
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Fixes: 3c7a834e ("anv: Add support for AV1 video decoding on Gfx125 and Xe2")

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37352>
2025-09-23 07:48:42 +00:00
Pierre-Eric Pelloux-Prayer
81f3a5a035 nir/opcodes: remove invalid comment
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
"\b" is interpreted by python which results in an invalid char being
written to the C file.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37331>
2025-09-23 09:09:55 +02:00
Pierre-Eric Pelloux-Prayer
cc4b50b023 nir/opcodes: use u_overflow to fix incorrect checks
Operands of an addition will be promoted to int making the a+b<a
kind of checks ineffective.

Use u_overflow.h helpers to perform the check correctly.
The commit would be simpler if it used __typeof__ like so:

   util_add_check_overflow(__typeof__(src0), src0, src1)

But typeof only became a standard in C23 so this commit instead extends
nir_opcodes a bit to allow opcodes that need the dest_type to get it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37331>
2025-09-23 09:09:55 +02:00
Pierre-Eric Pelloux-Prayer
1b23a2ba80 util, vulkan: use u_overflow.h
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37331>
2025-09-23 09:09:55 +02:00
Pierre-Eric Pelloux-Prayer
cfbf745a79 mesa: add u_overflow.h
It defines a couple of helpers to deal with signed and unsigned
integers overflow.

If __builtin_add_overflow (and others) intrinics are available
they're used, otherwise overflow checks are done manually.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37331>
2025-09-23 09:09:55 +02:00
Pierre-Eric Pelloux-Prayer
66aefea02b mesa: clear TransformFeedback.NumVarying on error
The memory is freed before trying to reallocate it.
If the alloc fails, NumVarying should be updated to 0.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37331>
2025-09-23 09:09:55 +02:00
Lionel Landwerlin
1110763d7b anv: avoid unnecessary 3DSTATE_PS_EXTRA emissions
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 44aaf88425 ("anv: rework gfx state emission (again)")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37472>
2025-09-23 06:52:38 +00:00