Commit Graph

190626 Commits

Author SHA1 Message Date
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
Faith Ekstrand
12b79f814b nak: Implement r2ur_nv
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:46 +00:00
Faith Ekstrand
dc99d9b2df nvk,nak: Switch to nir_intrinsic_ldc_nv
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:45 +00:00
Faith Ekstrand
b107240474 nir: Add some new _nv intrinsics
The ldc_nv and ldcx_nv intrinsics correspond to the index and bindless
forms of NVIDIA's LDC instruction, respectively.  ldc_nv is pretty much
load_ubo without some of the unnecessary constant bits while ldcx_nv
takes a 64-bit bindless handle instead of an index.  The other two give
us a little control over register allocation at the NIR level to ensure
that LDCX handles are placed in uniform registers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:45 +00:00
Faith Ekstrand
ab84cf11c7 nak/copy_prop: Don't propagate bindless cbufs into non-uniform blocks
We can propagate within a non-uniform block just fine but not across
them because that might change live registers in unpredictable ways.
The real boundary here is that we can't propagate across an OpPin but
that's a lot harder to express.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:45 +00:00
Faith Ekstrand
06fc2d018e nak/legalize: Bindless cbufs must be pinned in non-uniform blocks
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:45 +00:00
Faith Ekstrand
c8e25b45fb nak/legalize: Allow pinned uniform vectors in non-uniform blocks
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:45 +00:00
Faith Ekstrand
2279c2dd65 nak: Add OpPin and OpUnpin
These act as a vector OpCopy, except that copy-prop can't see through
them and the destination of OpPin gets pinned in the register file and
is unallowed to move.  Of course, we have to be careful with these
because spilling can't spill them, either.  If we have too many live
pinned values at the same time, spilling or RA may fail.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:45 +00:00
Faith Ekstrand
718ef00ca4 nak/ra: Add a concept of pinned registers to RegAllocator
Unlike the pinned set in VecRegAllocator which exists for the duration
of an instruction, registers which are pinned in the main allocator are
pinned until the register is freed.  The pinned set in VecRegAllocator
is initialized to a copy of the one in the main register allocator.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:45 +00:00
Faith Ekstrand
049e7ce920 nak/ra: Rename PinnedRegAllocator to VecRegAllocator
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:45 +00:00
Faith Ekstrand
b1dbe42343 nak/ra: Pull searching for unused/unpinned regs into a helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:45 +00:00
Faith Ekstrand
5aab57e1b5 nak/ra: Handle bindless CBufs
This is done by adding a couple of helpers that we use throughout the RA
pass which abstract reading an SSA value from a source and writing a
register to that source.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:45 +00:00
Faith Ekstrand
a8f8e441f5 nak/bitset: Add an iterator
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:45 +00:00
Faith Ekstrand
82776f3882 nak/calc_instr_deps: Account for bindless CBufs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:45 +00:00
Faith Ekstrand
0c0cb4b9e9 nak/dce: Account for bindless CBuf handles
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:45 +00:00
Faith Ekstrand
40a5b83cb3 nak/sm70: Properly encode bindless cbufs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:45 +00:00
Faith Ekstrand
d09d3f5246 nak/from_nir: Emit uniform instructions when !divergent
The really tricky case here is phis, which may have a uniform def even
though some of the srcs are non-uniform.  This happens because of the
restriction elsewhere that requires UGPRs and UPreds to only ever be
written in uniform control-flow.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:45 +00:00
Faith Ekstrand
3dfd92888a nak: Add a UniformBuilder
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:45 +00:00
Faith Ekstrand
ab8a4d1940 nak/from_nir: Clean up phi annotations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:45 +00:00
Faith Ekstrand
b013d54e4f nak/lower_cf: Flag phis as convergent when possible
Because we go in and out of SSA, all the phis get re-created and the new
phis will default to divergent.  This little pass attempts to prove as
many of the phis convergent as possible.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:45 +00:00
Faith Ekstrand
06902bf52e nak: Convert to LCSSA before divergence analysis
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
2024-06-13 20:43:45 +00:00