Commit Graph

184162 Commits

Author SHA1 Message Date
Eric Engestrom
a81189c796 ci: build nvk in debian-vulkan job
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27442>
2024-02-02 23:36:59 +00:00
Eric Engestrom
2d21a1bf79 nouveau/tests: fix null dereference
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27442>
2024-02-02 23:36:59 +00:00
Gurchetan Singh
0525dac7f8 vk_image.c: #ifndef _WIN32 --> DETECT_OS_LINUX + DETECT_OS_BSD
DRM modifiers are a BSD/Linux phenomenon.

We can also remove a bunch of these checks too.  No Linux specific
symbol or header is **actually** used, and the DRM modifier is
just represented as uint64_t.  But kept the style of the file
as is.

Reviewed-by: Serdar Kocdemir <kocdemir@google.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27425>
2024-02-02 23:11:21 +00:00
Gert Wollny
1fa171650a zink: remove invalid scope in bo allocation loop
The braces resulted in the never demoting the heap type
which resulted in an infinite loop if this become a necessity.

Fixes:  eb394f5316
    zink: redesign the allocation try loop to test all heaps

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27446>
2024-02-02 22:43:02 +00:00
Marek Olšák
e98bbcad17 nir: add vertex divergence into nir_divergence_analysis
This is a prerequisite for the new nir_opt_varyings pass.
It reuses the same divergent field in nir_def and nir_loop.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26918>
2024-02-02 16:45:52 -05:00
Marek Olšák
5ffa4d879c nir: add a lower_mediump_io callback into options
This will be called by the GLSL linker before nir_opt_varyings.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26918>
2024-02-02 16:45:51 -05:00
Marek Olšák
ecf0fe09f0 nir: replace lower_io_variables with a GLSL NIR flag
This stops using it in nir_lower_io_passes because all callers call it
only when it's true.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26918>
2024-02-02 16:45:49 -05:00
Marek Olšák
c4acab77a8 nir: remove and replace underused option pack_varying_options
This will also be used by nir_opt_varyings.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26918>
2024-02-02 16:45:47 -05:00
Marek Olšák
c844b5dc85 nir: relax validation failure for generic TCS outputs with no_varying
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26918>
2024-02-02 16:45:45 -05:00
Marek Olšák
d84a616d4d nir: remove INTERP_MODE_COLOR
It's only used by radeonsi and doesn't have to be public.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26918>
2024-02-02 16:45:35 -05:00
Rob Clark
1d5dbde522 freedreno/drm: Fix teardown crash harder
We need to unref the device *after* submit cleanup, so that
fd_submit_sp_destory() can still reference the device.

Fixes: d558cb664a ("freedreno/drm: Submit should hold ref to device")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27445>
2024-02-02 20:28:58 +00:00
Job Noorman
60413e11c2 ir3: optimize subgroup operations using brcst.active
Follow the blob and optimize subgroup operation using brcst.active and
getlast when supported.

The transformation consists of two parts. First, a NIR transform
replaces subgroup operations with a sequence of new brcst_active_ir3
intrinsics followed by a new [type]_clusters_ir3 intrinsic (where type
can be reduce, inclusive_scan, or exclusive_scan).

The brcst_active_ir3 intrinsic is lowered directly to a brcst.active
instruction. The other intrinsics get lowered to a new macro
(OPC_SCAN_CLUSTERS_MACRO) which later gets emitted as a loop (using
getlast/getone) that iterates all clusters and produces the requested
scan result.

OPC_SCAN_CLUSTERS_MACRO has a number of optional arguments. First, since
the exclusive scan result is not a natural by-product of the loop but
has to be calculated explicitly, its destination is optional. This is
necessary since adding it unconditionally will produce unused
instructions that won't be DCE'd anymore at this point. Second, when
performing 32b MUL_U reductions (that expand to multiple instructions),
an extra scratch register is necessary.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6387
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26950>
2024-02-02 19:49:22 +00:00
Job Noorman
6148e38a09 ir3: fix printing of brcst.active and quad_shuffle
Make sure they aren't treated as a texture instructions. For
brcst.active, also print its cluster size.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26950>
2024-02-02 19:49:22 +00:00
Job Noorman
6fa99abac0 ir3: optimize read_first.macro to a mov
Moves to shared registers keep the value written by the lowest active
fiber. This means that read_first.macro can simply be turned into a mov
and doesn't need a getone block.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26950>
2024-02-02 19:49:22 +00:00
Job Noorman
5c41a95e48 ir3: fix setting shared flag on parallel copy arguments
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26950>
2024-02-02 19:49:22 +00:00
Eric Engestrom
5ef744c660 ci: build panvk in debian-vulkan job
With !26116, !24610, and !27437 merged, we can now enable build-testing
of panvk with these extra checks, and prevent bugs like these from
happening again.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27441>
2024-02-02 19:14:29 +00:00
Daniel Schürmann
4fa27845e5 aco/insert_exec_mask: Reduce latency when switching to WQM.
Change pattern:
s_mov_b64 s[0:1], exec         s_mov_b64 s[0:1], exec
s_wqm_b64 exec, s[0:1]   ->    s_wqm_b64 exec, exec

