Commit graph

201327 commits

Author SHA1 Message Date
Samuel Pitoiset
2e51d0c724 radv: add a helper to destroy a logical device
It's less error prone than duplicating every cleanups with a bunch of
gotos.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32112>
2024-11-19 07:02:52 +00:00
Samuel Pitoiset
2181ddf383 radv: destroy meta resources properly when creating the device failed
Better to call radv_device_finish_meta().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32112>
2024-11-19 07:02:52 +00:00
Caio Oliveira
0b66cb1f82 intel/brw: Allow extra SWSB encodings for Xe2
There are new combinations of ordered and unordered dependencies
available for the instructions to use, which among others include:

- combining FLOAT and INT pipe deps in SENDs;
- combining SRC mode deps in regular instructions for the inferred type.

This patch enables a couple of tests checking for the first case.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31375>
2024-11-19 04:27:00 +00:00
Caio Oliveira
1b13eea642 intel/brw: Add test for combining SWSB dependencies in SENDs
These are currently DISABLED_ since they fail.  A later patch will
enable them.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31375>
2024-11-19 04:27:00 +00:00
Dave Airlie
6714689613 nir/functions: force inlining for barriers.
A recent algebraic opt made a function that used to inline
with llvmpipe CL not inline anymore. However that function
has a barrier in it.

Handling barriers from inside a callstack is hard for llvmpipe
coroutines, so just force functions with barriers to be inlined.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32204>
2024-11-19 12:26:28 +10:00
Aaron Ruby
4614097756 meson: Remove experimental from gfxstream driver build
We (QNX) is using this with our VMM, and our Linux reference distro (which is currently in development).
With libaemu removed, it's much easier to integrate into a Linux-guest
build.

Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32161>
2024-11-19 00:42:52 +00:00
Chia-I Wu
0fb4609d94 panvk: add support for VK_EXT_queue_family_foreign
We can treat VK_QUEUE_FAMILY_FOREIGN_EXT as the host,  This makes sure
that, on release, all subqueues self-wait and all caches are flushed.
On acquire, all caches are invalidated.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32164>
2024-11-18 23:06:43 +00:00
Chia-I Wu
715d6e740a panvk: improve VK_QUEUE_FAMILY_EXTERNAL support
The spec says that the user-specified srcStageMask/srcAccessMask should
be ignored for the acquire operation and the user-specified
dstStageMask/dstAccessMask should be ignored for the release operation.

Since we don't need any special handling for VK_QUEUE_FAMILY_EXTERNAL,
override them to NONE.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32164>
2024-11-18 23:06:43 +00:00
Chia-I Wu
9e90e50362 panvk: add normalize_dependency
It normalizes the stage and access masks of a barrier.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32164>
2024-11-18 23:06:43 +00:00
LingMan
0f47e362a6 rusticl: Use C-string literals for DiskCache::new
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31510>
2024-11-18 22:29:14 +00:00
LingMan
85aaeb4bf8 rusticl: Use C-string literals for NirShader::add_var
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31510>
2024-11-18 22:29:14 +00:00
LingMan
b9ccee0071 rusticl/core: Use C-string literals for XPlatManager::get_proc_address_func
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31510>
2024-11-18 22:29:14 +00:00
LingMan
fab6fa2bc8 rusticl/cl_prop: Use C-string literals
Avoids some pointless allocations when converting `&str` to `&CStr`.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31510>
2024-11-18 22:29:14 +00:00
LingMan
7ac2846c96 rusticl: Use C-string literals for spirv extension names
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31510>
2024-11-18 22:29:14 +00:00
LingMan
612ad0cb70 rusticl: Use C-string literals
They got stabilized with Rust 1.77.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31510>
2024-11-18 22:29:14 +00:00
LingMan
62b8e053f7 mesa: Add rustfmt.toml
Unless rustfmt gets informed that we use the 2021 edition, it chokes on
C-string literals.

