Commit graph

190646 commits

Author SHA1 Message Date
Job Noorman
455ebcccfb ir3: add encoding for isam.v
isam.v is a version of isam that can load multiple components from IBOs.
It uses some bits that are used for different purposes in other tex
instructions:
- bit 50 (.v): .s elsewhere
- bit 53 (indicates whether an immediate offset is used): .p elsewhere
- bit 18 (.1d when not set, has to be set for .v): 0 elsewhere

For this reason, the bitset hierarchy for cat5 had to be reordered a
bit.

The immediate offset is encoded as an extra (immed) source register and
an instruction flag (to be able to make the distinction between offset
zero and no offset, although this might not be useful).

This also adds a flag for the .1d field. Since this bit is active-low,
this flag has inverted semantics: setting it will make .1d inactive.
Note that some existing disassembler tests for isam had to be updated
because the bit is never set and this is now disassembled as .1d. This
matches the blob's disassembler.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28664>
2024-06-14 17:12:59 +00:00
Job Noorman
c2dbc4a00a ir3: simplify cat5 parsing
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28664>
2024-06-14 17:12:59 +00:00
Eric Engestrom
ba55fa3163 glx: fix build -D glx-direct=false
Fixes: 014bbae4bf ("glx: pass implicit load param through allocation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29732>
2024-06-14 16:24:33 +00:00
Alyssa Rosenzweig
ece3896d5b asahi: add broken bits of unstable Linux UAPI
Rebasing around this patch has been a significant burden for development.
Staging patches to asahi/mesa helps somewhat but 1. it's still really
frustrating to have this much divergence with upstream, and 2. ideally we
wouldn't have to do that.

The kernel upstreaming is stalled for various reasons.  This patch adds
compile-only code to speak the unstable Linux UAPI for the SOLE purpose of
reducing my rebase pain... NOT to actually work.

It is NOT for users OR distro maintainers. asahi will refuse to probe on
upstream Mesa to protect against regressions. The uapi is NOT STABLE and
upstream Mesa CANNOT be used with it. Attempting to bypass this WILL give you a
broken system.

This patch employs several layers of deterrents against system-breaking
enablement. With a lot of warning text at the relevant sites.  Hopefully that is
good enough to prevent people from breaking systems. And if people brazenly
ignore all of the above ... they get to pick up the pieces.

You have been warned.

---

There is significant prior art for Mesa including downstream kernel uapi
supports in-tree:

* powervr (downstream android driver)
* turnip (downstream kgsl android driver)
* asahi ... ironically (prop macOS kernel driver)
* maybe vc4?

Linux is only special because of distros shipping tagged Mesa releases. The
several layers of guards here guarantee that no tagged Mesa release would
possibly probe even on an asahi downstream kernel. A distro would need a
significant scary patch to make it probe. If/when it breaks, that's on them
and they pick up the pieces.

I make a stability guarantee ONLY for Fedora Asahi Remix -- where we push
packages for both a downstream kernel and Mesa in tandem, while we patiently
wait for upstreaming -- and that is *it*. It will be a nice future when this all
works upstream, but unfortunately we're not there yet.

Acked by Dave [1] and Sima [2]

[1] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29620#note_2444189
[2] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29620#note_2445155

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Co-developed-by: Asahi Lina <lina@asahilina.net>
Signed-off-by: Asahi Lina <lina@asahilina.net>
Co-developed-by: Sergio Lopez <slp@sinrega.org>
Signed-off-by: Sergio Lopez <slp@sinrega.org>
Co-developed-by: i509VCB <git@i509.me>
Signed-off-by: i509VCB <git@i509.me>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29620>
2024-06-14 15:44:30 +00:00
Alyssa Rosenzweig
08984e68fb gallium: remove ability to probe asahi
The asahi uapi is unstable. Do not attempt to probe on it.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29620>
2024-06-14 15:44:30 +00:00
Corentin Noël
8c5c93acba wsi: Make sure to return a valid wayland id string
The result of asprintf was previously ignored, handle the case of failure by
not returning undefined content.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29724>
2024-06-14 15:18:56 +00:00
Daniel Schürmann
b7982152ff aco: use aco::monotonic_allocator for IDSet
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29713>
2024-06-14 14:32:35 +00:00
Daniel Schürmann
97fd5d3f33 aco: make aco::monotonic_buffer_resource declaration visible for aco::IDSet
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29713>
2024-06-14 14:32:35 +00:00
Daniel Schürmann
95967c2ca0 aco/reindex_ssa: replace live_var parameter with boolean
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29713>
2024-06-14 14:32:35 +00:00
Daniel Schürmann
a497d105e3 aco: move live var information into struct Program
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29713>
2024-06-14 14:32:35 +00:00
Daniel Schürmann
2322ab427e aco/scheduler: remove unused register_demand parameter
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29713>
2024-06-14 14:32:35 +00:00
Karol Herbst
169dc86e74 gallium: properly type fields of pipe_resource.usage
This gets rid of most of the pointless bitfields and also moves away from
unsigned, which we really should stop using :)

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29720>
2024-06-14 13:56:34 +00:00
Karol Herbst
40785d9a52 gallium: properly type pipe_resource.usage with the enum
This allows for a more strongly typed field on the Rust side.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29720>
2024-06-14 13:56:34 +00:00
Karol Herbst
f58247882a gallium: reduce pipe_resource.usage to 4 bits
This works around a bindgen bug, but also moves the value into a single
byte as per the addition of compression_rate it spanned over two bytes.

