Commit Graph

1357 Commits

Author SHA1 Message Date
Rhys Perry
dc01f03d1b radv: remove is_internal pipeline creation parameter
Instead, check if the cache is the meta shader cache. This catches the
shaders created by radv_create_radix_sort_u64().

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/21606>
2023-03-02 16:48:09 +00:00
Samuel Pitoiset
4ec6850210 radv: fix DCC decompress on GFX11
The hardware requires one color output to be set by CB registers,
otherwise the DCC decompression does nothing.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8127
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8175
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8370
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21629>
2023-03-02 16:03:31 +00:00
Georg Lehmann
9f155c21c3 amd: d16 uses rtz conversion for 32bit float
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21404>
2023-02-27 09:55:34 +00:00
Georg Lehmann
77252687fa amd: don't use d16 for integer loads
D16 saturates to min/max instead of just truncating.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21404>
2023-02-27 09:55:34 +00:00
Georg Lehmann
a00b50d820 nir: change 16bit image dest folding option to per type
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21404>
2023-02-27 09:55:34 +00:00
Marek Olšák
e0c8b24e22 amd/registers: unify VRS combiner definition names between gfx103 and gfx11
use gfx11 names

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Bas Nieuwenhuizen
ed76833705 radv: Implement & expose VK_EXT_pipeline_library_group_handles.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21406>
2023-02-23 22:17:30 +00:00
Samuel Pitoiset
1583b150d6 radv: set VS_OUT_MISC_SIDE_BUS_ENA for clip distances on GFX10.3+
On GFX10.3, all auxiliary position exports are optimized, so set it
for clip/cull distances. Both RadeonSI and llpc set it too.

Suggested by Marek.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21439>
2023-02-22 07:17:33 +00:00
Timur Kristóf
e13074d763 radv: Call nir_lower_array_deref_of_vec in radv_lower_io_to_scalar_early.
This fixes an issue when a vector component of an arrayed output has a deref.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8197
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21028>
2023-02-17 17:47:47 +00:00
Samuel Pitoiset
78c0fae08c radv: only skip emitting the pipeline blend state if the FS uses an epilog
The blend state is emitted from the command buffer when the FS uses
an epilog (either compiled from a lib with GPL or compiled on-demand).

This shouldn't change anything but it will allow to disable using a
PS epilog when the fragment shader doesn't write any color outputs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21341>
2023-02-17 13:19:54 +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
74f1b77046 radv: Move VS input lowering to new file: radv_nir_lower_vs_inputs.
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
Samuel Pitoiset
214d6d05ed radv simplify compiling graphics shaders with a mask of active NIR stages
Instead of recomputing the same bitfield everywhere.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21237>
2023-02-13 09:15:37 +00:00
Samuel Pitoiset
8dd0b98786 radv: only initialize shader arguments for the active stages
Other stages don't need to be initialized.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21237>
2023-02-13 09:15:37 +00:00
Samuel Pitoiset
d05a02018b radv: use last_vgt_api_stage for determining the last stage with XFB
It's shorter and cleaner.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21237>
2023-02-13 09:15:37 +00:00
Samuel Pitoiset
9f8c563e10 radv: fix importing retained NIR shaders when a lib uses the RETAIN bit
Fixes couple of GPL regressions with VKCTS, I thought this was test
bugs but it's valid behaviour as long as the libary uses
VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21245>
2023-02-13 08:17:05 +00:00
Samuel Pitoiset
69bd1c0c40 radv: restore uploading shaders individually instead of consecutively
The shaders were uploaded consecutively to fit a RGP constraint but
this was more like a workaround. This upload path doesn't work well for
graphics pipeline library and it was the main blocker for GPL caching.

This commit breaks capturing shaders with RGP if the offset between
shaders is too big. Next commit should fix it by using shaders reloc.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21078>
2023-02-10 13:42:14 +00:00
Samuel Pitoiset
46aee750c6 radv: stop skipping the cache for monolithic graphics pipelines with GPL
Only libraries and optimized (LTO) pipelines are still unsupported,
but there is no reason to skip the cache for monolithic pipelines.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21198>
2023-02-09 08:11:45 +00:00
Samuel Pitoiset
26896616c1 radv: stop skipping the cache for compute/raytracing pipelines with GPL
This was a hard solution somewhat.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21198>
2023-02-09 08:11:45 +00:00
Samuel Pitoiset
53cea404f7 radv: simplify creating a FS epilog from a library
It's now compiled in radv_graphics_pipeline_compile().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21140>
2023-02-09 07:48:03 +00:00
Samuel Pitoiset
06d17fccfb radv: make sure to disable MRT compaction when compiling a PS epilog with GPL
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21140>
2023-02-09 07:48:03 +00:00
Samuel Pitoiset
16e4dd3e37 radv: fix disabling MRT compaction for on-demand PS epilogs
Some dynamic states require to compile PS epilogs on-demand. In this
case, MRT compaction should be disabled because we don't know the CB
state when compiling the fragment shader.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21140>
2023-02-09 07:48:03 +00:00
Samuel Pitoiset
ea5c893289 radv: regroup PS epilog info when generating the graphics pipeline key
No logical change.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21140>
2023-02-09 07:48:03 +00:00
Samuel Pitoiset
84d006ef11 radv: simplify determining when the fragment shader needs an epilog
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21140>
2023-02-09 07:48:03 +00:00
Samuel Pitoiset
b41c6c3a50 radv: cleanup graphics pipeline library flags uses
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21140>
2023-02-09 07:48:03 +00:00
Samuel Pitoiset
7976316f3e radv: fix skipping graphics pipeline compilation when the FS is NULL
Fixes: 3eb97b9d33 ("radv: skip compilation when possible with GPL fast-linking")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21192>
2023-02-09 07:27:53 +00:00
Tatsuyuki Ishi
c6ebd2de71 radv: Fix noop FS not getting constructed for GPL pipelines.
The condition was inverted, causing compilation to be actually skipped when
a noop FS is used and straight emitting the pipeline from the default
initialized struct.

