Commit graph

3150 commits

Author SHA1 Message Date
Samuel Pitoiset
0de4d3d9c6 util: add a separate file for vmgfx drirc
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41731>
2026-05-28 11:24:46 +00:00
Samuel Pitoiset
e6730910be util: add a separate file for d3d12 drirc
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41731>
2026-05-28 11:24:46 +00:00
Samuel Pitoiset
bbc0762223 util: add a separate file for msm drirc
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41731>
2026-05-28 11:24:46 +00:00
Samuel Pitoiset
88c42258f8 util: add a separate file for r600 drirc
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41731>
2026-05-28 11:24:45 +00:00
Samuel Pitoiset
f67ca9c529 util: add a separate file for virgl drirc
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41731>
2026-05-28 11:24:45 +00:00
Samuel Pitoiset
f7b556cf66 util: add a separate file for dozen drirc
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41731>
2026-05-28 11:24:45 +00:00
Samuel Pitoiset
c2f397c90f util: add a separate file for crocus drirc
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41731>
2026-05-28 11:24:44 +00:00
Samuel Pitoiset
8fb53f47b9 util: add a separate file for panfrost drirc
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41731>
2026-05-28 11:24:44 +00:00
Samuel Pitoiset
87860fca06 util: add a separate file for panvk drirc
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41731>
2026-05-28 11:24:44 +00:00
Samuel Pitoiset
31b7d17da4 util: add a separate file for asahi vulkan drirc
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41731>
2026-05-28 11:24:44 +00:00
Samuel Pitoiset
46d36e8332 util: add a separate file for asahi drirc
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41731>
2026-05-28 11:24:43 +00:00
Samuel Pitoiset
a5984c6731 util: add a separate file for iris drirc
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41731>
2026-05-28 11:24:43 +00:00
Samuel Pitoiset
16f851f71a util: add a separate file for r300 drirc
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41731>
2026-05-28 11:24:43 +00:00
Samuel Pitoiset
7599fa8322 util: add a separate file for NVK drirc
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41731>
2026-05-28 11:24:42 +00:00
Samuel Pitoiset
fc7da599fa util: add a separate file for ANV drirc
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41731>
2026-05-28 11:24:42 +00:00
Samuel Pitoiset
85ac866f5e util: add a separate file for turnip drirc
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41731>
2026-05-28 11:24:42 +00:00
Samuel Pitoiset
aba4094636 util: add a separate file for RadeonSI drirc
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41731>
2026-05-28 11:24:41 +00:00
Samuel Pitoiset
c8da45dd99 util: add a separate file for Zink drirc
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41731>
2026-05-28 11:24:41 +00:00
Samuel Pitoiset
a33f1dfd2c util: share the DOCTYPE for all driconf files
We can just pass it to xmllint.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41731>
2026-05-28 11:24:41 +00:00
Benjamin Cheng
d839fca16b util/ycbcr: Add a narrow range RGB coeff helper
The existing util_get_narrow_range_coeffs doesn't work for RGB, since
all channels in RGB will share the same scale and bias.

Signed-off-by: Benjamin Cheng <benjamin.cheng@amd.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41787>
2026-05-27 18:58:18 +00:00
Benjamin Cheng
246ca800dd util/ycbcr: Fix adjust_to_range
Also add some tests for this.

Fixes: f6f2e16e35 ("util: add common ycbcr coefficient math code")
Signed-off-by: Benjamin Cheng <benjamin.cheng@amd.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41787>
2026-05-27 18:58:18 +00:00
Emma Anholt
4c03db9ec8 tu: Disable 128-wide subgroups on No Man's Sky.
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
It has a lighting compute shader that assumes either 32 or 64, and that
produces vertical banding if the compiler opts for 128.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15423
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41665>
2026-05-27 18:19:10 +00:00
Calder Young
bec5d3fff5 anv: Add workaround for vertex explosions in Split Fiction
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The game tries to use anisotropic filtering deep in some control flow
while updating a procedural displacement map, our sampling hardware
does not check the channel enable mask before calculating the
derivatives for each subspan, which causes it to get garbage for any
subspans that have partially disabled lanes.

This workaround converts any sample messages in fragment shaders that
have divergent control flow into a sample_d message with the derivatives
zero'd by software if some of the lanes are disabled.

