Samuel Pitoiset
1239fcab4d
radv: only copy non-NULL shaders when loaded from the cache
...
With GPL, we don't necessarily load all stages from the same cache
entry and other stages might have been imported from libraries, so
don't overwrite them.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22264 >
2023-04-04 14:47:39 +00:00
Rhys Perry
f92994bb83
radv/gfx11: improve RT scratch allocation
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22232 >
2023-04-03 16:35:17 +00:00
Timur Kristóf
50e9a8f7c2
radv: Use linear_dispatch info in GFX11 task/mesh draw packet.
...
This helps the CP (command processor) optimize mesh shader
dispatch when Y = Z = 1.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22222 >
2023-04-03 15:36:02 +00:00
Tatsuyuki Ishi
7fe469d6c8
radv: Pre-compute descriptor set layout hash.
...
While analyzing cache loading performance, hashing the pipeline layout was
surprisingly consuming around 4% of time, sometimes close to the cost of
hashing shader modules.
Turns out we were hashing the pipeline layout on every pipeline creation.
Considering that pipeline layouts are usually deduplicated by the
application, this was amplifying the hashing cost by a big margin.
With Graphics Pipeline Library, we do need to rebuild the pipeline layout
by combining those from each library, but we can memoize the hash of the
descriptor set layout. The cost of re-hashing hashes is negligible since
each descriptor set layout can amount to 1–2KB in size.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22254 >
2023-04-03 08:46:08 +00:00
Qiang Yu
531acf548a
ac/llvm: move ac_fixup_ls_hs_input_vgprs to amd common
...
To be shared with radeonsi.
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/22045 >
2023-04-03 01:35:06 +00:00
Qiang Yu
297f97a42b
ac/llvm: vs_rel_patch_id can also be fixed up
...
It's currently used when LS store output to LDS.
The LS/HS bug fix seems does not affect this case.
But we'd better treat it as other fixed args.
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/22045 >
2023-04-03 01:35:06 +00:00
Samuel Pitoiset
e98aded527
radv: fix binding raytracing/compute pipelines
...
If a compute pipeline is bound after a raytracing pipeline, the
computes shader slot (aka RT prolog) will be overwritten.
To fix this, move the RT prolog outside of the compute shader slot.
Fixes: d109362a3d ("radv: copy bound shaders to the cmdbuf state")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22235 >
2023-03-31 18:29:05 +00:00
Samuel Pitoiset
56493a5f8a
radv: add the raygen shader BO to the cmdbuf list
...
Found by inspection.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22235 >
2023-03-31 18:29:05 +00:00
Timur Kristóf
61003e3600
radv: Use radv_get_shader to get vertex shader when binding pipeline.
...
The shaders[MESA_SHADER_VERTEX] can be NULL for merged shaders.
Fixes: b2ac40e734
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8749
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/22229 >
2023-03-31 16:42:39 +00:00
Samuel Pitoiset
f8558d1fb5
radv: configure PA_SC_MODE_CNTL_1 during cmdbuf recording
...
Two graphics pipeline parameters need to be copied to the cmdbuf
state.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22218 >
2023-03-31 16:07:11 +00:00
Samuel Pitoiset
66da73e863
radv: set PS_ITER_SAMPLE(1) for sample shading during cmdbuf recording
...
This shouldn't be configured in the pipeline.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22218 >
2023-03-31 16:07:11 +00:00
Samuel Pitoiset
b750fe4c6a
radv: copy db_render_control to the cmdbuf state
...
This register is only used for meta operations.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22218 >
2023-03-31 16:07:11 +00:00
Faith Ekstrand
b16cfe23ef
vulkan,anv,hasvk,radv: Unify Android hardware buffer creation
...
Reviewed-by: Lina Versace <lina@kiwitree.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22038 >
2023-03-31 14:57:03 +00:00
Faith Ekstrand
d75f797246
radv: Set vk_image.ahardware_buffer_format
...
Reviewed-by: Lina Versace <lina@kiwitree.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22038 >
2023-03-31 14:57:03 +00:00
Faith Ekstrand
41f88be282
vulkan,anv,hasvk,radv: Add a common vk_image_usage_to_ahb_usage helper
...
Reviewed-by: Lina Versace <lina@kiwitree.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22038 >
2023-03-31 14:57:03 +00:00
Friedrich Vock
b8ee90188b
radv: Work around use-after-free compiler errors
...
Fixes: 4dafb69d ("radv/rt: defer library_pipeline allocation")
Tested-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21981 >
2023-03-31 08:52:16 +00:00
Samuel Pitoiset
56b98bb36d
radv: add dynamic support for rectangles enable/mode
...
This is in VK_EXT_discard_rectangles version 2.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21360 >
2023-03-31 07:59:18 +00:00
Samuel Pitoiset
552f877b2d
radv: fix sample shading when a new fragment shader is bound
...
Sample shading can be enabled from the pipeline and from the fragment
shader, in that case we need to re-emit some states.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22215 >
2023-03-31 07:09:15 +00:00
Konstantin Seurer
f6147051e2
radv: Stop counting user SGPRS separately
...
Renames radv_declare_shader_args to declare_shader_args and runs it
twice to first gather the user SGPR count without push constants and
descriptor sets.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22119 >
2023-03-30 21:52:03 +00:00
Konstantin Seurer
0c915ba501
radv: Set user SGPR locations when declaring args
...
Merge shader arg declaration with setting up the user data locations.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22119 >
2023-03-30 21:52:03 +00:00
Samuel Pitoiset
373c6346f5
radv: add push constant state to the cmdbuf state
...
Push constants are handled per bind point internally. Using a separate
structure in the cmdbuf state would allow us to update it easily
without relying on bound pipelines.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22209 >
2023-03-30 20:41:23 +00:00
Samuel Pitoiset
a0baefa033
radv: copy need_indirect_descriptor_sets to radv_cmd_state
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22209 >
2023-03-30 20:41:23 +00:00
Samuel Pitoiset
eeefe18f05
radv: add a helper to convert a VkPipelineBindPoint
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22209 >
2023-03-30 20:41:23 +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
Samuel Pitoiset
15f1d5cc8f
radv: copy ia_multi_vgt_param to the cmdbuf state
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22194 >
2023-03-30 11:43:06 +00:00
Samuel Pitoiset
0daffade14
radv: copy uses_{drawid,baseinstance} to the cmdbuf state
...
As well as the vertex user sgpr info. This also needs to be copied
for merged shaders (ie. VS+TCS).
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22194 >
2023-03-30 11:43:06 +00:00
Samuel Pitoiset
8fd915098d
radv: copy rast_prim to the cmdbuf state
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22194 >
2023-03-30 11:43:06 +00:00
Samuel Pitoiset
6ee8d33ef4
radv: add a helper that returns the current rasterized primitive
...
For tess/geom/mesh the rasterized primitive is part of the shader
info and primitive topology should be ignored.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22194 >
2023-03-30 11:43:06 +00:00
Samuel Pitoiset
b0a007583d
radv: copy custom blend mode to the cmdbuf state
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22194 >
2023-03-30 11:43:06 +00:00
Samuel Pitoiset
bc39fa9500
radv: rework emitting inner coverage when a fragment shader is bound
...
To stop relying on the pipeline. The state is now flagged when a new
fragment shader with a different inner coverage setting is bound.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22194 >
2023-03-30 11:43:06 +00:00
Samuel Pitoiset
5231643900
radv: remove radv_graphics_pipeline::vb_desc_alloc_size
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22192 >
2023-03-30 11:21:19 +00:00
Samuel Pitoiset
b2ac40e734
radv: remove radv_graphics_pipeline::vb_desc_usage_mask
...
Use the VS shader info instead.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22192 >
2023-03-30 11:21:19 +00:00
Samuel Pitoiset
2b1a0c0a29
radv: adjust vb_desc_usage_mask for dynamic VS inputs in the info pass
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22192 >
2023-03-30 11:21:19 +00:00
Samuel Pitoiset
d87c813da1
aco: remove unused aco_shader_info::vb_desc_usage_mask
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22192 >
2023-03-30 11:21:19 +00:00
Samuel Pitoiset
c7784f1409
radv: remove radv_graphics_pipeline::can_use_simple_input
...
Use the VS shader info instead.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22192 >
2023-03-30 11:21:19 +00:00
Samuel Pitoiset
53b2b30d0b
radv: remove radv_graphics_pipeline::next_vertex_stage
...
Use the active stages bitfield instead.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22192 >
2023-03-30 11:21:18 +00:00
Samuel Pitoiset
f224e9f1a5
radv: remove radv_graphics_pipeline::last_vertex_attrib_bit
...
Use the VS shader info instead.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22192 >
2023-03-30 11:21:18 +00:00
Samuel Pitoiset
99bca4cb50
radv: remove radv_graphics_pipeline::use_per_attribute_vb_descs
...
Use the VS shader info instead.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22192 >
2023-03-30 11:21:18 +00:00
Samuel Pitoiset
d147cf5a56
radv: use serialized NIR for graphics libs with the RETAIN flag
...
Cloning NIR shaders consumes too much RAM and this can easily explode
in memory for games that create a ton of graphics libraries. Using
serialized NIR shaders help considerably.
This reduces RAM usage in dota2 with GPL from 3GiB to 400MiB.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22143 >
2023-03-30 09:02:20 +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
93e4382438
radv, ac/nir: Move sin/cos lowering to a common pass.
...
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
Friedrich Vock
83a38987b1
radv/rt: Also adjust the SGPR count in postprocess_rt_config
...
Fixes: bea022d1f6 ("radv/rt: Add shader config combination/postprocessing utils")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22188 >
2023-03-30 02:55:53 +00:00
Rhys Perry
125ecd7e2d
radv: fix setting radv_shader_info::user_data_0 with rt
...
Fixes raytracing pipelines.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: 0e81ec98ce ("radv: move user_data_0 to the shader info pass")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22187 >
2023-03-29 22:18:33 +00:00