Commit graph

161666 commits

Author SHA1 Message Date
Qiang Yu
83643e4dc8 nir,ac/nir/ngg,radv: split shader_query_enabled_amd
For used by different counter.

Vulkan:
1. VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT,
   sum generated primitives of all 4 streams when GS.
2. VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT, count generated
   primitives for all 4 streams when VS/TES/GS.
3. VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT, count generated
   and streamout primitives for all 4 streams when VS/TES/GS.

OpenGL:
1. GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB, sum generated
   primitives for all 4 streams when GS.
2. GL_PRIMITIVES_GENERATED, count generated primitives for all 4
   streams when VS/TES/GS.
3. GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, count streamout
   primitives for all 4 streams when VS/TES/GS.

pipeline_stat_query_enabled_amd is for Vulkan 1 and OpenGL 1.
xfb_query_enabled_amd is for Vulkan 2/3 and OpenGL 2/3.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19015>
2022-10-25 02:42:52 +00:00
Qiang Yu
1dcbf25757 radv: split active_pipeline_gds_queries
For different enabling of pipeline stat and prims gen.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19015>
2022-10-25 02:42:52 +00:00
Qiang Yu
0bbe8029b6 radv: count gen_prims_queries_enabled
User can enable/disable multi VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT
queries with same or different index.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19015>
2022-10-25 02:42:52 +00:00
Mike Blumenkrantz
6247b35ab2 zink: delete unused zink descriptor mode
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19281>
2022-10-25 02:06:24 +00:00
Mike Blumenkrantz
d702a503ad zink: support multiple heaps per memory type
some allocations require a different memory heap even when using the
same memory bits, so allow iterating over heaps of the same memory type
to find the one that works

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19281>
2022-10-25 02:06:24 +00:00
Mike Blumenkrantz
f9515d9376 zink: allocate/place memory using memoryTypeIndex directly
it's possible for drivers to have multiple heaps with identical flags,
so this will enable passing the heap that should actually be used for
allocation

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19281>
2022-10-25 02:06:23 +00:00
Mike Blumenkrantz
a3552048c7 zink: allow direct memory mapping for any COHERENT+CACHED buffer
some drivers may provide this in heaps that get used by non-staging resources,
so avoid extra copies in that case

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19281>
2022-10-25 02:06:23 +00:00
Mike Blumenkrantz
71ee1dd597 zink: don't flag ubo0 as used in shaders with indirect ubo access
ubo0 is not a regular ubo, so avoid setting the hint here

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19281>
2022-10-25 02:06:23 +00:00
Mike Blumenkrantz
e8e13d1d78 zink: decrement ZINK_FBFETCH_BINDING
there's no reason this shouldn't be contiguous with the other gfx stages

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19281>
2022-10-25 02:06:23 +00:00
Mike Blumenkrantz
1f4172e4ec zink: fix gpl compile optimization
this is supposed to create the non-optimized pipeline first and then
compile the optimized version in the background, not the other way around

