Samuel Pitoiset
ba77b2d65d
radv: fix printing with RADV_DEBUG=psocachestats
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32254 >
2024-11-25 07:36:49 +00:00
Konstantin Seurer
aaf65d6219
radv: Store debug info inside radv_shader
...
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29298 >
2024-11-11 08:39:14 +00:00
Samuel Pitoiset
be06bfcbed
radv: add initial support for pipeline binaries
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30812 >
2024-09-10 08:19:52 +00:00
Samuel Pitoiset
32a4c9e117
radv: disable the in-memory cache when disableInternalCache is true
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30812 >
2024-09-10 08:19:52 +00:00
Samuel Pitoiset
3423facbd1
radv: store whether a RT pipeline is a library to the shaders cache
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30812 >
2024-09-10 08:19:52 +00:00
Samuel Pitoiset
0a15dcf95c
radv: store the number of RT stages per pipeline to the shaders cache
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30812 >
2024-09-10 08:19:52 +00:00
Samuel Pitoiset
42b1c728b2
radv: store the SHA1 RT stage to the shaders cache
...
When pipeline binaries are imported, that SHA1 would also need to be
imported in order to deduplicate shaders.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30812 >
2024-09-10 08:19:52 +00:00
Samuel Pitoiset
3d2cd4687c
radv: rework helpers for serialize/deserialize shaders
...
They will be used to serialize/deserialize shaders for pipeline
binaries.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30812 >
2024-09-10 08:19:52 +00:00
Samuel Pitoiset
0c0ecc90c4
radv: move radv_hash_shaders() to radv_graphics_pipeline.c
...
And rename it for consistency with compute/RT hash functions.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30045 >
2024-07-05 13:33:24 +00:00
Samuel Pitoiset
7c0b73e0aa
radv/rt: rework the helper that hashes a ray tracing pipeline
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28860 >
2024-04-26 07:40:09 +00:00
Samuel Pitoiset
095e3af2b0
radv: add RADV_DEBUG=psocachestats to report per-pipeline cache hits/misses
...
This can be useful to make sure precompilation works as expected.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28829 >
2024-04-22 13:54:05 +00:00
Samuel Pitoiset
1f4ee45914
radv: rework pipeline cache search helpers
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28829 >
2024-04-22 13:54:05 +00:00
Samuel Pitoiset
bbe52934b6
radv: use radv_pipeline::sha1 for graphics/compute pipelines
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28829 >
2024-04-22 13:54:05 +00:00
Samuel Pitoiset
6e24da3ad4
radv/rt: move radv_ray_tracing_pipeline::sha1 to radv_pipeline
...
To re-use it for graphics/compute pipelines.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28829 >
2024-04-22 13:54:05 +00:00
Samuel Pitoiset
862d53f00a
radv/rt: remove unnecessary param to radv_ray_tracing_pipeline_cache_insert()
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28829 >
2024-04-22 13:54:05 +00:00
Rhys Perry
e0db4b458b
radv: cache RT stage info
...
If a RT pipeline misses the cache but it's imported stages hit the cache,
then can_inline might be false when it should be true.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28788 >
2024-04-22 11:55:26 +00:00
Samuel Pitoiset
05cd85afc6
radv: add a helper for hashing pipelines
...
Similar between graphics/compute/raytracing pipelines.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28651 >
2024-04-10 20:05:22 +00:00
Samuel Pitoiset
2526d1020b
radv/rt: stop passing pCreateInfo to radv_ray_tracing_pipeline_cache_search()
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28645 >
2024-04-10 06:38:38 +00:00
Samuel Pitoiset
5db1ce3733
radv/rt: handle creation feedback like graphics/compute pipelines
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28645 >
2024-04-10 06:38:38 +00:00
Samuel Pitoiset
f6d9772010
radv: determine if the cache is disabled at device creation time
...
It's a cleanup but also for future work.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28645 >
2024-04-10 06:38:37 +00:00
Samuel Pitoiset
87fde606cf
radv: use SPDX-License-Identifier
...
Only files under src/amd/vulkan/** are concerned.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28599 >
2024-04-08 07:17:31 +00:00
Rhys Perry
be8b8722f9
radv: memset radv_pipeline_cache_object data
...
This silences Valgrind warnings.
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/28549 >
2024-04-05 11:56:25 +00:00
Samuel Pitoiset
69b911bc53
radv: remove radv_private.h
...
This file was a giant mess and I'm very happy to remove it entirely.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28568 >
2024-04-04 21:57:46 +00:00
Samuel Pitoiset
0388df3d08
radv: replace RADV_FROM_HANDLE by VK_FROM_HANDLE
...
It was exactly the same thing.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28568 >
2024-04-04 21:57:45 +00:00
Samuel Pitoiset
987f3351b3
radv: add radv_pipeline_rt.h
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28526 >
2024-04-03 13:32:54 +00:00
Samuel Pitoiset
8e9b41641a
radv: add radv_pipeline_cache.h
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28526 >
2024-04-03 13:32:54 +00:00
Samuel Pitoiset
b35b2718be
radv: remove radv_physical_device::instance
...
Get the instance object using the base object.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28500 >
2024-04-01 16:35:09 +00:00
Samuel Pitoiset
e2c29c9bb6
radv: remove radv_device::instance
...
Use the physical device to access the instance.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28500 >
2024-04-01 16:35:09 +00:00
Samuel Pitoiset
896c9cf486
radv: remove radv_device::physical_device
...
Get the logical device object using the base object.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28500 >
2024-04-01 16:35:09 +00:00
Yonggang Luo
db103c56ab
treewide: Remove vulkan/runtime vulkan/util prefix in include path
...
This is for unify the include style of shared vulkan headers
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27526 >
2024-03-05 19:05:00 +00:00
Tatsuyuki Ishi
991ae339f5
radv: Implement NIR caching behind RADV_PERFTEST=nircache.
...
NIR caching is useful for two use cases:
- Shader permutations involving reused VS or FS.
- GPL-like engine that compiles a separate (library) variant and an
optimized (monolithic) variant, e.g. DXVK.
By caching the result of radv_shader_spirv_to_nir, permutations hitting
the cache can have their compilation time reduced by 50% or more.
There are still open questions about the memory and storage footprint of
NIR caches, which is why this is gated behind a perftest flag. In
particular, Steam doesn't want to ship NIR cache since they are
unnecessary in presence of a full precompiled shader cache. In this
commit, the cache entries do not reside in memory and are immediately
written to the disk. Further design around how the caches are stored and
how to coordinate cache type with Steam etc. is left as future work.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26696 >
2024-01-26 11:46:18 +00:00
Tatsuyuki Ishi
8bf5c33c9c
radv: Rename cache_search_nir to cache_lookup_nir_handle.
...
A future commit will introduce cache_lookup_nir (which does not create
an intermediate vk_pipeline_cache_object), so rename it for consistency.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26696 >
2024-01-26 11:46:18 +00:00
Konstantin Seurer
a9c057d5a3
radv: Implement NIR debug printf
...
Adds radv_build_printf which can print nir_defs. The arguments are written
to a buffer and printed after the submit.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25753 >
2024-01-20 16:11:55 +01:00
Samuel Pitoiset
72d2eb39fb
radv: pass radv_graphics_state_key to radv_hash_shaders()
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27073 >
2024-01-17 12:08:24 +00:00
Samuel Pitoiset
739c8eb681
radv: hash radv_shader_stage_key
...
This will allow us to remove the pipeline key completely for compute/rt
pipelines.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27036 >
2024-01-17 07:25:49 +00:00
Samuel Pitoiset
4fe5f06d40
radv/rt: re-use radv_ray_tracing_stage::sha1 for hashing RT pipelines
...
radv_ray_tracing_stage::sha1 is radv_pipeline_key+shader_sha1 which
should be similar to what the code was doing.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27030 >
2024-01-15 08:58:37 +00:00
Samuel Pitoiset
4d44cea3e0
radv: introduce radv_device_cache_key for per-device cache compiler options
...
This replaces RADV_HASH_SHADER_xxx by radv_device_cache_key which is
a new struct that contains per-device compiler options. More options
will be moved there.
Blake3 is used to replace sha1.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26948 >
2024-01-11 08:37:36 +00:00
Konstantin Seurer
77b9a6f9e2
radv/rt: Use radv_shader for compiled shaders
...
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25224 >
2024-01-07 21:28:19 +01:00
Konstantin Seurer
aaa64217ca
radv: Add more ray tracing data to the cache
...
This makes the cache more flexible when it comes to missing stages. This
will be used to skip compiling unused ray tracing stages.
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25224 >
2024-01-07 21:27:56 +01:00
Konstantin Seurer
a784477269
radv: Don't store library stack sizes
...
They are already imported in radv_rt_fill_stage_info.
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25224 >
2024-01-07 21:27:53 +01:00
Konstantin Seurer
92a951db6a
radv: Make pipeline cache object data generic
...
Pipeline cache objects can hold some generic data. Anything concerning
that should not be handled in "common" code paths.
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25224 >
2024-01-07 21:27:27 +01:00
Samuel Pitoiset
a3b3a7d36a
radv: remove unused code for compiling PS epilogs as part of pipelines
...
Since we switched to the "on-demand" path for GPL, this is dead code.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26398 >
2023-12-06 08:01:46 +00:00
Tatsuyuki Ishi
325d650c6e
radv: Use sizeof(flags) instead of hardcoded size in radv_hash_shaders.
...
For consistency.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26145 >
2023-11-11 05:26:27 +00:00
Tatsuyuki Ishi
ef414a8231
radv: Fix mis-sizing of pipeline_flags in radv_hash_rt_shaders.
...
pipeline_flags was 64-bit yet only the first 4 bytes were hashed.
Luckily, the mask included no flag above the 32nd bit, so this was
technically working fine. Still, it's better to use explicit sizeof
constructs to be more resilient to accidental type changes.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26145 >
2023-11-11 05:26:26 +00:00
Connor Abbott
e6f5d7222c
vk,lvp,tu,radv,anv: Add common vk_*_pipeline_create_flags() helper
...
And replace the various homegrown or copy-pasted helpers in drivers.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25436 >
2023-11-06 14:33:51 +00:00
Konstantin Seurer
e039e3cd76
radv/rt: Store NIR shaders separately
...
In order to compile monolithic shaders with pipeline libraries, we need
to keep the NIR around for inlining recursive stages.
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21929 >
2023-09-10 11:40:12 +00:00
Samuel Pitoiset
9089b091b2
radv: add support for VkPipelineCreateFlags2CreateInfoKHR
...
If the structure is present in pNext, it's used instead of flags.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24392 >
2023-08-10 03:05:02 +00:00
Samuel Pitoiset
f4b9c5b1d0
radv: store pipeline create flags to radv_pipeline::create_flags
...
This is a common practice in vulkan/runtime and this will be easier
to use extended pipeline create flags.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24392 >
2023-08-10 03:05:02 +00:00
Samuel Pitoiset
08bfcc12d4
radv: rename radv_pipeline_stage to radv_shader_stage
...
It's more generic and it will fit shader object just well.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24313 >
2023-07-26 07:44:49 +00:00
Daniel Schürmann
437bf4fccb
amd: move end-of-code marker padding to ACO.
...
This makes it consistent between drivers and compilers.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23799 >
2023-07-11 12:01:45 +00:00