Marek Olšák
476529a692
ac/perfcounter: remove a bogus assert to fix an assertion failure on gfx11
...
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25485 >
2023-09-30 22:23:04 +00:00
Samuel Pitoiset
9a3b902cac
ac/nir: add lowering for task shader queries
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25331 >
2023-09-26 07:50:15 +00:00
Samuel Pitoiset
57dec0678e
ac/nir: add lowering for mesh shader queries
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25331 >
2023-09-26 07:50:15 +00:00
Samuel Pitoiset
1ce80653b2
nir: rename atomic_add_gs_invocation_count_amd to make it more generic
...
It will be re-used to implement mesh/tash shader invocations queries.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25331 >
2023-09-26 07:50:15 +00:00
Samuel Pitoiset
301c402bd8
ac/spm: add support for GFX11
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25271 >
2023-09-25 09:05:58 +02:00
Samuel Pitoiset
26c710b7c4
ac/spm: add new segment types for GFX11
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25271 >
2023-09-25 08:34:31 +02:00
Samuel Pitoiset
97d87a431a
ac/gpu_info: define AMD_MAX_WGP
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25271 >
2023-09-25 08:34:31 +02:00
Caio Oliveira
3988d901ac
meson: Remove unnecessary inc_compiler mentions
...
The inc_compiler should come as part of idep_compiler, idep_nir or
idep_nir_headers dependency.
Acked-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> (v3dv)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25314 >
2023-09-22 14:52:50 +00:00
Samuel Pitoiset
604a9b7fae
ac/perfcounter: add GFX11 groups
...
Source from PAL.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25245 >
2023-09-19 07:24:38 +00:00
Samuel Pitoiset
0925d0d042
ac/perfcounter: add SG_WQP group for GFX11
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25245 >
2023-09-19 07:24:38 +00:00
Alyssa Rosenzweig
d1eb17e92e
treewide: Drop nir_ssa_for_src users
...
Via Coccinelle patch:
@@
expression b, s, n;
@@
-nir_ssa_for_src(b, *s, n)
+s->ssa
@@
expression b, s, n;
@@
-nir_ssa_for_src(b, s, n)
+s.ssa
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25247 >
2023-09-18 10:25:17 -04:00
Samuel Pitoiset
fa4d4f84a1
ac/spm: enable support for multi-instance counters
...
This is what RGP expects and this will give us more fine grained
results given that all shader engines/shader arrays etc would be
sampled.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25240 >
2023-09-18 07:07:32 +00:00
Samuel Pitoiset
414783162a
ac/spm: move the counter instance to ac_spm_counter_create_info
...
This will allow us to configure multi-instance counters.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25240 >
2023-09-18 07:07:32 +00:00
Samuel Pitoiset
d5a5473185
ac,radv,radeonsi: prepare support for multi-instance SPM generic counters
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25240 >
2023-09-18 07:07:31 +00:00
Samuel Pitoiset
ed0d3d8cbd
ac,radv,radeonsi: prepare support for multi-instance SPM SQ counters
...
Each SQG modules can configure up to 16 counters.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25240 >
2023-09-18 07:07:31 +00:00
Samuel Pitoiset
af4d4f5203
ac/spm: fix number of instances of GL2C
...
It's a global block, so the number of instances is equal.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25240 >
2023-09-18 07:07:31 +00:00
Samuel Pitoiset
3e8922d9f7
ac/spm: select correct segment type for per-SE blocks
...
This currently does nothing because only the first instance is used,
but this will be needed for multi-instance.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25240 >
2023-09-18 07:07:31 +00:00
Samuel Pitoiset
033e49995d
ac/spm: use block flags to initialize instance mapping
...
This simplify this a bit, ideally we would also have a per-SA flag
for performance counters.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25240 >
2023-09-18 07:07:31 +00:00
Samuel Pitoiset
84390c5c98
ac/spm: initialize and set instance mapping for counters
...
This configures global, per-SE and per-SA counters with different
indexes. This is still unused because only for the first instance is
used by RADV/RadeonSI, but this will be changed.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25211 >
2023-09-14 14:17:19 +00:00
Samuel Pitoiset
0864a7dfa9
ac/spm: rework how segment muxsel RAM are filled
...
This is more close to PAL and it will be easier to add GFX11 support
on top of it.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25211 >
2023-09-14 14:17:19 +00:00
Samuel Pitoiset
6ae64900e2
ac/spm: fix checking if the counter instance is valid
...
This should be compared against the number of global instances, and
there is also an off-by-one error.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25211 >
2023-09-14 14:17:19 +00:00
Samuel Pitoiset
90d9406436
ac/perfcounter: compute the number of global instances of TCP,SQ,GL1C and GL2C
...
This will be used by SPM.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25211 >
2023-09-14 14:17:19 +00:00
Samuel Pitoiset
60cb257d26
ac/perfcounter: set the number of instances of GL1C to 4
...
According to PAL there is 4 GL1C quadrants. This will also be used
by SPM.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25211 >
2023-09-14 14:17:18 +00:00
Samuel Pitoiset
10dc97b20f
ac/gpu_info: init num_cu_per_sh from the kernel
...
This will be used to configure the number of instances of TCP.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25211 >
2023-09-14 14:17:18 +00:00
Samuel Pitoiset
9552716208
ac/spm: add SPM block definition for GFX10-GFX10.3
...
Instead of using magic values.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25211 >
2023-09-14 14:17:18 +00:00
Samuel Pitoiset
b1ce30539b
ac/spm: remove useless SPM block setting for GFX9 and older GPUs
...
SPM is only implemented for GFX10+ on RADV/RadeonSI, although it's
technically possible on GFX9 but unused by RGP, so don't care.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25211 >
2023-09-14 14:17:18 +00:00
David Rosca
d57241d290
radeonsi/vcn: Set H264/HEVC chroma sample location in bitstream
...
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25078 >
2023-09-14 13:39:59 +00:00
Samuel Pitoiset
aca2adc36c
ac/spm: add SPM counters configuration for GFX11
...
All SQ counters changed to SQ_WGP and the L2 miss changed too.
Sourced from PAL.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25175 >
2023-09-14 12:30:52 +00:00
Samuel Pitoiset
42d67183e7
ac/perfcounter: add new SQ_WGP block for GFX11+
...
According to PAL, these SQ counters can be sampled at WGP granularity.
Some SPM counters captured for RGP are using this GPU block.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25175 >
2023-09-14 12:30:52 +00:00
Samuel Pitoiset
31e6c05527
ac,radv,radeonsi: rework SPM counters configuration and share it
...
This should be easier to add GFX11 support.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25175 >
2023-09-14 12:30:52 +00:00
Dave Airlie
c5fb2fff18
ac,radeonsi: move vcn enc av1 default cdf file to common
...
This can be used by radv.
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25196 >
2023-09-14 07:51:24 +00:00
Dave Airlie
daa01703cc
ac,radeonsi: move vcn enc structs to common
...
This just moves the header to make it easier to share with radv.
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25196 >
2023-09-14 07:51:24 +00:00
Samuel Pitoiset
505c2ee92d
ac/rgp: use correct API stage string for mesh/task shaders
...
This allows RGP to report the ISA.
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25144 >
2023-09-14 07:19:25 +00:00
Samuel Pitoiset
12f1c5d23b
radv: fix instruction timing on GFX11
...
GFX11 seems to operate on the last active CU.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25171 >
2023-09-14 06:29:10 +00:00
Samuel Pitoiset
c04b10155e
radv: disable unsupported hw shader stages for RGP on GFX11+
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25171 >
2023-09-14 06:29:10 +00:00
Samuel Pitoiset
2cc981a0cd
radv: fix capturing RGP on RDNA3 with more than one Shader Engine
...
PKT3_RESET_FILTER_CAM_S seems required on GFX11. Otherwise, capturing
with more than on SE can hang.
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25156 >
2023-09-12 08:38:39 +00:00
Timothy Arceri
af1528cc15
nir: replace use of nir_src_copy()
...
Since 03b2c34793 nir_src_copy() no longer does anything useful,
it will be removed in the following patch.
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24986 >
2023-09-08 03:01:39 +00:00
Timur Kristóf
19a7d9615c
ac/nir/ngg: Extract nogs_export_vertex_params function.
...
Just for better code readability. No functional changes.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24574 >
2023-09-03 11:04:35 +00:00
Timur Kristóf
93b4f200de
ac/nir/ngg: Wait for attribute ring stores in mesh shaders.
...
Make sure that both per-vertex and per-primitive attribute
ring stores are finished before position or primitive export
instructions are executed.
This is necessary because we need to ensure that mesh shader
waves work correctly when they have either vertex-only or
primitive-only waves.
Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24574 >
2023-09-03 11:04:35 +00:00
Timur Kristóf
0721784b78
ac/nir/ngg: Refactor mesh shader primitive export.
...
Cleanup the code that generates the two channels of the
primitive export instruction, and move storing the built-in
per-primitive outputs out to match how vertex attributes work.
Prepares the mesh shader lowering for a workaround that
affect export instructions.
Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24574 >
2023-09-03 11:04:35 +00:00
Timur Kristóf
edd51655f0
ac/nir/ngg: Wait for attribute stores before VS/TES/GS pos0 export.
...
This is a HW bug workaround for some (all?) GFX11 chips.
On these chips, rasterization can start before the attribute ring
stores are finished, which can cause issues.
As a workaround, wait for attribute ring stores to finish
before doing the position export.
Mesh shaders will be taken care of in another commit.
Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24574 >
2023-09-03 11:04:35 +00:00
Timur Kristóf
9c096e4ace
ac/nir: Slightly refactor how pos0 exports are added when missing.
...
Prepares for a workaround. Makes it possible for this function
to not emit the pos0 export at all so that it can be emitted
by a subsequent call to the function later.
Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24574 >
2023-09-03 11:04:35 +00:00
Timur Kristóf
838d886d90
ac/nir: Add done arg to ac_nir_export_position.
...
This prepares for a workaround where we won't need to add
the done flag to the last export in this function, because
it will be added in a subsequent call to the same function.
Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24574 >
2023-09-03 11:04:35 +00:00
Georg Lehmann
bce9bba90d
nir: add nir_scalar intrinsic helpers
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24656 >
2023-09-02 00:26:31 +00:00
Lang Yu
11106bab1b
amd/common: add AMD_CODE_PROPERTY_ENABLE_WAVEFRONT_SIZE32 property
...
This property can be used to determine wave size on gfx10+.
Signed-off-by: Lang Yu <lang.yu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24920 >
2023-08-31 20:30:03 +00:00
Alyssa Rosenzweig
25cc04c59b
treewide: Use nir_before/after_impl in easy cases
...
These open-code the same idiom as the helper.
Via Coccinelle patch:
@@
expression func_impl;
@@
-nir_before_cf_list(&func_impl->body)
+nir_before_impl(func_impl)
@@
expression func_impl;
@@
-nir_after_cf_list(&func_impl->body)
+nir_after_impl(func_impl)
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24910 >
2023-08-30 19:30:58 +00:00
Karol Herbst
513cd29eda
nir: make num_workgroups 32 bit only
...
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24905 >
2023-08-30 07:04:33 +00:00
Karol Herbst
1b22b67199
nir: make workgroup_id 32 bit only
...
No backend supports 64 bit values natively anyway.
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24905 >
2023-08-30 07:04:33 +00:00
Samuel Pitoiset
c161337029
ac: allow to mark shader arguments as preserved
...
These arguments would be used by ACO to generate a function signature
for merged shaders automatically.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24697 >
2023-08-25 07:22:03 +00:00
Alyssa Rosenzweig
465b138f01
treewide: Use nir_shader_intrinsic_pass sometimes
...
This converts a lot of trivial passes. Nice boilerplate deletion. Via Coccinelle
patch (with a small manual fix-up for panfrost where coccinelle got confused by
genxml + ninja clang-format squashed in, and for Zink because my semantic patch
was slightly buggy).
@def@
typedef bool;
typedef nir_builder;
typedef nir_instr;
typedef nir_def;
identifier fn, instr, intr, x, builder, data;
@@
static fn(nir_builder* builder,
-nir_instr *instr,
+nir_intrinsic_instr *intr,
...)
{
(
- if (instr->type != nir_instr_type_intrinsic)
- return false;
- nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr);
|
- nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr);
- if (instr->type != nir_instr_type_intrinsic)
- return false;
)
<...
(
-instr->x
+intr->instr.x
|
-instr
+&intr->instr
)
...>
}
@pass depends on def@
identifier def.fn;
expression shader, progress;
@@
(
-nir_shader_instructions_pass(shader, fn,
+nir_shader_intrinsics_pass(shader, fn,
...)
|
-NIR_PASS_V(shader, nir_shader_instructions_pass, fn,
+NIR_PASS_V(shader, nir_shader_intrinsics_pass, fn,
...)
|
-NIR_PASS(progress, shader, nir_shader_instructions_pass, fn,
+NIR_PASS(progress, shader, nir_shader_intrinsics_pass, fn,
...)
)
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24852 >
2023-08-24 15:48:02 +00:00