Closes: #12796
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41716>
2026-05-26 21:21:55 +00:00
Samuel Pitoiset
e2e7fce6e9 radv: rename radv_zero_vram to vk_zero_vram
More common and this implicitly enables this for Path Of Exile and X4
Foundations. Though, zero VRAM allocs is already the default in AMDGPU,
so that doesn't change anything in practice (except for very old
kernels).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41735>
2026-05-25 16:49:28 +00:00
Lionel Landwerlin
fd11e4b4d3 intel: switch shader hash to 64bit value
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41748>
2026-05-22 15:05:30 +00:00
Valentine Burley
190ce8280f meson: Add Soong compatibility compiler flags to Vulkan drivers
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Suggested by @gurchetansingh.

Android's Soong build system treats several compiler warnings as errors
by default: https://android.googlesource.com/platform/build/soong/+/27f57506/cc/config/global.go/#218

To catch these issues in Mesa, introduce `soong_compat_c_args`
and `soong_compat_cpp_args` with the following flags treated as errors:
 -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS
 -Werror=date-time
 -Werror=gnu-alignof-expression
 -Werror=ignored-qualifiers
 -Werror=implicit-fallthrough
 -Werror=int-conversion
 -Werror=missing-prototypes
 -Werror=pragma-pack
 -Werror=pragma-pack-suspicious-include
 -Werror=sizeof-array-div
 -Werror=string-plus-int
 -Werror=unreachable-code-loop-increment

These compatibility flags are added to the meson configurations
for ANV, Gfxstream, Lavapipe, PanVK, Turnip, and Venus.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Gurchetan Singh <gurchetan.singh.foss@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41644>
2026-05-22 07:09:49 +00:00
Lionel Landwerlin
dd41fde91d anv: use the new generation script for drirc
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41664>
2026-05-22 06:32:39 +00:00
Lionel Landwerlin
d8ab38e5e3 drirc: remove non Anv option in the Anv section
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41664>
2026-05-22 06:32:39 +00:00
Lionel Landwerlin
83ed74b5df hasvk: add a driver section for drirc
Only adding the workarounds that have an actual effect on that driver.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41664>
2026-05-22 06:32:39 +00:00
Lionel Landwerlin
af88ba317d hasvk: rename a couple of drirc options
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41664>
2026-05-22 06:32:39 +00:00
Lionel Landwerlin
61267c69db util/drirc_gen: enable validation for a specific driver
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41664>
2026-05-22 06:32:39 +00:00
Samuel Pitoiset
ccb669a05f util: add very basic way to validate drirc files
This just checks for option names that don't exist. This is something
that already happened in the past with RADV.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41700>
2026-05-21 14:26:28 +00:00
Samuel Pitoiset
91cf0a6e6d radv: use the new generation script for drirc
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41634>
2026-05-21 12:57:43 +00:00
Lucas Francisco Fryzek
7b84183201 util/u_trace: Don't use empty initializer list
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Modify empty initializer list to use a zero initializer so we aren't
relying on the gnu extension.

Fixes: 690d9b0d00 ("util/u_trace: Rework resource management")
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41715>
2026-05-21 12:18:07 +00:00
Christoph Neuhauser
7eba054c5b anv: Add compute only divergent atomics fusion optimization for Blender
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Blender uses atomic operations as part of its virtual shadow mapping
implementation. Virtual shadow mapping page tagging in compute shaders
benefits from divergent atomics fusion, while fragment shaders doing the
atomic raster step in general have worse performance with this
optimization turned on.
Thus, an option is added to only apply divergent atomics fusion to compute
shaders in ANV, and this option is enabled for Blender.

Initial support for divergent atomics fusion optimization in ANV was added
in https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40631.

Signed-off-by: Christoph Neuhauser <christoph.neuhauser@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41706>
2026-05-20 19:29:15 +00:00
Georg Lehmann
a6c444d073 radv: enable radv_force_64_byte_sampled_image for Forza Horizon 6
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Using 64 byte descriptors lets vkd3d-proton work around
descriptor type mismatches.

