Commit Graph

196666 Commits

Author SHA1 Message Date
Faith Ekstrand
296746d4b9 nvk: Only wait on the upload queue if there are commands
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30596>
2024-10-18 02:58:00 +00:00
Lionel Landwerlin
608d521086 elk: Don't apply discard_if condition opt if it can change results
Replicates the change from 57344052b6 ("intel/brw: Don't apply
discard_if condition opt if it can change results")

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 0ba9497e66 ("intel/fs: Improve discard_if code generation")
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31604>
2024-10-18 01:57:58 +00:00
Rob Clark
7e4e46a004 freedreno/a6xx: Add missing GRAS_SU_DEPTH_CNTL
And GRAS_SU_STENCIL_CNTL.. Needed on a750.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31534>
2024-10-18 01:25:40 +00:00
Rob Clark
a1f2a8ebb9 freedreno/a6xx: Add VPC hardware workaround for a750
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31534>
2024-10-18 01:25:40 +00:00
Rob Clark
ecc8d271e1 freedreno/a6xx: Don't open-code INVALID_REG
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31534>
2024-10-18 01:25:40 +00:00
Rob Clark
65df706b21 freedreno/a6xx: Fix color_cache_size
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31534>
2024-10-18 01:25:40 +00:00
Rob Clark
3a0b022136 freedreno/a6xx: Add support to load driver-params via UBO
In this case, we can't use CP_LOAD_STATE to push the consts inline in
the cmdstream, but instead need to setup a UBO.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31534>
2024-10-18 01:25:40 +00:00
Rob Clark
f193c61c6b freedreno: Rework indirect compute param emit
There are more driver params than what is contained in the indirect
buffer.  So switch things around to always allocate a buffer into which
we copy the indirect params.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31534>
2024-10-18 01:25:40 +00:00
Rob Clark
fe1c733798 freedreno/ir3: Fix need_driver_params for UBO case
When we are pushing driver params via driver UBO, which need to check
the driver_params UBO idx.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31534>
2024-10-18 01:25:40 +00:00
Rob Clark
97ab362914 freedreno/ir3: Track # of app UBOs
Before the gallium driver can support load_shader_consts_via_preamble it
needs a way to differentiate between # of API level UBOs and the number
of UBOs after the driver inserts ones for driver-params, etc.  This is
because the driver UBOs are emit in a different place from user UBOs.
If we didn't have this distinction, and the app had more UBOs bound than
the shader used, we would otherwise emit some conflicting UBO
descriptors (ie. ones for unused const slots conflicting with the driver
UBO slots).

This also moves the consts_ubo emit into the PROG state.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31534>
2024-10-18 01:25:40 +00:00
Rob Clark
94c3c39f21 freedreno/a6xx: Move tess-bo emit
Move this to where the rest of the hs/ds params are emit, because for
a7xx with load_shader_consts_via_preamble we'll need this all to be a
single UBO.  So we won't be able to piecemeal upload consts.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31534>
2024-10-18 01:25:40 +00:00
Rob Clark
efb93c9f52 freedreno/a6xx: Fix double SP_MODE_CONTROL emit
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31534>
2024-10-18 01:25:40 +00:00
Rob Clark
b877106e75 freedreno/ir3: Indentation fix
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31534>
2024-10-18 01:25:40 +00:00
Rob Clark
7e9b948430 freedreno/ir3+tu: Convert driver-params to structs
This at least lets us de-dup the dp setup between the push-const path
and preamble-loads-from-ubo path.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31534>
2024-10-18 01:25:40 +00:00
Rob Clark
81d8387dbc freedreno/ir3: Add assert about const emit
If the old (non-ubo) way of const emit isn't supported for the shader
stage, make sure we hit an assert.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31534>
2024-10-18 01:25:40 +00:00
Rob Clark
824733c4d7 freedreno/ir3: Avoid draw/grid time input iteration
These don't change at draw time, so need to iterate them each time.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31534>
2024-10-18 01:25:40 +00:00
Rob Clark
4812bf2758 freedreno/decode: Fix UBO decode on a7xx
And add UBO dumping.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31534>
2024-10-18 01:25:39 +00:00
Rob Clark
e32237739f freedreno: Assert we aren't writing to 0x0
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31534>
2024-10-18 01:25:39 +00:00
Rob Clark
fd8eabdd4b freedreno/a6xx: Add some missing a7xx bits
Fixes: ad90bf0500 ("freedreno/a6xx: Initial a7xx support")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31534>
2024-10-18 01:25:39 +00:00
Sid Pranjale
21beb7a6bd nvk: implement VK_EXT_depth_clamp_zero_one
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31488>
2024-10-18 00:56:15 +00:00
Sid Pranjale
aa417da964 vulkan/util: add vk_format_has_float_depth()
A small helper function to check if a format has a floating point depth
value.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31488>
2024-10-18 00:56:15 +00:00
Samuel Pitoiset
0f2363993d radv: fix emitting DB_RENDER_OVERRIDE on GFX12
This register is already set in the GFX12 preamble and it shouldn't
be overwritten.

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:02 +00:00
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