Commit graph

196544 commits

Author SHA1 Message Date
Samuel Pitoiset
daefd280e2 radv do not force-disable hierarchical stencil testing
Looks like this was disabled by mistake. RadeonSI relies on the default
value which is "no force" and PAL only sets this to FORCE_DISABLE when
HTILE is completely disabled using settings.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31690>
2024-10-18 00:28:01 +00:00
David Heidelberg
195cb98d30 ci/etnaviv: unify job naming with the rest of the CI
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Signed-off-by: David Heidelberg <david@ixit.cz>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31724>
2024-10-17 23:49:54 +00:00
Thomas H.P. Andersen
8654a7727f driconf: set vk_zero_vram driconf for X4 Foundations
Fixes artifacts when the game is loading

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29892>
2024-10-17 22:19:33 +00:00
Thomas H.P. Andersen
3abee25f0b driconf: set vk_zero_vram driconf for Path of Exile
Fixes frequent crashes in the loading screen when using vulkan on nvk

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29892>
2024-10-17 22:19:33 +00:00
Thomas H.P. Andersen
ade4512803 nvk: handle driconf for zeroing vram
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29892>
2024-10-17 22:19:33 +00:00
Thomas H.P. Andersen
20fae61d10 dirconf: add a common vk_zero_vram
This adds a vk_zero_vram dri conf.
Vulkan drivers needs this to run several games.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29892>
2024-10-17 22:19:33 +00:00
Julia Zhang
47e74ba175 mesa/st: use drawable->ID as hash for drawable_ht
Using address of drawable as hash table key will cause memory issue in this
situation:

1. drawable A with address addr is destroyed and deleted from the hash table.
2. drawable B with same address addr is created and added to the hash table
right after 1 is done.
3. st_framebuffers_purge will seach the hash table with drawable addr that
associated with each framebuffer. If drawable is not in the hash table, then
free this framebuffer.

So when drawable B is created, then the framebuffer that associated with
drawable A will not be freed in time. This will cause framebuffer memory leak.

Since drawable->ID is unique, this uses drawable-ID as pre-hash to store
drawable in hash table. This also removes key_hash_function because we already
use drawable-ID as pre-hash when insert the data and we need to avoid assert of
_mesa_hash_table_search_pre_hashed fail.

Signed-off-by: Julia Zhang <Julia.Zhang@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31161>
2024-10-17 21:43:32 +00:00
Zack Rusin
05e0554d76 svga: Redo the way generated files are handled
Long time ago svga had a sourceforge project where auto-generated
header files for the SVGA device were hosted. Gallium's svga driver
copied those files and when the sourceforge project became
obsolete they started being updated by hand.

Kernel and igt projects switched to the official way in which the SVGA
header files are generated but Mesa3d wasn't ported at the time.

The official SVGA headers diverged from the official ones creating bugs.
Fix it by porting the SVGA Gallium driver to the auto-generated SVGA
header files.

Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31653>
2024-10-17 21:06:57 +00:00
Iván Briano
8423998d69 hasvk: fix non matching image/view format attachment resolve
Port of 5a7e58a430 ("anv: fix non matching image/view format attachment resolve")
to hasvk.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31696>
2024-10-17 20:24:37 +00:00
Lionel Landwerlin
02294961ee anv: stop using a binding table entry for gl_NumWorkgroups
This will make things easier in situations where we don't want to use
the binding table at all (indirect draws/dispatches).

The mechanism is simple, upload a vec3 either through push constants
(<= Gfx12.0) or through the inline parameter register (>= Gfx12.5).

In the shader, do this :

  if vec.x == 0xffffffff:
     addr = pack64_2x32 vec.y, vec.z
     vec = load_global addr

This works because we limit the maximum number of workgroup size to
0xffff in all dimension :
   maxComputeWorkGroupCount = { 65535, 65535, 65535 },