Fixes: 5db7398672 ("gallium: add interface for fixed-rate surface/texture compression")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29720>
2024-06-14 13:56:34 +00:00
Danylo Piliaiev
59937f62a6 ir3/a7xx: Fix FS consts corruption when other FS has zero constlen
Having zero consts in one FS may corrupt consts in follow up FSs,
on such GPUs blob never has zero consts in FS. The mechanism of
corruption is unknown.

Fixes geometry flickering in a number of games, including:
 Baldur's Gate 3
 Assasin's Creed Rogue

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29357>
2024-06-14 13:27:01 +00:00
Danylo Piliaiev
98e3b1bc5f freedreno/a7xx: Update TPL1_DBG_ECO_CNTL1 to fix UBWC corruption
Copying UBWC image via BLIT_OP_SCALE may be corrupted if previously
someone copied image with bit 18 set in TPL1_DBG_ECO_CNTL1.

Found by replaying blob's cmdstream on a740, but somehow this issue
doesn't happen on Android.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29358>
2024-06-14 12:21:03 +00:00
Eric Engestrom
44e6850016 bin/ci: escape literal url in regex
Fixes: b24dd1fa1c ("ci: Fix parse GitLab pipeline url")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29718>
2024-06-14 11:46:52 +00:00
Pierre-Eric Pelloux-Prayer
5c50e028d1 ac/sqtt: make VA helpers static
They're only used from ac_sqtt so don't expose them.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25397>
2024-06-14 10:32:17 +02:00
Pierre-Eric Pelloux-Prayer
c44b20e8d6 radeonsi/sqtt: add AMD_THREAD_TRACE_INSTRUCTION_TIMING
To control if instruction timing should be enabled (on by default).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25397>
2024-06-14 10:32:10 +02:00
Pierre-Eric Pelloux-Prayer
365fda834e radeonsi: use the common SQTT implementation
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25397>
2024-06-14 10:32:04 +02:00
Sergi Blanch Torne
0c092dc5c4 ci: run_n_monitor, collect and summarize
The job duration is printed during the test progress. It can be collected and
summarized at the end of the process. It is interesting when doing a stress
test as one will have this information together at the end.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29419>
2024-06-14 08:04:56 +00:00
Konstantin Seurer
5726ecae3e khronos-update: Add ANDROID guards to vk_android_native_buffer.h
Avoids adding back the code after every header update.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29621>
2024-06-14 06:58:35 +00:00
Samuel Pitoiset
3f9fe2dbe1 radv: use BDA in the DGC prepare shader
Only for buffers that are managed by the application (ie. preprocess,
stream and sequence buffers). For future work.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29605>
2024-06-14 06:35:18 +00:00
Samuel Pitoiset
730ba8322f radv: fix incorrect buffer_list advance for multi-planar descriptors
If we have an array of multi-planar descriptors, buffer_list was
incorrectly incremented and this could have overwritten some BO entries.

In practice, this situation should be very rare because most of the
applications enable the global BO list.

Cc: mesa-stable
Closes: #10559
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28816>
2024-06-14 06:14:30 +00:00
David Rosca
39fdd2aec0 radeonsi: Make si_compute_clear_image work with 422 subsampled formats
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29598>
2024-06-14 03:19:24 +00:00
Qiang Yu
4a18809a56 radeonsi: add missing nir_intrinsic_bindless_image_descriptor_amd
Otherwise we get shader compilation error when imageSize().

