Konstantin Seurer
1ea963c00b
radv: Use nir_builder_at
...
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23883 >
2023-07-03 15:21:37 +00:00
Erik Faye-Lund
a6da9d7147
amd: use imm-helpers
...
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23855 >
2023-06-29 07:08:19 +00:00
Alyssa Rosenzweig
069cca9d66
treewide: Remove unused builders
...
-Wunused-variables kicks in now that it can see through the init.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23860 >
2023-06-27 18:13:02 +00:00
Alyssa Rosenzweig
173b9ee69a
treewide: Use nir_builder_create more
...
perl -p0e 's/nir_builder_init\(&([^,]*), /\1 = nir_builder_create(/g' -i $(git grep -l nir_builder_init)
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23860 >
2023-06-27 18:13:02 +00:00
Alyssa Rosenzweig
815efcdf7e
nir: Use nir_builder_create
...
perl -p0e 's/nir_builder ([^;]*);\s*nir_builder_init\(&\1, /nir_builder \1 = nir_builder_create(/g' -i $(git grep -l nir_builder_init)
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23860 >
2023-06-27 18:13:02 +00:00
Eric Engestrom
8b319c6db8
radv: reformat according to its .clang-format
...
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23253 >
2023-06-16 19:59:52 +00:00
Erik Faye-Lund
590e191e77
nir: use nir_imm_{true,false}
...
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23461 >
2023-06-15 13:34:48 +00:00
Erik Faye-Lund
8b03a54bcd
nir: use more imm-helpers
...
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23461 >
2023-06-15 13:34:48 +00:00
Friedrich Vock
fa7c7791ee
radv: Add RADV_DEBUG=nort
...
This makes vkCmdTraceRaysKHR and ray queries no-ops and is useful
for triaging GPU hangs with raytracing.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23603 >
2023-06-13 19:38:27 +00:00
Qiang Yu
2e1092095a
ac/nir,radv: add 1 dword to LS/HS vertex stride
...
This reduce LDS bank conflict and align with radeonsi,
so we don't assume LDS access 16 byte aligned for both
driver.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23314 >
2023-06-09 02:05:20 +00:00
Samuel Pitoiset
7ee8a12a62
radv: add a NIR pass that lower fragment shader barycentric intrinsics
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16742 >
2023-06-07 14:40:35 +00:00
Samuel Pitoiset
506705bdeb
radv: add support for nir_intrinsic_load_rasterization_primitive_amd
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16742 >
2023-06-07 14:40:35 +00:00
Samuel Pitoiset
958cc87954
radv: add support for nir_intrinsic_load_provoking_vtx_amd
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16742 >
2023-06-07 14:40:35 +00:00
Marek Olšák
192b2c7c31
ac/nir/ngg: always use load_initial_edgeflags_amd, choose the value in drivers
...
radeonsi will have a more complicated condition here
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833 >
2023-06-06 18:01:35 +00:00
Rhys Perry
b9c1d74ff4
radv: correctly skip vertex loads with packed formats
...
This is supposed to check whether any channels of the element is used, but
skipped_start is always 0 for packed formats.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Fixes: a46acdbc3f ("radv: Lower non-dynamic VS inputs in NIR.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9062
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23370 >
2023-06-06 16:59:16 +00:00
Erik Faye-Lund
6d142078bc
nir: use generated immediate comparison helpers
...
This makes the code a bit less verbose, so let's use the helpers.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23393 >
2023-06-05 13:40:08 +00:00
Yonggang Luo
12256136e0
compiler: Rename shader_prim to mesa_prim and replace all usage of pipe_prim_type with mesa_prim
...
This is a prepare step to remove depends on p_defines.h in src/util/*
This is done by:
replace pipe_prim_type with mesa_prim
replace shader_prim with mesa_prim
replace PIPE_PRIM_MAX with MESA_PRIM_COUNT
replace SHADER_PRIM_ with MESA_PRIM_
replace PIPE_PRIM_ with MESA_PRIM_
This patch only replace code only
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23369 >
2023-06-03 03:29:03 +00:00
Samuel Pitoiset
4265ab0095
radv: merge all FS user SGPRs into one using packed arguments
...
Much cleaner and this will allow us to add more arguments easily.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23333 >
2023-06-01 10:04:53 +00:00
Samuel Pitoiset
e8fe8ce4bc
radv: introduce SHIFT/MASK for unpacking shader input args
...
Loosely based on RadeonSI, looks cleaner and safer to me. I will also
use that to pack fragment shader arguments.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23333 >
2023-06-01 10:04:53 +00:00
Samuel Pitoiset
a90d96bb22
radv/nir: use ac_nir_unpack_arg() for packed shader input user SGPRS
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23333 >
2023-06-01 10:04:53 +00:00
Chia-I Wu
063e2e8ed8
radv: fix gl_SampleMaskIn for sample shading
...
When sample shading, we need
gl_SampleMaskIn = SampleCoverage & (PsIterMask << gl_SampleID);
Add a new shader arg, ps_iter_mask, to pass PsIterMask to ps.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23265 >
2023-05-30 16:35:31 +00:00
Erik Faye-Lund
c4d2ebd285
nir: fsub -> fadd_imm
...
When doing nir_fsub(b, x, imm), we can negate the immediate value, and
replace the fsub with nir_fadd_imm() and get the same result. This makes
the code a bit shorter and easier to read.
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23179 >
2023-05-25 06:59:25 +00:00
Samuel Pitoiset
85cbdba355
radv: add support for smooth lines
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21587 >
2023-05-22 07:58:35 +00:00
Samuel Pitoiset
8c5eaf2166
radv: lower nir_intrinsic_load_poly_line_smooth_enabled_amd
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21587 >
2023-05-22 07:58:35 +00:00
Konstantin Seurer
1671b5fd1f
radv: Stop running constant folding during ray query lowering
...
Now that committed is an intrinsic index, there is no need for constant
folding.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22963 >
2023-05-14 17:28:40 +00:00
Konstantin Seurer
0cf22f9af3
nir: Make rq_load committed src an index
...
committed has to be a constant so there is no need to have a src and
depend on constant folding to remove the i2b.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22963 >
2023-05-14 17:28:40 +00:00
Alyssa Rosenzweig
ce638eafe2
aco,radv: Use unified atomics
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22914 >
2023-05-12 20:39:46 +00:00
Qiang Yu
bfcf03872e
radv: implement nir_load_barycentric_optimize_amd
...
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/22199 >
2023-04-26 03:27:26 +00:00
Harri Nieminen
aea48a4ff1
amd: fix typos
...
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22432 >
2023-04-13 23:08:22 +00:00
Konstantin Seurer
816f434efc
radv/rq: Rematerialize inv_dir before proceed
...
Helps with register pressure.
Quake II RTX:
Totals from 7 (14.29% of 49) affected shaders:
VGPRs: 688 -> 672 (-2.33%)
CodeSize: 167496 -> 167560 (+0.04%); split: -0.01%, +0.05%
MaxWaves: 70 -> 72 (+2.86%)
Instrs: 31716 -> 31760 (+0.14%); split: -0.02%, +0.16%
Latency: 385343 -> 386040 (+0.18%); split: -0.01%, +0.19%
InvThroughput: 78878 -> 78045 (-1.06%); split: -1.22%, +0.17%
VClause: 596 -> 600 (+0.67%)
Copies: 4774 -> 4747 (-0.57%); split: -0.98%, +0.42%
PreVGPRs: 617 -> 592 (-4.05%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20469 >
2023-03-30 18:15:11 +00:00
Timur Kristóf
c0692dbfab
radv: Move I/O lowering functions into a new file.
...
Also ran clang-format on the affected code.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21971 >
2023-03-30 05:59:13 +00:00
Timur Kristóf
90bf9ed759
radv: Move radv_nir_export_multiview to new file.
...
Also ran clang-format on the affected code.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21971 >
2023-03-30 05:59:13 +00:00
Timur Kristóf
685dcecb57
radv: Move radv_nir_lower_viewport_to_zero to new file.
...
Also ran clang-format on the affected code.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21971 >
2023-03-30 05:59:13 +00:00
Timur Kristóf
67de4b54fe
radv: Move radv_nir_lower_view_index to new file.
...
Also ran clang-format on the affected code.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21971 >
2023-03-30 05:59:13 +00:00
Timur Kristóf
1e2a5858f4
radv: Move radv_nir_lower_intrinsics_early to new file.
...
Also ran clang-format on the affected code.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21971 >
2023-03-30 05:59:13 +00:00
Timur Kristóf
87e7dfb5f8
radv: Move radv_nir_lower_fs_intrinsics to new file.
...
Also ran clang-format on the affected code.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21971 >
2023-03-30 05:59:12 +00:00
Timur Kristóf
838defc5eb
radv: Move radv_nir_lower_primitive_shading_rate to new file.
...
Also ran clang-format on the affected code.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21971 >
2023-03-30 05:59:12 +00:00
Timur Kristóf
1978eaf5b2
radv: Move radv_nir_* to a new folder.
...
Also ran clang-format on the affected code.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21971 >
2023-03-30 05:59:12 +00:00