Cc: mesa-stable

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41680>
2026-05-20 13:03:02 +00:00
Georg Lehmann
1234a01dda radv: add radv_force_64_byte_sampled_image dri conf option
Cc: mesa-stable

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41680>
2026-05-20 13:03:01 +00:00
Samuel Pitoiset
326d7eaa48 util: fix declaring drirc options as string
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41699>
2026-05-20 09:21:26 +00:00
Samuel Pitoiset
428c9d64e5 util: do not generate drirc options that shouldn't be parsed
Options without c_name aren't going to be used by the driver, they are
used for something else like WSI.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41699>
2026-05-20 09:21:26 +00:00
Lionel Landwerlin
a9aeae71f5 util: add a script to auto-generate a drirc infrascture per driver
Instead of having each driver define :
  - options through DRI_CONF_OPT_* macros
  - call driQueryOption*() to parse those options
  - define all the variables to old those options' values

We add one script to do it all for you. All you have to do now is list
all the options you want in a python file.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41697>
2026-05-20 08:00:57 +00:00
Danylo Piliaiev
617da94f82 u_trace: Lazy init ut->linear_alloc
We don't want to waste memory when u_trace isn't used.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41271>
2026-05-19 20:27:59 +00:00
Konstantin Seurer
7b2301f06d util/u_trace: Print tracepoints with indentation
Thjis patch adds u_tracepoint_type to mark begin/end tracepoints.
Tracepoints inside a begin/end range will be printed with an
indentation.

Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41271>
2026-05-19 20:27:59 +00:00
Konstantin Seurer
690d9b0d00 util/u_trace: Rework resource management
Stops allocating events in chunks. u_trace_event is allocated using a
linear allocator which has minimal overhead. Buffers for timestamps are
allocated using a custom allocator.

As a sideeffect, it is possible to deduplicate consecutive tracepoints.

Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41271>
2026-05-19 20:27:59 +00:00
Konstantin Seurer
98c1abd342 util/u_trace: Add an option to emit additional code
radv will generate additional wrapper functions for the tracepoints.

Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41271>
2026-05-19 20:27:58 +00:00
Samuel Pitoiset
54b71e9e77 util: pass a struct to driParseConfigFiles()
It would be easier to add more functionalities like shader hashes etc.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41657>
2026-05-19 19:51:45 +00:00
Samuel Pitoiset
b1083190d0 radv: enable radv_wait_for_vm_map_updates for Forza Horizon 6
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
It seems to have the same bug as Forza Horizon 5.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41637>
2026-05-19 12:33:10 +00:00
Marek Olšák
df54208fab util/set: add helper _mesa_set_equal
Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41329>
2026-05-19 04:26:54 +00:00
Tanner Van De Walle
f9e7b9568b util/format: add lower-bound assert on format
The generated util_format_description(),
util_format_pack_description(), and
util_format_unpack_description_generic() helpers assert
format < PIPE_FORMAT_COUNT but not format >= 0. MSVC's prefast
static analyzer reports C33010 (UNCHECKED_LOWER_BOUND_FOR_ENUMINDEX)
on the subsequent array subscript, since it cannot prove the
non-negative side of the bound. Extending the existing assert in
the generator silences the warning across all three accessors.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41447>
2026-05-14 17:46:16 +00:00
Danylo Piliaiev
5529f15f31 tu: Disable concurrent binning by default due to perf regressions
Unfortunately we have to disable concurrent binning by default
because it hurts performance in a number of desktop games without
any case where we know it helps.

There are less vertex fetch resource available in BV compared to BR,
so when binning runs in BV, there are many vertices, and vertices are
attribute heavy - BV has much worse performance than BR, sometimes more
than 50% worse.

Even with worse performance it won't be bad if concurrent binning
actually overlapped with other workload in those cases, but in case of
desktop games - there is almost never a chance for overlap.
However it's impossible to statically find out if binning on BV would
be much slower than on BR, and we also cannot statically predict if
there is enough overlap (if any) to cover for the performance penalty.

Given the above, I don't see a way out but to make concurrent binning
opt in via `tu_allow_concurrent_binning` driconf toggle.

Still allow concurrent binning in CI to catch issues early.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41394>
2026-05-14 14:38:35 +02:00
Dorinda Bassey
05cfc37da0 util/rust: Add atomic memory synchronization support
Add AtomicMemorySentinel for cross-platform atomic
memory synchronization. This provides a
platform-agnostic API over Linux futex syscalls,
allowing shared memory synchronization via
memory-mapped file descriptors.

Includes Linux futex implementation and stub
implementations for Windows and other platforms.

Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39653>
2026-05-13 19:57:51 +00:00