Fixes: d4fdeaa820 ("radeonsi: replace llvm resource code with nir lower")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29690>
2024-06-14 02:52:52 +00:00
Qiang Yu
b1d0ecd00d glsl: respect GL_EXT_shader_image_load_formatted when image is embedded in a struct
Fix compilation failure when image is embedded in struct when
GL_EXT_shader_image_load_formatted is enabled:

  struct GpuPointShadow {
      image2D RayTracedShadowMapImage;
  };

  layout(std140, binding = 2) uniform ShadowsUBO {
      GpuPointShadow PointShadows[1];
  } shadowsUBO;

Compile log:
  error: image not qualified with `writeonly' must have a format layout qualifier

Fixes: 082d180a22 ("mesa, glsl: add support for EXT_shader_image_load_formatted")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29693>
2024-06-14 02:21:59 +00:00
Faith Ekstrand
8307fa95ec nvk: Refactor build_cbuf_map()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:46 +00:00
Faith Ekstrand
636604ea5a nvk: Only write draw parameters to cb0 when they change
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:46 +00:00
Faith Ekstrand
9f7081b921 nvk: Use inline constant buffer updates for CB0
This is what the old GL driver did and appears to be what the blob does
as well.  They should pipeline much better than full buffer re-binds
which appear to be causing stalling issues inside the GPU.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:46 +00:00
Faith Ekstrand
f716bab6b7 nvk: Pass the queue to draw/dispatch_state_init()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:46 +00:00
Faith Ekstrand
b2d85ca36f nvk: Use helper macros for accessing root descriptors
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:46 +00:00
Faith Ekstrand
2423b0b295 nvk: Pass the base workgroup and global size to flush_compute_state()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:46 +00:00
Faith Ekstrand
7a0237bdcf nvk: s/draw_idx/draw_index/g
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:46 +00:00
Faith Ekstrand
20f21b1917 nvk: Use cbuf loads for variable pointers dynamic SSBO descriptors
We want everything that touches the root table to go through ldc path
and not to use global loads.  This means that we need to do some
juggling to handle dynamic SSBO descriptors in the variable pointers
case.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:46 +00:00
Faith Ekstrand
091a945b57 nvk: Be much more conservative about rebinding cbufs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:46 +00:00
Faith Ekstrand
8b5835af31 nvk: Use bindless cbufs on Turing+
These are much faster than ld.global.constant.  This takes The Witness
from 103 FPS to 130 FPS on my 4060 laptop GPU when run with
NVK_DEBUG=no_cbuf

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:46 +00:00
Faith Ekstrand
248b22d158 nvk/descriptor_set_layout: Record which dynamic buffers are UBOs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:46 +00:00
Faith Ekstrand
6e41f2a28d nvk: Allow the cbuf optimization for VK_DESCRIPTOR_TYPE_MUTABLE_EXT
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:46 +00:00
Faith Ekstrand
723e5cae59 nvk: Move the zero offset optimization to load_descriptor_for_idx_intrin()
Looking at binding_layout->desc_type is sketchy in the face of mutable
descriptors.  It's safer for load_descriptor() to just return the
descriptor.  load_descriptor_for_idx_intrin() knows about the
descriptor's actual shader usage and we can do the optimization there.

This isn't actually a bug fix.  The optimization just didn't happen in
the presence of mutable descriptors.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:46 +00:00
Faith Ekstrand
05e213f03e nvk/lower_descriptors: Add a descriptor_type_is_ubo/ssbo() helper
This is a small behavioral change as we are no longer double-counting
inline uniform data loads when determining cbuf priority.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:46 +00:00
Faith Ekstrand
903fb6f74a nvk: Make nvk_min_cbuf_alignment() inline
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:46 +00:00
Faith Ekstrand
cbe62813a1 nvk: Rename nvk_cmd_buffr_get_cbuf_descriptor()
This makes it clear that it returns an address, not a descriptor.  That
distinction will matter soon.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:46 +00:00
Faith Ekstrand
59303584e3 nvk: Align buffer descriptors
In theory, the app is supposed to do this for us but this gives us a bit
of protection against potential GPU faults.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:46 +00:00
Faith Ekstrand
5685de8795 nvk: Split write_[dynamic_]buffer_desc into UBO and SSBO variants
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:46 +00:00
Faith Ekstrand
6387ae7dfb nvk: Split SSBO and UBO address formats
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:46 +00:00
Faith Ekstrand
dc7b08c41a nak: Implement nir_intrinsic_ldcx_nv
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:46 +00:00
Faith Ekstrand
851b3ddd05 nak: Lower non-uniform ldcx_nv to global loads
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:46 +00:00
Faith Ekstrand
e05cb967e7 nir: Add nir_foreach_block_in_cf_node_safe() iterators
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:46 +00:00
Faith Ekstrand
7b5856ebe9 nak: Implement [un]pin_cx_handle_nv
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:46 +00:00