Commit graph

3173 commits

Author SHA1 Message Date
Caio Oliveira
b74eff31d9 util: Add runtime parser for boolean lookup tables
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41872>
2026-06-03 15:23:20 +00:00
Gleb Popov
6ae0114b05 Rename the CACHE_LINE_SIZE define to MESA_CACHE_LINE_SIZE
The former clashes with a define with the same name that comes from FreeBSD
base headers.

Closes #5737

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41906>
2026-06-02 20:04:20 +00:00
Emma Anholt
aa26be6ea9 tu: Move to using drirc_gen.
Slight reduction in boilerplate (driconf.h definition, tu_device.cc
parsing, tu_device.h instance definitions), plus validation that you don't
typo between 00-turnip-defaults.conf and tu_device.cc parsing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41877>
2026-06-02 18:49:48 +00:00
Emma Anholt
ae2cc693f8 util/drirc_gen: Make the header usable from C++.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41877>
2026-06-02 18:49:48 +00:00
Emma Anholt
2595e4a972 util/drirc_gen: Move the common VK WSI options to a core helper function.
I didn't want to copy and paste this again for tu.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41877>
2026-06-02 18:49:48 +00:00
Emma Anholt
2ac718c1b8 util/drirc_gen: Add a little documentation of what this does.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41877>
2026-06-02 18:49:48 +00:00
Jakob Sinclair
3a3099369f gallium: fix type size in z24_unorm_packed_pack_z_32unorm
util_format_z24_unorm_packed_pack_z_32unorm was accidentally writing
48-bits instead of 24 since it used a 16-bit integer pointer instead of
an 8-bit pointer. This could cause a segfault if the function was used,
but it is currently unused.

Fixes: 18f352090d ("util/format: Add a Z24_UNORM_PACKED format")

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41288>
2026-06-02 13:49:08 +00:00
Karmjit Mahil
1287fee6f7 util: Add heap_memory_percent driconf option
Also adds helper function to be used by drivers.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41242>
2026-06-01 17:32:50 +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
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
Gurchetan Singh
eb17e7b102 util: rust: minor fixups
* Use little-endian since all hardware is basically little-endian
* Fix dead_code warning on non-Linux platforms

Reviewed-by: David Gilhooley <djgilhooley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41754>
2026-05-29 03:07:52 +00:00
Gurchetan Singh
5be5cca792 util: rust: sync error handling fixes from downstream
Useful for parse ints and using the ? operator.

Reviewed-by: David Gilhooley <djgilhooley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41754>
2026-05-29 03:07:52 +00:00
Val Packett
10620bdf21 util: rust: Add a way to create a Tube from an existing OwnedFd
Signed-off-by: Val Packett <val@invisiblethingslab.com>
Signed-off-by: Gurchetan Singh <gurchetan.singh.foss@gmail.com>
Reviewed-by: David Gilhooley <djgilhooley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41754>
2026-05-29 03:07:52 +00:00
Val Packett
4f13941e44 util: rust: Support detecting socket file descriptors
Useful for Pipewire passthrough.

Signed-off-by: Val Packett <val@invisiblethingslab.com>
Signed-off-by: Gurchetan Singh <gurchetan.singh.foss@gmail.com>
Reviewed-by: David Gilhooley <djgilhooley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41754>
2026-05-29 03:07:52 +00:00
Val Packett
118e48402c util: rust: align API with real eventfd capabilities
Linux eventfds contain a 64-bit value which can be increased by arbitrary
numbers, and waiting returns a numeric value that consumers might need
to actually read.

Also, reading/waiting does mutate kernel state, so make it &mut self
like reading on std::fs::File is.

Signed-off-by: Val Packett <val@invisiblethingslab.com>
Signed-off-by: Gurchetan Singh <gurchetan.singh.foss@gmail.com>
Reviewed-by: David Gilhooley <djgilhooley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41754>
2026-05-29 03:07:51 +00:00
Eric Engestrom
97391328a3 drirc: move 00-$drv-defaults.conf to each driver's folder
Makes more send to put them there, and it means that modifying them will
only trigger the CI jobs for that driver and not everything.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41866>
2026-05-28 19:55:05 +00:00
Eric Engestrom
3d10616389 util/meson: simplify list of per-driver drirc files
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41866>
2026-05-28 19:55:05 +00:00
Samuel Pitoiset
058c8cc999 util: remove declared but unused drirc options
vk_require_etc2 is used by RADV but it auto-generates the option itself,
so it's safe to remove it from driconf.h.

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:47 +00:00
Samuel Pitoiset
c98ea7d2c9 util,asahi: move drirc entries with no_fp16 to asahi
Asahi is the only driver using them, also rename to asahi_no_fp16.

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:47 +00:00
Samuel Pitoiset
7ec22275f9 util,turnip: move drirc entries with vk_dont_care_as_load to Turnip
Turnip is the only driver using them, also rename to
tu_dont_care_as_load.

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:47 +00:00
Samuel Pitoiset
20c77c8ff0 util: remove useless comments in 00-mesa-defaults.conf
Just make it very simple.

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:47 +00:00
Samuel Pitoiset
8c89732e5b util: add a separate file for hasvk 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:47 +00:00
Samuel Pitoiset
1ecb39ce59 util: add a separate file for v3d 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
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