Fixes: 3eb97b9d33 ("radv: skip compilation when possible with GPL fast-linking")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21166>
2023-02-08 10:52:54 +00:00
Qiang Yu
4888dd7391 radv: use amd common force_vrs option
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/21010>
2023-02-07 08:09:39 +00:00
Qiang Yu
1e3198c766 radv: move radv_consider_force_vrs above radv_fill_shader_info
It will be used by radv_fill_shader_info, no function change.

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/21010>
2023-02-07 08:09:39 +00:00
Alejandro Piñeiro
a12a71e6c0 radv: use shader_info->var_copies_lowered
Instead of passing allow_copies as a parameter for radv_optimize_nir
(so manually doing that tracking).

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19338>
2023-02-06 22:11:34 +00:00
Konstantin Seurer
569517d7ad radv: Use common ycbcr conversion lowering
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20731>
2023-02-06 18:36:29 +00:00
Samuel Pitoiset
2fe3cef367 radv: do not insert fast-linked libraries to the shaders cache
Similar to fast-linked pipelines that aren't added to the cache.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21133>
2023-02-06 15:01:30 +00:00
Rhys Perry
c68f9ed020 radv/llvm: use the ring_offsets shader arg
Besides being nicer, this also fixes load_sample_positions_amd with LLVM.

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:16 +00:00
Konstantin Seurer
7f98fcae52 radv: Scalarize global IO with LLVM enabled
Fixes the "atomic store operand must have integer, pointer, or floating point type!" error with RADV_DEBUG=llvm,checkir.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20840>
2023-02-05 12:40:25 +00:00
Qiang Yu
7c41cdb81f ac/nir,radv,radeonsi: gs copy shader use ac_nir_export_(position|parameter)
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
7308637bb4 ac/nir,radv,radeonsi: legacy vs use ac_nir_export_(position|parameter)
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
Samuel Pitoiset
3ad9a6e7c2 radv: simplify an assertion after considering RADV_FORCE_VRS
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21068>
2023-02-02 15:06:07 +00:00
Samuel Pitoiset
3eb97b9d33 radv: skip compilation when possible with GPL fast-linking
When all shader stages have already been imported it's possible to
skip radv_graphics_pipeline_compile() entirely. This makes GPL
fast-linking VERY fast.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21068>
2023-02-02 15:06:07 +00:00
Samuel Pitoiset
6b513a9c6a radv: determine the last VGT API stage earlier
It can be computed right after the active stages are known. While we
are at it, simplify the code.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21068>
2023-02-02 15:06:07 +00:00
Samuel Pitoiset
031bbdfbe6 radv: stop using the graphics pipeline key after compilation
Only the blend state was relying on the graphics pipeline key. This
will allow us to skip generating it when there is no compilation at
all (for fast-linking with GPL).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21068>
2023-02-02 15:06:07 +00:00
Samuel Pitoiset
aebe65e88a radv: return a boolean value in radv_pipeline_needs_dynamic_ps_epilog()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21068>
2023-02-02 15:06:07 +00:00
Samuel Pitoiset
6ddf1fd9ad radv: pass the lib flags for generating the pipeline key
No functional change.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21068>
2023-02-02 15:06:07 +00:00
Samuel Pitoiset
863bc08136 radv: remove one unused variable in radv_graphics_lib_pipeline_init()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21042>
2023-02-02 14:01:12 +00:00
Samuel Pitoiset
c9e032be7f radv: allow to create a noop FS in a library with GPL
Otherwise, a noop FS will be always compiled during linking if not
provided by the application and that is too slow for fast-linking.

This should be improved to use a global noop FS but it's really tricky
because NIR linking doesn't do anything when the next stage is unknown,
and hence doesn't remove unused varyings.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21042>
2023-02-02 14:01:12 +00:00
Samuel Pitoiset
aa68b98b87 radv: remove radv_pipeline_stage::spirv::sha1
This is no longer used.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21048>
2023-02-01 23:25:52 +00:00
Samuel Pitoiset
853f8eb930 radv: remove redundant zero initialization of pipeline layout
It's already zeroed in radv_pipeline_layout_init().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21048>
2023-02-01 23:25:52 +00:00
Samuel Pitoiset
cd6712e3a8 radv: pass pCreateInfo to radv_graphics_pipeline_compile()
This removes some duplicated code.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20990>
2023-02-01 14:20:47 +00:00
Samuel Pitoiset
6f17ce08fc radv: pass radv_compute_pipeline to radv_compute_pipeline_compile()
Similar to graphics.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20990>
2023-02-01 14:20:47 +00:00
Samuel Pitoiset
b4deb3aa32 radv: move retained shaders info to radv_graphics_pipeline
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20990>
2023-02-01 14:20:47 +00:00
Samuel Pitoiset
b982f8bbe4 radv: pass radv_graphics_pipeline to radv_graphics_pipeline_compile()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20990>
2023-02-01 14:20:47 +00:00