Rhys Perry
6974e5479c
aco: fix nir_var_shader_out barriers for task shaders
...
These will be used in a future commit.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22211 >
2023-04-01 14:46:50 +00:00
Friedrich Vock
424825c6e5
aco: Un-swap addressable VGPRs/SGPRs in RT prolog
...
Fixes: 6446b79168 ("aco: implement select_rt_prolog()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22188 >
2023-03-30 02:55:54 +00:00
Qiang Yu
67f295f1e2
aco: implement float16 nir_op_pack_(s|u)norm_2x16
...
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21552 >
2023-03-28 19:57:11 +00:00
Friedrich Vock
1979e551a8
aco: Swap operands for v_and_b32 in RT prolog
...
The second operand must be a VGPR, only the first can be a literal.
With a literal, this code was wrongly assembled and resulted in artifacts on GFX11.
Fixes: 6446b79168 ("aco: implement select_rt_prolog()")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8642
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22142 >
2023-03-28 09:16:56 +00:00
Samuel Pitoiset
2803b786f0
radv: remove set but never used num_preserved_sgprs
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21897 >
2023-03-21 13:53:58 +00:00
Rhys Perry
184cf1cb79
aco/gfx11: fix RT prolog scratch initialization
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Fixes: 6446b79168 ("aco: implement select_rt_prolog()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21961 >
2023-03-17 16:55:57 +00:00
Timur Kristóf
a42c57dc01
aco: Always enable idxen for swizzled buffer access on GFX11.
...
This helps pass the mesh shader I/O tests.
Swizzled buffer addressing seems to be broken on GFX11
when the idxen bit is 0.
No Fossil DB changes on Rembrandt (GFX10.3).
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/21930 >
2023-03-17 00:34:21 +00:00
Timur Kristóf
1f9e44c181
aco: Disable MUBUF/MTBUF offsets when they are zero.
...
Fossil DB stats on Rembrandt (GFX10.3):
Totals from 1264 (0.94% of 134920) affected shaders:
VGPRs: 69504 -> 69336 (-0.24%)
CodeSize: 6885468 -> 6886224 (+0.01%); split: -0.02%, +0.03%
MaxWaves: 24632 -> 24670 (+0.15%)
Instrs: 1287027 -> 1287209 (+0.01%); split: -0.04%, +0.05%
Latency: 6830411 -> 6831165 (+0.01%); split: -0.06%, +0.07%
InvThroughput: 1220643 -> 1220438 (-0.02%); split: -0.04%, +0.02%
VClause: 24737 -> 24751 (+0.06%); split: -0.25%, +0.30%
SClause: 42774 -> 42911 (+0.32%); split: -0.13%, +0.45%
Copies: 75408 -> 75600 (+0.25%); split: -0.62%, +0.88%
PreVGPRs: 60544 -> 59809 (-1.21%)
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/21930 >
2023-03-17 00:34:21 +00:00
Timur Kristóf
40676da381
aco: Use zero for MUBUF/MTBUF when soffset is undefined.
...
No Fossil DB changes on Rembrandt (GFX10.3).
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/21930 >
2023-03-17 00:34:21 +00:00
Daniel Schürmann
39c828cb9f
aco: remove aco::rt_stack variable
...
Since we initialize scratch in the RT proglog,
there is no need for this variable anymore.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780 >
2023-03-16 01:40:30 +00:00
Daniel Schürmann
6446b79168
aco: implement select_rt_prolog()
...
Co-authored-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780 >
2023-03-16 01:40:30 +00:00
Daniel Schürmann
2fee99a36c
aco: implement load_ray_launch_{id|size}
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780 >
2023-03-16 01:40:30 +00:00
Daniel Schürmann
1f01a86b36
aco: don't set private_segment_buffer/scratch_offset on GFX9+
...
It is unused. Also don't initialize scratch in raytracing stages as it gets
initialized in the prolog shader.
Co-authored-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780 >
2023-03-16 01:40:30 +00:00
Timur Kristóf
3b0394d063
aco: Rename visit_load_input to visit_load_fs_input.
...
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16805 >
2023-03-15 14:54:28 +00:00
Timur Kristóf
c602092033
aco: Remove VS inputs from visit_load_input.
...
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16805 >
2023-03-15 14:54:28 +00:00
Timur Kristóf
477cb943f6
aco: Implement load_typed_buffer_amd.
...
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/16805 >
2023-03-15 14:54:27 +00:00
Timur Kristóf
7d63d8882a
aco: Remove vtx_binding from MUBUF/MTBUF instructions.
...
We haven't measured any noteworthy perf improvement
from these, and they are difficult to port to NIR,
so remove them before the NIR based VS input lowering
in order to make it easier to bisect and analyze stats.
Fossil DB stats on Rembrandt (GFX10.3):
Totals from 21750 (16.12% of 134913) affected shaders:
VGPRs: 868512 -> 868664 (+0.02%); split: -0.00%, +0.02%
CodeSize: 64406804 -> 64397572 (-0.01%); split: -0.08%, +0.07%
MaxWaves: 567904 -> 567888 (-0.00%); split: +0.00%, -0.00%
Instrs: 12327212 -> 12324851 (-0.02%); split: -0.10%, +0.08%
Latency: 61367324 -> 61371204 (+0.01%); split: -0.04%, +0.05%
InvThroughput: 9687734 -> 9686000 (-0.02%); split: -0.03%, +0.01%
VClause: 248207 -> 303449 (+22.26%); split: -0.02%, +22.28%
SClause: 314942 -> 315564 (+0.20%); split: -0.09%, +0.29%
Copies: 921581 -> 921820 (+0.03%); split: -0.16%, +0.19%
Branches: 341964 -> 341967 (+0.00%); split: -0.00%, +0.00%
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/16805 >
2023-03-15 14:54:27 +00:00
Georg Lehmann
a47c3f84fb
aco: use integer access for neg_lo/neg_hi
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21766 >
2023-03-09 14:15:13 +00:00
Daniel Schürmann
cd1e5b1858
aco: fix NIR infinite loops
...
The previous solution breaks potential loop header phis.
Move the dummy-break to the bottom of the loop.
Fixes: dEQP-VK.reconvergence.subgroup_uniform_control_flow_ballot.*
Fixes: a9c4a31d8d ('aco: handle NIR loops without breaks')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21736 >
2023-03-08 16:59:41 +00:00
Timur Kristóf
a0141c6308
aco, radv: Don't use radv_shader_args in aco.
...
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/21696 >
2023-03-08 04:39:18 +00:00
Timur Kristóf
e9793331db
aco, radv: Move PS epilog and VS prolog args to their info structs.
...
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/21696 >
2023-03-08 04:39:18 +00:00
Timur Kristóf
84a2cea596
aco, radv: Rename aco_*_key to aco_*_info.
...
The naming of aco_*_key didn't make sense because they
were never actually used as cache keys, only radv_*_key
are used as cache keys.
Rename the aco structs to aco_*_info instead.
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/21696 >
2023-03-08 04:39:18 +00:00
Qiang Yu
978220c99a
aco, radv: Add load_grid_size_from_user_sgpr to aco options.
...
v2 by Timur Kristóf:
- Rebase this patch.
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Reviewed-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/21696 >
2023-03-08 04:39:18 +00:00
Timur Kristóf
3058ab6090
aco: Generalize vs_inputs to args_pending_vmem.
...
Handle arguments that need a waitcnt without relying on
RADV specific VS input information.
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/21696 >
2023-03-08 04:39:18 +00:00
Marek Olšák
f7076d129d
amd: add nir_intrinsic_xfb_counter_sub_amd and fix overflowed streamout offsets
...
Fixes: 5ec79f9899 - ac/nir/ngg: nogs support streamout
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21584 >
2023-03-07 22:08:47 +00:00
Georg Lehmann
097a97cc42
aco: remove VOP[123C]P? structs
...
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21023 >
2023-03-07 11:53:23 +00:00
Marek Olšák
6aee999131
aco: implement nir_op_unpack_32_4x8
...
Reviewed-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/19399 >
2023-03-03 03:27:40 +00:00
Qiang Yu
4b3a22fcd4
aco: only ls and ps use store output now
...
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21435 >
2023-02-28 07:19:29 +00:00
Georg Lehmann
1c5c2f77c3
aco: use and swizzle mask in dpp quad perm
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21412 >
2023-02-27 11:09:42 +00:00
Georg Lehmann
8fabde3be4
aco/gfx11: use dpp_row_xmask and dpp_row_share
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21412 >
2023-02-27 11:09:42 +00:00
Georg Lehmann
b7cd0eb439
aco: use v_permlane(x)16_b32 for masked swizzle
...
Should be cheaper than ds_swizzle.
Totals from 8 (0.01% of 134913) affected shaders:
CodeSize: 16316 -> 16388 (+0.44%)
Instrs: 3088 -> 3086 (-0.06%)
Latency: 49558 -> 49508 (-0.10%)
InvThroughput: 9180 -> 9198 (+0.20%)
Copies: 376 -> 384 (+2.13%)
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21412 >
2023-02-27 11:09:42 +00:00
Georg Lehmann
ee47cc8256
amd,nir: remove byte_permute_amd intrinsic
...
It's unused and if we ever want to use it again we should make it an alu
opcode instead.
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21445 >
2023-02-22 20:13:52 +00:00
Daniel Schürmann
2bb369dd8d
nir: add assertions that loops don't have a Continue Construct
...
Hoping that I didn't miss any, this *should* add assertions
to all functions and passes which explicitly handle 'nir_loop'.
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13962 >
2023-02-21 10:41:11 +00:00
Daniel Schürmann
b338d59047
radv: unconditionally enable scratch for RT shaders
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21159 >
2023-02-16 19:37:25 +00:00
Timur Kristóf
afdacf4dcc
aco: Don't set scalar offset on buffer load instructions when it's zero.
...
This helps generate slightly more optimal instructions.
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/21363 >
2023-02-16 17:16:34 +00:00
Timur Kristóf
4621ffdec1
aco: Get rid of redundant load_vmem_mubuf function.
...
Call emit_load directly from visit_load_buffer instead.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21358 >
2023-02-16 15:29:37 +00:00
Timur Kristóf
881c52ba19
ac: Port ACO's get_fetch_format to ac_get_safe_fetch_size.
...
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21358 >
2023-02-16 15:29:36 +00:00
Rhys Perry
b4383821e7
aco: don't modify exec in p_interp_gfx11
...
The RDNA3 ISA docs say that lds_param_load write the entire quad
regardless of exec, so this isn't needed.
fossil-db (gfx1100):
Totals from 5291 (3.93% of 134574) affected shaders:
Instrs: 4891396 -> 4789628 (-2.08%)
CodeSize: 25519032 -> 25111960 (-1.60%)
Latency: 36122982 -> 36074300 (-0.13%); split: -0.14%, +0.00%
InvThroughput: 4162436 -> 4161424 (-0.02%); split: -0.02%, +0.00%
Copies: 263862 -> 263838 (-0.01%)
PreSGPRs: 225012 -> 224179 (-0.37%)
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21171 >
2023-02-08 19:35:54 +00:00
Rhys Perry
24618721d3
ac: move ring_offsets to ac_shader_args
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19202 >
2023-02-06 14:25:15 +00:00
Qiang Yu
f6b194b648
nir,ac/llvm,aco,radv,radeonsi: remove nir_export_vertex_amd
...
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691 >
2023-02-03 12:27:44 +00:00
Qiang Yu
f44872c7b6
nir,ac/llvm,aco: remove nir_export_primitive_amd
...
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691 >
2023-02-03 12:27:44 +00:00
Qiang Yu
601ad9e0a9
amd,radeonsi: implement nir_load_force_vrs_rates_amd in driver abi
...
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691 >
2023-02-03 12:27:43 +00:00
Qiang Yu
8331842258
aco: implement nir_export_amd
...
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691 >
2023-02-03 12:27:43 +00:00
Rhys Perry
695cf75266
aco: set has_color_exports with GPL
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: 192486b7aa ("aco/gfx11: export mrtz in discard early exit for non-color shaders")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20937 >
2023-01-27 16:51:56 +00:00
Timur Kristóf
c644461b71
radv, aco, ac: Implement pack_half_2x16_rtz_split.
...
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15838 >
2023-01-26 12:24:24 +00:00
Timur Kristóf
9fc5d8d211
aco: Remove dynamic VS input loads.
...
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/20733 >
2023-01-26 02:43:11 +00:00
Rhys Perry
068c84f275
aco: add support for fp32 addition atomics
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19810 >
2023-01-17 17:39:15 +00:00
Rhys Perry
39c214769b
aco: restore semantic_can_reorder for GS output stores
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20296 >
2023-01-16 17:25:51 +00:00
Rhys Perry
18d3e4fecd
radv,aco: use ac_nir_lower_legacy_gs
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20296 >
2023-01-16 17:25:51 +00:00
Bas Nieuwenhuizen
edca10e9c9
aco: Pass correct number of coords to Vega 1D LOD instruction.
...
If we pass a physical 2D texture descriptor we should also pass 2
coords. Otherwise it just uses the random content in the second
register which ends up funny sometimes.
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20696 >
2023-01-13 16:55:06 +01:00