Passing the `--edition` parameter with every invocation would be annoying.
Create a config file instead.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31510>
2024-11-18 22:29:14 +00:00
LingMan
0ff3e2a0f9 compiler/rust: Use std::mem::offset_of!()
It got stabilized with Rust 1.77.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31510>
2024-11-18 22:29:13 +00:00
LingMan
190fbbe1d6 nak/hw_test: Use std::mem::offset_of!()
It got stabilized with Rust 1.77.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31510>
2024-11-18 22:29:13 +00:00
LingMan
718407e806 mesa: Bump required Rust version to 1.78
The Linux kernel requires Rust 1.78 since version 6.10. Thus, this update is
in line with our Rust update policy.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31510>
2024-11-18 22:29:13 +00:00
Michel Zou
795a36325a ac/gpu_info: Fix missing prototype mingw error
Fixes: 246051ebc6 ("ac/gpu_info: print 32bpp modifiers")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>

Closes #8858

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32177>
2024-11-18 21:49:24 +00:00
Vldly
6d14cad330 freedreno: Fix resource tracking on repeated map with discard
In two functions implementing resource discard rebind_resource is called
on resource before its track record is reset. This prevents update of
dirty_resource or dirty_shader_resource because of conditions in
needs_dirty_resource. With rsc->track reset and dirty_resource bits
missing further calls to transfer_map will not try to reallocate
resource storage when needed.

A way to reproduce the issue in both functions is by executing at least
3 draws modifying bound texture or VBO each time. This patch fixes those
cases and some related piglit tests on a5xx and should fix it on other
GPUs. Also it fixes rendering in Firefox and vsraytrace (except vertical
line at right edge).

Fixes: 0a62a874fc ("freedreno: Re-work dirty-resource tracking")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10374
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32167>
2024-11-18 21:17:50 +00:00
Jordan Justen
eb10dc2e73 intel/dev: Add PTL 0xb0b0 PCI ID
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Sushma Venkatesh Reddy <sushma.venkatesh.reddy@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32149>
2024-11-18 20:53:06 +00:00
Job Noorman
554494e2cd ir3,tu: filter debug flags included in the hash key
Only include debug flags that have an influence on codegen.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32052>
2024-11-18 20:19:56 +00:00
Job Noorman
d8c90806e4 ir3,tu: include ir3 debug flags in shader hash key
Many debug flags influence shader codegen but are currently not included
in the hash key. This causes surprising effects as cache lookups may
return shaders compiled with different debug flags than currently in
effect. This patch fixes this by including all debug flags  in the
shader hash key.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Fixes: c323848b0b ("ir3, tu: Plumb through support for per-shader robustness")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32052>
2024-11-18 20:19:56 +00:00
David Rosca
4ec43c59da radeonsi/vcn: Use correct frame context buffer for preencode on VCN5
Fixes: 3c5fe03b92 ("radeonsi/vcn: Add support for VCN5 dpb tier2")
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31985>
2024-11-18 19:41:05 +00:00
Karol Herbst
c0edb9344f rusticl: enable cl_khr_depth_images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30831>
2024-11-18 17:57:29 +00:00
Karol Herbst
67212c2fa6 rusticl/device: advertize cl_khr_depth_images if supported
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30831>
2024-11-18 17:57:29 +00:00
Karol Herbst
2aec563acf rusticl/image: fix clEnqueueFillImage for CL_DEPTH
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30831>
2024-11-18 17:57:28 +00:00
Karol Herbst
2acfb55dfb rusticl/mem: add restrictions for CL_DEPTH, CL_DEPTH_STENCIL and msaa images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30831>
2024-11-18 17:57:28 +00:00
Karol Herbst
fa379a9495 nir/lower_cl_images: lower scalar image_loads to vec4
This will be required for supporting depth images as the rest of mesa assumes those
to always return vec4.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30831>
2024-11-18 17:57:28 +00:00
Gurchetan Singh
b805e23f40 gfxstream: change output location
Change the output location for codegen to guest/vulkan_enc.
This is only run by AOSP devs, so it won't affect upstream.

Reviewed-by: Marcin Radomski <dextero@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32148>
2024-11-18 17:16:28 +00:00
Gurchetan Singh
214dee0447 gfxstream: for Android, look for the autogenerated files
This is mostly a developer preference issue.  Some Android
devs like to commit auto-generated files for ${reasons},
though the style of Mesa is not to do so.