So we can use the large values to signal the need for indirect
loading.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31508>
2024-10-17 19:35:59 +00:00
Lionel Landwerlin
97b17aa0b1 brw/nir: rework inline_data_intel to work with compute
This intrinsic was initially dedicated to mesh/task shaders, but the
mechanism it exposes also exists in the compute shaders on Gfx12.5+.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31508>
2024-10-17 19:35:59 +00:00
Lionel Landwerlin
1dc125338e brw: fix mesh fence emission
In SIMD32, the fence instruction is currently going to read grf0-3
leading to such assertions in the backend :

 ../src/intel/compiler/brw_fs_reg_allocate.cpp:206:
   void fs_visitor::calculate_payload_ranges(bool, unsigned int, int*) const:
     Assertion `j < payload_node_count' failed.

The reason we haven't seen the problem yet is that there always enough
payload register to accomodate this. But the following change is going
to make the inline parameter register optional.

Since SHADER_OPCODE_MEMORY_FENCE is emitted in the generator as SIMD1
NoMask (see brw_memory_fence), we can limit ourselves to SIMD1
exec_all() in the IR as well so that the IR accounts for grf0 as a
source.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31508>
2024-10-17 19:35:59 +00:00
Lionel Landwerlin
b2c5ca0ade brw: remove rebuild single element special case
No shader-db difference on DG2.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31508>
2024-10-17 19:35:59 +00:00
Lionel Landwerlin
19eb601cfc brw: avoid clashing nested loop indices
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31508>
2024-10-17 19:35:59 +00:00
Lionel Landwerlin
f5d123b977 brw: delay printf lowering
Useful to insert debug traces a bit later in the lowering process (in
particular after load/store vectorization).

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31508>
2024-10-17 19:35:59 +00:00
Lionel Landwerlin
be3f62af15 brw: remove unused prototype
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31508>
2024-10-17 19:35:59 +00:00
Faith Ekstrand
4cc9730307 compiler/rust: Fix a bad cast in the memstream abstraction
If you just do ref.cast(), it will cast the thing it's a reference to.
If you want to turn a reference into a pointer, you need to explicitly
use "as".

Fixes: 279f38918f ("nak: memstream: move into common code")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31718>
2024-10-17 18:59:02 +00:00
Faith Ekstrand
212e07a70e compiler/rust: Add a unit test for the memstream abstraction
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31718>
2024-10-17 18:59:02 +00:00
Faith Ekstrand
ec24156b31 compiler/rust: Enable unit tests
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31718>
2024-10-17 18:59:01 +00:00
Connor Abbott
016ce14ac7 tu: Implement VK_EXT_host_image_copy
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26578>
2024-10-17 18:17:18 +00:00
Connor Abbott
e77a2f1cc3 tu: Add a flag for cached non-coherent BOs
We will have to flush/invalidate the memory backing an image in the
driver when copying it to/from the host if it's cached and not coherent.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26578>
2024-10-17 18:17:18 +00:00
Connor Abbott
7a5a33e0e3 freedreno/fdl: Add tiling/untiling implementation for a6xx/a7xx
This implements copies to/from the standard tiling (aka TILE6_3),
similar to isl_tiled_memcpy for intel.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26578>
2024-10-17 18:17:18 +00:00
Connor Abbott
66bdb50736 tu: Gather UBWC config
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26578>
2024-10-17 18:17:18 +00:00
Connor Abbott
3df6c19a22 virtio/drm: Update header
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26578>
2024-10-17 18:17:18 +00:00
Connor Abbott
927968e266 freedreno: Add default UBWC config values
These values are programmed by the kernel and not determined by the
hardware, but provide a default value that should match what drm/msm
programs for older kernels that can't report it. kgsl has always
supported returning the highest_bank_bit, although it hardcodes some of
the other parameters so we have to follow what it does instead of using
this.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26578>
2024-10-17 18:17:18 +00:00
Connor Abbott
f67b64ae6c freedreno/fdl: Add UBWC config struct
This will be used for the tiled memcpy implementation, but we add this
part of the API first so that subsequent commits can embed it in turnip
and set it up.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26578>
2024-10-17 18:17:18 +00:00
Connor Abbott
8a6f051a13 freedreno/a6xx: Remove dead fd6_get_ubwc_blockwidth() call
Unused since a9057d4.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26578>
2024-10-17 18:17:18 +00:00
Connor Abbott
a266360dff freedreno/fdl: Extend 2bpp UBWC special case to 1bpp
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26578>
2024-10-17 18:17:18 +00:00
Zan Dobersek
b44480e86a zink: fix bo_export caching
When creating and caching the bo_export object for a given zink_bo, the
screen file descriptor was used. Since no buffer object's file descriptor
would match that, bo_export objects were continuously added to the exports
list and no bo_export was effectively picked from the cache. Using the
buffer object's file descriptor avoids that.

Signed-off-by: Zan Dobersek <zdobersek@igalia.com>
Fixes: b0fe621459 ("zink: add back kms handling")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31715>
2024-10-17 17:27:20 +00:00
Aleksi Sapon
cfdb653f1c llvmpipe: update traces for aniso filtering fix
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31562>
2024-10-17 16:47:22 +00:00
Aleksi Sapon
e7a851e6cf softpipe: Fix anisotropic sampling aliasing bug
"Backport" of the llvmpip fix.

Nearest sampling was being done using coordinates
on texel boundaries, which caused aliasing bugs.
Shift coordinates by half a texel to correct this.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31562>
2024-10-17 16:47:22 +00:00
Aleksi Sapon
5947e3d760 llvmpipe: Fix pmin calculation
Based on the original code from sp_tex_sample.c,
this was supposed to be a comparison with pmax2,
not pmin2.

This mostly seemed to result in anisotropic filtering
turning on to "maximum" at any value of max_aniso > 1.
Most apparent when runing the texfilt test in demos.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31562>
2024-10-17 16:47:22 +00:00
Aleksi Sapon
313115f98b llvmpipe: Fix anisotropic sampling aliasing bug
Nearest sampling was being done using coordinates
on texel boundaries, which caused aliasing bugs.
Shift coordinates by half a texel to correct this.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31562>
2024-10-17 16:47:21 +00:00
Connor Abbott
e9bb906a32 tu: Implement VK_EXT_pipeline_robustness
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31687>
2024-10-17 16:16:05 +00:00
Connor Abbott
c323848b0b ir3, tu: Plumb through support for per-shader robustness
We need to pass through the robust_modes flag to nir_opt_vectorize based
on a flag set when compiling the shader, not globally in the compiler,
for VK_EXT_pipeline_robustness. Refactor the ir3 compiler interface
to add an ir3_shader_nir_options struct that can be passed around to
the appropriate places, and wire it up in turnip to the shader key. The
shader key replaces the old mechanism of hashing in the compiler
options.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31687>
2024-10-17 16:16:05 +00:00
Anil Hiranniah
3d066e5ef1 panfrost: Fix a memory leak in the CSF backend
The geometry BO should be released in csf_cleanup_context().

Fixes: 447075eeee ("panfrost: Add support for the CSF job frontend")
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/31705>
2024-10-17 15:03:44 +00:00
Boris Brezillon
27bde761a7 panvk: Fix the hierarchy_mask selection
Always enable the level covering the whole FB, and disable the finest
levels if we don't have enough to cover everything.

This is suboptimal for small primitives, since it might force primitives
to be walked multiple times even if they don't cover the the tile being
processed. On the other hand, it's hard to guess the draw pattern, so
it's probably good enough for now.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31682>
2024-10-17 14:29:57 +00:00
Iago Toral Quiroga
ad111aed29 v3dv: fix leak during device initialization
Fixes: 188f1c6cbe ('v3dv: rewrite device identification')

Reviewed-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31703>
2024-10-17 13:27:05 +00:00
Juan A. Suarez Romero
e4301621a2 v3d/ci: add OpenCL failures
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31710>
2024-10-17 12:35:33 +00:00
Lionel Landwerlin
ea2bbe3271 anv: use stage mask to deduce cs/pb-stall requirements
When flushing the render target cache for future operations, we need a
stall at pixel scoreboard. We likely didn't see any issue until now
because a change in render target added the pb-stall.

When using a 2 compute shaders with the following pattern :
  vkCmdDispatch()
  vkCmdPipelineBarrier() ImageBarrier with (src|dst)AccessMask=0 & identical layout
  vkCmdDispatch()

we should ensure that the first dispatch is completed before executing
the second one, otherwise they can race to on resource accesses. This
fixes failures in some new CTS tests.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31676>
2024-10-17 11:55:33 +00:00
Georg Lehmann
aabadb30fc aco/print_ir: use parse_depctr_wait
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31132>
2024-10-17 11:16:16 +00:00
Georg Lehmann
ced7a01954 aco/statistics: update branch issue cycles
Foz-DB Navi31:
Totals from 14319 (18.04% of 79395) affected shaders:
Instrs: 20064495 -> 20062876 (-0.01%)
CodeSize: 105334568 -> 105327704 (-0.01%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31132>
2024-10-17 11:16:16 +00:00
Georg Lehmann
ec11cfc69d aco/insert_delay_alu: do not delay lane mask fast forwarding
The delay actually hurts performance in this case.

Foz-DB Navi31:
Totals from 30340 (38.21% of 79395) affected shaders:
Instrs: 30778999 -> 30726605 (-0.17%); split: -0.17%, +0.00%
CodeSize: 162380180 -> 162170808 (-0.13%); split: -0.13%, +0.00%
Latency: 228185562 -> 228186976 (+0.00%); split: -0.00%, +0.00%
InvThroughput: 39001151 -> 39000897 (-0.00%); split: -0.00%, +0.00%

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31132>
2024-10-17 11:16:16 +00:00
Georg Lehmann
e4889fd4b5 aco/insert_delay_alu: consider more implicit waits
Foz-DB Navi31:
Totals from 37961 (47.81% of 79395) affected shaders:
Instrs: 34175286 -> 33978599 (-0.58%)
CodeSize: 180059352 -> 179190076 (-0.48%); split: -0.48%, +0.00%
Latency: 259826196 -> 259798474 (-0.01%); split: -0.01%, +0.00%
InvThroughput: 42792700 -> 42789298 (-0.01%); split: -0.01%, +0.00%

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31132>
2024-10-17 11:16:16 +00:00
Georg Lehmann
840b5841d3 aco: do not track ALU delay across jumps
This assumes that the best case jump latency is higher than the worst case
ALU latency.

Foz-DB Navi31:
Totals from 17720 (22.32% of 79395) affected shaders:
Instrs: 26009663 -> 25929989 (-0.31%); split: -0.31%, +0.00%
CodeSize: 136571496 -> 136254420 (-0.23%); split: -0.23%, +0.00%
Latency: 215731308 -> 215722059 (-0.00%); split: -0.01%, +0.00%
InvThroughput: 36534197 -> 36532070 (-0.01%); split: -0.01%, +0.00%

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31132>
2024-10-17 11:16:16 +00:00
Georg Lehmann
977f435f4c aco/ir: add function to parse depctr waits
No Foz-DB changes on Navi31.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31132>
2024-10-17 11:16:16 +00:00
Mike Blumenkrantz
a061c80629 zink: further improve image usage detection
there was some confusion over exactly where ici->usage should be set,
since the value must be set when doing all the format checks but then
also it was re-set again later to a potentially different value based
on an unchecked return

now get_image_usage() is set_image_usage() with a more consistent policy
around exactly where the usage is set

this code still sucks tho

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31686>
2024-10-17 10:38:28 +00:00
Georg Lehmann
dbf63a0788 nir: remove nir_op_is_derivative
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31014>
2024-10-17 09:50:19 +00:00
Georg Lehmann
f9d2aad7a3 nir: remove alu ddx/ddy
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31014>
2024-10-17 09:50:19 +00:00
Georg Lehmann
bf0d1a42b4 nir: remove uses_fddx_fddy
Unused and the code didn't even do what the comment said.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31014>
2024-10-17 09:50:19 +00:00