Totals from 16667 (21.03% of 79242) affected shaders: (GFX11)

Instrs: 11317502 -> 11307484 (-0.09%); split: -0.09%, +0.00%
CodeSize: 60194272 -> 60155088 (-0.07%); split: -0.07%, +0.00%
Latency: 94345873 -> 94338374 (-0.01%); split: -0.01%, +0.00%
InvThroughput: 13568872 -> 13568683 (-0.00%); split: -0.00%, +0.00%
Copies: 808334 -> 808332 (-0.00%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27112>
2024-02-02 18:55:15 +00:00
Daniel Schürmann
e89977ff71 aco: always terminate quads if they have been demoted entirely
Previously, quads got only terminated in top-level control flow.
This patch makes the behavior consistent.

Totals from 7811 (9.86% of 79242) affected shaders: (GFX11)

Instrs: 7859667 -> 7850757 (-0.11%); split: -0.18%, +0.07%
CodeSize: 41642280 -> 41611836 (-0.07%); split: -0.13%, +0.06%
Latency: 73692815 -> 73707588 (+0.02%); split: -0.02%, +0.04%
InvThroughput: 10672160 -> 10672323 (+0.00%); split: -0.01%, +0.01%
VClause: 137478 -> 137469 (-0.01%); split: -0.02%, +0.02%
SClause: 314905 -> 314924 (+0.01%); split: -0.19%, +0.20%
Copies: 587014 -> 576039 (-1.87%); split: -2.10%, +0.23%
Branches: 213101 -> 213123 (+0.01%); split: -0.01%, +0.02%
PreSGPRs: 313588 -> 313355 (-0.07%); split: -0.09%, +0.01%
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27112>
2024-02-02 18:55:15 +00:00
Daniel Schürmann
a42b83e3fb aco/insert_exec_mask: tiny refactor
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27112>
2024-02-02 18:55:15 +00:00
Tapani Pälli
5bea69cdd6 intel/blorp: add a TODO note about stencil buffer resolve
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27355>
2024-02-02 18:28:39 +00:00
Samuel Pitoiset
9698d5f0fd radv: add a workaround for mipmaps and minLOD on GFX6-8
This is spurious and it looks like we should be able to uses non-zero
base level everytime on GFX6-8 but it doesn't always work.

This fixes the remaining CTS failures on GFX6-8.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26290>
2024-02-02 18:06:25 +00:00
Connor Abbott
dc1a3f9555 ir3: Fix comment thinko
Noticed when working on another commit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22072>
2024-02-02 17:39:35 +00:00
Connor Abbott
c40bc48252 ir3: Calculate physical edges correctly
A block can have more than one extra physical successor, a fact that I
missed initially. Now that we've fixed up RA to handle it, we can
finally handle this correctly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22072>
2024-02-02 17:39:35 +00:00
Connor Abbott
9dbe511f18 ir3: Rewrite (jp) and branchstack handling
This pass will later also serve as a way to accurately insert physical
edges, which is the original motivation. However it also lets us put
branchstack handling on a more solid footing.

There was an off-by-one in the old branchstack handling because it
didn't consider that a single if-else actually has two reconvergence
points active at the same time, so it undercounted the branchstack by 1
for pretty much every shader. We change the HW formula to produce the
same result, which now makes it much more sensible.

We can also delete the physical predecessor handling in ir3_legalize,
because it was only needed to handle (jp) which is now handled earlier.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22072>
2024-02-02 17:39:35 +00:00
Connor Abbott
6ad0cbafe8 ir3: Set branchstack earlier
We were relying on it in RA to tell us whether we could give more
registers to the shader mostly "for free" (because occupancy is bounded
by the branchstack), but it turns out it was actually 0 so we weren't
taking advantage of it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22072>
2024-02-02 17:39:35 +00:00
Connor Abbott
fa22b0901a ir3/ra: Add specialized shared register RA/spilling
There are two problems with shared register allocation at the moment:

1. We weren't modelling physical edges correctly, and once we do, the
   current hack in RA for handling them won't work correctly. This means
   live-range splitting doesn't work. I've tried various strategies but
   none of them seems to fix this.
2. Spilling of shared registers to non-shared registers isn't
   implemented.

Spilling of shared regs is significantly simpler than spilling
non-shared regs, because (1) spilling and unspilling is significantly
cheaper, just a single mov, and (2) we can swap "stack slots" (actually
non-shared regs) so all the complexity of parallel copy handling isn't
necessary. This means that it's much easier to integrate RA and
spilling, while still using the tree-scan framework, so that we can
spill instead of splitting live ranges. The other issue, of phi nodes
with physical edges, we can handle by spilling those phis earlier. For
this to work, we need to accurately insert physical edges based on
divergence analysis or else every phi node would involve physical edges,
which later commits will accomplish.

This commit adds a shared register allocation pass which is a
severely-cut-down version of RA and spilling. Everything to do with live
range splitting is cut from RA, and everything to do with parallel copy
handling and for spilling we simply always spill as long as soon as we
encounter a case where it's necessary. This could be improved,
especially the spilling strategy, but for now it keeps the pass simple
and cuts down on code duplication. Unfortunately there's still some
shared boilerplate with regular RA which seems unavoidable however.

The new RA requires us to redo liveness information, which is
significantly expensive, so we keep the ability of the old RA to handle
shared registers and only use the new RA when it may be required: either
something potentially requiring live-range splitting, or a too-high
shared register limit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22072>
2024-02-02 17:39:34 +00:00
Samuel Pitoiset
f977501a7c radv: do not allow to enable VK_EXT_shader_object with LLVM
This isn't expected to work.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27415>
2024-02-02 17:14:56 +00:00
Konstantin Seurer
c925b6019d radv/rt: Lower ray payloads like hit attribs
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27051>
2024-02-02 16:36:15 +00:00
Erik Faye-Lund
4f0c33196c mesa: fix error-handling for ETC2/RGTC textures
It seems we missed an error-case that got introduced in OpenGL 4.4.

While this error doesn't *technically* exist as-is in OpenGL ES before
version 3, neither does 3D textures. And while OES_texture_3D introduces
it to OpenGL ES 2.0 without adding the same error for ETC2 textures,
that is likely an omission in the spec; 3D ETC2 texture was never a
thing.

This fixes a regression in the confidential Khronos CTS, specifically
GL46.gtf42.GL3Tests.texture_storage.texture_storage_compressed_texture_data

Fixes: 652a898d316 ("mesa/main: add support for EXT_texture_storage")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10545
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Tested-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27428>
2024-02-02 16:06:19 +00:00
Eric Engestrom
5d293f01cc ci_run_n_monitor: avoid spamming a ton of "new status: created" for all the jobs at the beginning
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27419>
2024-02-02 15:25:22 +00:00
Eric Engestrom
6250885640 panfrost: fix UB caused by shifting signed int too far
Fixes: 13d7ca1300 ("pan/va: Optimize add with imm to ADD_IMM")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27437>
2024-02-02 14:56:20 +00:00
Mike Blumenkrantz
2085d60438 zink: run sparse lowering after all optimization passes
some passes (e.g., opt_shrink_vector) operate on the assumption that
sparse tex ops have a certain number of components and then remove components
and unset the sparse flag if they can optimize out the sparse usage

zink's sparse ops do not have the standard number of components, which
causes such passes to make incorrect assumptions and tag them as
not being sparse, which breaks everything

fix #10540

Fixes: 0d652c0c8d ("zink: shrink vectors during optimization")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27414>
2024-02-02 14:36:25 +00:00
Mike Blumenkrantz
6a8cd7a64f zink: move sparse lowering up in file
no functional changes

Fixes: 0d652c0c8d ("zink: shrink vectors during optimization")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27414>
2024-02-02 14:36:25 +00:00
Mike Blumenkrantz
aacc4e1c68 zink: zero allocate resident_defs array in ntv
this makes assert(def!=0) more reliable

Fixes: 73ef54e342 ("zink: handle residency return value from sparse texture instructions")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27414>
2024-02-02 14:36:25 +00:00
Mike Blumenkrantz
3b025d6b42 zink: fix sparse bo placement
the util function here takes a bitmask of memory type indices, not properties.
rename the function and correct the usage

fixes sparse on nvidia blob

Fixes: c71287e70c ("zink: correct sparse bo mem_type_idx placement")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27414>
2024-02-02 14:36:25 +00:00
Konstantin Seurer
bb14ee53a5 radv/sqtt: Handle ray tracing pipelines with no traversal shader
Fixes: 0f87d40 ("radv/rt: Skip compiling a traversal shader")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27383>
2024-02-02 14:14:16 +01:00
Samuel Pitoiset
0aa9afa8e1 radv: add support for emitting VS+TCS compiled separately on GFX9+
With a VS prolog, we end up with 3 long jumps (VS prolog->VS->TCS->TCS
epilog), super annoying.

The shaders config must also be combined between VS and TCS.

This is for VK_EXT_shader_object.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27336>
2024-02-02 10:16:59 +01:00
Samuel Pitoiset
397a08b407 radv: always emit PGM_RSRC1_HS when emitting the TCS epilog state
This will simplify upcoming changes and it doesn't matter much because
this is for ESO only.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27336>
2024-02-02 10:16:59 +01:00
Samuel Pitoiset
542b9aaf18 radv: force TCS stage for VS as LS compiled separately on GFX9+
When VS as LS is compiled separately on GFX9+, the stage/previous_stage
must be VERTEX/TESS_CTRL.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27336>
2024-02-02 10:16:59 +01:00
Samuel Pitoiset
3d5d163693 radv: always mark drawid/base_instance used with ESO
The user SGPR is always declared for merged shaders compiled separately
because the args must match.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27336>
2024-02-02 10:16:59 +01:00
Samuel Pitoiset
3c23ae8547 radv: rework shader arguments for separate compilation of VS+TCS on GFX9+
When VS or TCS are compiled separately on GFX9+, the shader input args
must match. This is implemented using a complete separate path, it's
duplicated but it seems cleaner than adding a ton of checks here and
there.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27336>
2024-02-02 10:16:59 +01:00
Samuel Pitoiset
1e55d91c82 radv: only merge shader info stages if both stages exist on GFX9+
With shader objects, both stages might not exist and if the src stage
doesn't, this will copy garbage data because it's unitialized.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27336>
2024-02-02 10:16:59 +01:00
Samuel Pitoiset
0018faf384 radv: check active NIR stages before trying to merge shaders on GFX9+
For shader object.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27336>
2024-02-02 10:16:59 +01:00
Samuel Pitoiset
1fe8770bbe radv: constify radv_device in radv_emit_shader_pointer()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27336>
2024-02-02 10:16:59 +01:00
Samuel Pitoiset
3b2452da3c radv: set the default workgroup size for VS as LS
This will be optimized during shader info linking if TCS is present.
The main motivation for this change is ESO because the next stage
might not exist.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27396>
2024-02-02 08:53:20 +00:00
Samuel Pitoiset
2a58bbbed8 radv: determine the workgroup size for TCS earlier
This can be done before linking shader info pass.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27396>
2024-02-02 08:53:20 +00:00
Samuel Pitoiset
c6ca7fcc25 radv: remove radv_graphics_state_key::dynamic_patch_control_points
When the state isn't dynamic, the patch control points value must
greater than 0. Having a separate field isn't necessary.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27396>
2024-02-02 08:53:20 +00:00
Blisto
3bc6f95e3d driconf: set vk_x11_strict_image_count for Atlas Fallen Vulkan
Prevents crash with vsync turned off on xwayland.

Cc: mesa-stable
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27122>
2024-02-02 07:48:22 +00:00
Mike Blumenkrantz
7b7a581a52 zink: prune dmabuf export tracking when adding resource binds
this avoids invalid access for the stack resource in add_resource_bind()
when adding a new bind to an exportable resource

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27395>
2024-02-02 03:51:52 +00:00
Dave Airlie
60d2ea83e8 vulkan/video: add AV1 decode support to common code
This adds the av1 decode parameters handling.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27423>
2024-02-02 03:18:52 +00:00