facepalm.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19201>
2022-10-25 01:46:13 +00:00
Mike Blumenkrantz
490ddbd0b7 lavapipe: fix BufferDeviceAddress usage
this is supposed to return the address at the start of the buffer,
not the address at the start of the memory allocation

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19274>
2022-10-25 01:32:58 +00:00
Mike Blumenkrantz
17ccc80920 lavapipe: store binding offset for buffers
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19274>
2022-10-25 01:32:58 +00:00
Nicholas Bishop
7cca889ecd crocus: fix off-by-one error when clearing stale syncobjs
This is the same fix as commit 1311eddd52 ("iris: fix off-by-one error
when clearing stale syncobjs"), but for crocus.

Signed-off-by: Nicholas Bishop <nicholasbishop@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19282>
2022-10-25 00:47:39 +00:00
Dave Airlie
977dbfc9de clover/llvm: add kernel arg info for opaque pointers
With opaque pointers you can no longer the info from the pointertype,
so rebuild it.

v2: add a comment

Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19103>
2022-10-25 00:38:40 +00:00
Giancarlo Devich
b744e97033 d3d12: Add cache managers for separate buffer usage cases
Mis-matched usage is a large percentage of buffer cache misses when
searching for applicable buffers. Separating these into separate
managers puts them into separate heaps and eliminates a significant
amount of CPU time spent searching.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19283>
2022-10-24 23:35:39 +00:00
Jami Kettunen
09b28524b2 freedreno/ir3: Switch to NIR for a5xx's vertex id lowering.
This was similarly done for a3xx & a4xx with 4bdd226ab6
("freedreno/ir3: Switch to NIR for a3xx/a4xx's vertex id lowering.")
already, yet a5xx was missed which I noticed as Minecraft window
titlebar text corruption on OnePlus 5T with Adreno 540.

Cc: mesa-stable
Signed-off-by: Jami Kettunen <jami.kettunen@protonmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19263>
2022-10-24 23:05:18 +00:00
Nicholas Bishop
7bc7b08bcf crocus: Advertise PIPE_CAP_NATIVE_FENCE_FD
Enables EGL_ANDROID_native_fence_sync.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7253
Signed-off-by: Nicholas Bishop <nicholasbishop@google.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19235>
2022-10-24 22:56:00 +00:00
Rob Clark
22ec93cc1a v3d/ci: Add a flake
I've seen this one flake, add it to flakes.txt to avoid blocking CI.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19259>
2022-10-24 21:39:38 +00:00
Rob Clark
c00f36ad76 freedreno: Passthrough TCS support
Fixes 17 little piglits.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7518
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19259>
2022-10-24 21:39:38 +00:00
Rob Clark
18b02cbc25 freedreno: Add tess_state support
Add support for setting default tess params, used by passthrough TCS.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19259>
2022-10-24 21:39:38 +00:00
Rob Clark
38c747ce3d freedreno/ir3: Passthrough TCS support
Wire up support for the two intrisics to get default tess levels (which
adds new HS driver params) and add a helper to generate a passthrough
TCS for a given VS.  The passthrough TCS is cached in the VS, indexed by
patch_vertices, as the generated TCS is a function of the VS outputs and
the patch_vertices count.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19259>
2022-10-24 21:39:38 +00:00
Rob Clark
a7290370de freedreno: Dirty the TCS state if patch_vertices change
If using a passthrough TCS shader, we can't rely on having a new TCS
stage bound, so we need to invalidate the TCS state when the # of
patch_vertices changes.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19259>
2022-10-24 21:39:38 +00:00
Rob Clark
027690996b radeonsi: Use nir passthrough TCS helper
Switch over to using the common nir helper.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19259>
2022-10-24 21:39:38 +00:00
Rob Clark
a8e84f50bc nir: Add helper to create passthrough TCS shader
Based on si_create_passthrough_tcs() as that seemed the most generic of
the various different backend driver implementations.  Uses the
load_tess_level_outer_default and load_tess_level_inner_default
intrinsics to load the gl_TessLevelOuter and gl_TessLevelInner values,
so driver will somehow need to implement those to load the values set
by pipe_context::set_tess_state() or similar.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19259>
2022-10-24 21:39:38 +00:00
David Heidelberg
2b750cacd7 ci/panfrost: re-enable traces on t760
Also make a note, why we don't run gles2 piglit.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19211>
2022-10-24 21:24:46 +00:00
David Heidelberg
c6f575f663 ci/panfrost: Humus Portal trace got fixed, update checksum
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19211>
2022-10-24 21:24:46 +00:00
David Heidelberg
9ba7164d2f ci/panfrost: enable piglit-gl on g52 again and deparalelize
The job fits into 15 minutes of runtime, so deparalelize.

Stress-tested.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19211>
2022-10-24 21:24:46 +00:00
David Heidelberg
b970e25890 ci/panfrost: deduplicate gitlab-ci.yml
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19211>
2022-10-24 21:24:46 +00:00
Pavel Ondračka
8a0c1dcbd6 r300: respect buffer offset in r300_set_constant_buffer
Fixes constants upload with nine.
Thanks to Marek Olšák for pointing this out.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7481
Cc: mesa-stable
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19277>
2022-10-24 21:15:37 +00:00
Timur Kristóf
a17e801a9c aco: Add ACO_DEBUG=novalidateir option.
This disables IR validation in debug/debugoptimized builds.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18103>
2022-10-24 20:14:16 +00:00
Timur Kristóf
0cceab788e aco: Move is_dead to aco_ir.h to allow it to get inlined.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18103>
2022-10-24 20:14:16 +00:00
Timur Kristóf
36bc3afb8b aco/optimizer_postRA: Delete dead instructions more efficiently.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18103>
2022-10-24 20:14:16 +00:00
Timur Kristóf
7263a29794 aco/optimizer_postRA: Properly handle vccz/execz/scc in reset_block.
Fixes: a8dd07518c
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18103>
2022-10-24 20:14:16 +00:00
Timur Kristóf
75967a4814 aco/optimizer_postRA: Speed up reset_block() with predecessors.
Copy the information from the first predecessor then check whether
it matches other predecessors and modify the data accordingly.

Marked for backporting to stable to make it possible to also
backport fixes based on this.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18103>
2022-10-24 20:14:16 +00:00
Timur Kristóf
b542ab0243 aco/optimizer_postRA: Use unique_ptr + array for instruction indices.
According to perf, this roughly halves the impact of the post-RA
optimizer in ACO's compile times.

Measurement was taken using a debug optimized build using
NIR_DEBUG=novalidate RADV_DEBUG=nocache and replaying the Fossil DB
from the Doom Eternal shaders.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18103>
2022-10-24 20:14:16 +00:00
Giancarlo Devich
6f598fe4e3 mesa: Fix stack corruption for PIPE_QUERY_TIMESTAMP
get_query_result expects a pointer to a union pipe_query_result,
which is larger than GLuint64EXT, causing the memset it does to
overwrite the stack.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19055>
2022-10-24 19:43:03 +00:00
Georg Lehmann
a0c52ee827 radeonsi: Use available dot product instructions on gfx11.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19114>
2022-10-24 19:07:16 +00:00
Georg Lehmann
31c1cb06ad radv: Use available dot product instructions on gfx11.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19114>
2022-10-24 19:07:16 +00:00
Georg Lehmann
361b47b1f0 aco: Implement signed idot instructions on GFX11.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19114>
2022-10-24 19:07:16 +00:00
Georg Lehmann
cea6723243 ac/llvm: Implement signed idot on GFX11.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19114>
2022-10-24 19:07:16 +00:00
Georg Lehmann
616d3908dc aco: Don't use opsel for p_insert.
This doesn't make sense, opsel preserves the not selected half of the register,
p_insert zeros it.

No Foz-DB changes.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>

Fixes: 54292e99c7 ("aco: optimize 32-bit extracts and inserts using SDWA")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19253>
2022-10-24 18:40:40 +00:00
Georg Lehmann
79a8a7662b aco: fmaak/fmamk can't use SDWA.
Found by inspection.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19255>
2022-10-24 18:04:53 +00:00
Pedro J. Estébanez
413f8d0e9b microsoft/spirv2dxil: Support pack_32_2x16 and pack_32_4x8
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19273>
2022-10-24 17:39:59 +00:00
Yonggang Luo
224e501210 aco: Do not define NOMINMAX as it's already defined in pre_args now
It's a revert of fcd53bebe6 ("aco: Define NOMINMAX in Meson build file")
Because 852d91edcd ("windows: Always set NOMINMAX to remove min/max macros")
did the same thing

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19233>
2022-10-24 17:00:58 +00:00
Erik Faye-Lund
0ebd6f52a2 zink: reuse rast_prim for line-rasterization check
The check_warn variable is true a bit too often; in realtity it's not
*either* of these conditions that makes things lines, it's the last one
in the pipeline. But we already have a state for this, so let's reuse
that instead of recomputing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19048>
2022-10-24 16:41:48 +00:00
Erik Faye-Lund
659c39fafb zink: rework primitive rasterization type logic
There's a few things that depends on the primitive rasterization type,
like point-sprite lowering and polygon offset. The effective state is a
combination of several other states, and we currently kinda wing it a
bit sometimes.

This should improve the situation. In particular, we now go backwards
through the pipeline, checking one overriding state at the time.

The end result should be that we don't end up lowering point-coord
replacement when not rendering with points.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19048>
2022-10-24 16:41:48 +00:00
Pedro J. Estébanez
811794f8d8 microsoft/spirv2dxil: Change spirv_to_dxil() to receive SM and validator versions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19227>
2022-10-24 16:15:31 +00:00
Pedro J. Estébanez
0bf5bbb3e4 microsoft/spirv2dxil: Refactor to make SM and validator versions public
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19227>
2022-10-24 16:15:31 +00:00
Ella Stanforth
677def1d4e vulkan: wsi: fix musl build
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19270>
2022-10-24 15:39:06 +00:00
Konstantin Seurer
ac01f09d57 radv/rt: Load instance id and custom index on demand
Stats for Quae II RTX:

57fps -> 57fps

Totals from 7 (14.00% of 50) affected shaders:
VGPRs: 800 -> 784 (-2.00%)
CodeSize: 217868 -> 218308 (+0.20%)
MaxWaves: 62 -> 63 (+1.61%)
Instrs: 40384 -> 40420 (+0.09%); split: -0.01%, +0.10%
Latency: 866315 -> 870692 (+0.51%)
InvThroughput: 199189 -> 196595 (-1.30%); split: -1.75%, +0.45%
VClause: 1058 -> 1077 (+1.80%)
SClause: 1126 -> 1130 (+0.36%)
Copies: 5787 -> 5772 (-0.26%); split: -0.40%, +0.14%
PreVGPRs: 764 -> 750 (-1.83%)

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19159>
2022-10-24 14:39:25 +00:00