I personally like the Mesa style, since otherwise a 25 million
LoC project would be 40 million, but whatever.

An easy solution to just to check them in AOSP Mesa, but not
in upstream.  There are various mechanisms, particularly
auto-rollers, that enable this.  For example, there is no plan to
check in Blueprint files upstream, but they will be checked-in
and committed by the auto-roller.

For the scheme to work, we'll need slightly different meson
rules when the build target is Android versus otherwise.

Reviewed-by: Marcin Radomski <dextero@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32148>
2024-11-18 17:16:28 +00:00
Gurchetan Singh
7c219ae7e0 gfxstream: delete qemu_pipe target
It has no sources..

Reviewed-by: Marcin Radomski <dextero@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32148>
2024-11-18 17:16:28 +00:00
Gurchetan Singh
9a1654f5ce gfxstream: conditionals for using gfxstream::aemu
It's a guest-only build target, and shouldn't be on the host.

Reviewed-by: Marcin Radomski <dextero@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32148>
2024-11-18 17:16:28 +00:00
Joshua Duong
04f5bfaee6 gfxstream: update auto-generated comments.
gfxstream-protocols/scripts/generate-vulkan-sources.sh ==>
mesa3d/src/gfxstream/codegen/generate-gfxstream-vulkan.sh

Reviewed-by: Marcin Radomski <dextero@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32148>
2024-11-18 17:16:28 +00:00
Bo Hu
cd8b4d730b gfxstream: snapshot: DescriptorSet allocate and update
When batched descriptorset udpate optimization is turned
off, the descriptorset is not handled in snapshot.
This cl handles this situation.

Reviewed-by: Marcin Radomski <dextero@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32148>
2024-11-18 17:16:28 +00:00
Bo Hu
94b906ae44 gfxstream: snapshot: avoid double boxing dispatchable handle
For dispatchable handle, such as commandBuffer, it is always
left as boxed by decoder; consequently snapshoter should not
box it again.

Reviewed-by: Marcin Radomski <dextero@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32148>
2024-11-18 17:16:28 +00:00
Lionel Landwerlin
8845255881 anv: fix missing push constant reallocation
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 62d96a6546 ("anv: add dirty tracking for push constant data")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12151
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30007>
2024-11-18 16:31:33 +00:00
Manuel
217c17e8a2 gfxstream: Avoid repeated functionality
Removed a function that creates anonymous file descriptors when called.
Additionally replaced a call of said function with the one from the "util"
directory. The intention is to avoid repeated functionality

util: Allow code to be compatible in c++ compilers

Added an extern "C" statement and preprocessor directives to make the
“os_create_anonymous_file” function compatible with c++ compilers

Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32096>
2024-11-18 15:51:48 +00:00
Nanley Chery
f1724b44d0 anv: Drop fast-clear value conversion check
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5622
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32187>
2024-11-18 14:57:46 +00:00
Nanley Chery
93e42f9700 anv: Store fast-clear colors with the view swizzle
Prevents the next patch from failing CTS tests such as:

   dEQP-VK.api.image_clearing.core.clear_color_image.*.b4g4r4a4*

Brings back the feature that was introduced in commit 46187bb54f
("anv: Swizzle fast-clear values"), but went unused in commit
721d0c3e77 ("anv,hasvk: Always use BLORP_BATCH_NO_UPDATE_CLEAR_COLOR").

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32187>
2024-11-18 14:57:46 +00:00
Nanley Chery
2a9d7a3bd0 anv: Support non-0/1 sRGB fast-clear colors on gfx9
We're going to drop a generic restriction on clear color conversions in
anv_can_fast_clear_color(). Without preparing for it, the following
tests would fail:

* piglit.spec.arb_framebuffer_srgb.blit texture srgb msaa disabled clear.gen9_zinkm64
* piglit.spec.arb_framebuffer_srgb.blit renderbuffer srgb msaa disabled clear.gen9_zinkm64
* piglit.spec.arb_framebuffer_srgb.blit texture srgb downsample enabled clear.gen9_zinkm64
* piglit.spec.arb_framebuffer_srgb.blit renderbuffer srgb downsample enabled clear.gen9_zinkm64
* piglit.spec.arb_framebuffer_srgb.blit renderbuffer srgb msaa enabled clear.gen9_zinkm64
* piglit.spec.arb_framebuffer_srgb.blit texture srgb msaa enabled clear.gen9_zinkm64

So, add support for sRGB sampling via BLORP transfer operations and drop
the gfx9-specific restriction on sRGB fast-clears.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32187>
2024-11-18 14:57:46 +00:00
Marek Olšák
899bee4af8 nir/opt_varyings: don't count the cost of the same instruction multiple times
Use pass_flags to indicate whether the instruction has already been added
to the total cost of the expression.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32174>
2024-11-18 13:39:08 +00:00
Marek Olšák
405e9d9b74 nir/opt_varyings: implement compaction without flexible interpolation
We have to honor drivers when they say that different interpolation
qualifiers can't be mixed in the same vec4, indicated by
nir_io_has_flexible_input_interpolation_except_flat not being set.

This is a prerequisite for enabling nir_opt_varyings for all drivers.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32174>
2024-11-18 13:39:08 +00:00
Marek Olšák
a7c671efc6 nir/opt_varyings: fix packing color varyings
BITSET_TEST_RANGE_INSIDE_WORD uses first_bit .. last_bit, same as
BITSET_RANGE, not first_bit .. size like BITFIELD_RANGE.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32174>
2024-11-18 13:39:08 +00:00
Marek Olšák
f9b03cf405 nir/opt_varyings: add nir_io_compaction_rotates_color_channels
This was enabled by default in nir_opt_varyings, but vc4 can't handle
when shader outputs write Y but not X. Add an option for it and enable
it only for the driver that benefits from it.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32174>
2024-11-18 13:39:08 +00:00
Marek Olšák
8518e1cfd7 nir/opt_varyings: add nir_io_always_interpolate_convergent_fs_inputs
for Asahi

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32174>
2024-11-18 13:39:08 +00:00
Kenneth Graunke
95bc42af74 nir: Use load_global_constant for reorderable nir_var_mem_global access
The main difference between load_global and load_global_constant is that
the latter can be reordered arbitrarily.  If the access being lowered is
already tagged as being reorderable, then we can preserve that by using
the load_global_constant intrinsics instead of load_global.  This gives
us more flexibility.

On Intel, this lets us use the load_global_constant_uniform_block_intel
intrinsic for doing convergent block loads in more cases.  This nets us
significant reductions in spill/fills: Borderlands 3 on Lunarlake sees
spills/fills reduced by 53%.  Alchemist sees a 13% reduction.

Improves performance of Borderlands 3 DX12 on Intel Battlemage by
around 44%.  Improves Hogwarts Legacy by around 14%.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31995>
2024-11-18 12:55:47 +00:00
Kenneth Graunke
5848035443 brw: Fix try_rebuild_source's ult32/ushr handling to use unsigned types
We were accidentally doing a signed integer comparison here for ult32,
or a sign-extending shift for ushr.

One notable bit of fallout was that load_global_uniform_block_intel
address calculations broke on platforms that don't have native 64-bit
integer support, as the iadd64 lowering for "do I need to carry?" was
using ult32...and performing the wrong comparison.  We spotted this in
Borderlands 3 on Alchemist once we turned on other optimizations.

Thanks to Lionel Landwerlin for helping spot the problem!

Fixes: c7b312ad45 ("brw: factor out source extraction for rematerialization")
Fixes: 339630ab05 ("brw: enable A64 loads source rematerialization")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31995>
2024-11-18 12:55:47 +00:00
Kenneth Graunke
0a376a672a brw: Fix emit_a64_oword_block_header UNIFORM -> VGRF copies
This was triggering an assertion in the fs_builder::MOV helper that
the destination stride can't be 0 when dispatch_width > 1.  What we
want to do is copy the single 64-bit channel of data from the UNIFORM
file to a VGRF.  We can use a SIMD1 builder for that.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31995>
2024-11-18 12:55:47 +00:00