qt5base-lts/tests/manual/rhi
Laszlo Agocs df0e98d408 rhi: Pipeline cache load/save
Add QRhi APIs to retrieve and reload the contents of the "pipeline
cache".

The only API where there is a true pipeline cache is object is Vulkan
(VkPipelineCache). For OpenGL, the other backend where we support this,
it is simulated with program binaries. The Qt 5 style OpenGL program
binary disk cache continues to work like before, but one has now the
option to do things in a more modern, graphics API agnostic way, that
leads to generating a single blob instead of a large set of files in
some system location, allowing easier "pre-baking" of the cache content.

It is expected that Qt Quick exposes the two new functions in form
if QSG_RHI_ environment variables, thus allowing easy testing and
cache file generation.

As an example for the performance improvements this can give, consider
Vulkan, where we do not have any existing persistent caching mechanism
in place:

Running BenchmarkDemoQt6.exe --scene flythrough --mode demo creates 18
QRhiGraphicsPipeline objects from Qt Quick and Qt Quick 3D.

The total time spent in QRhiGraphicsPipeline::create() during application
startup for these 18 pipelines is 35-40 ms on a given Windows (NVIDIA)
system.

When exporting the pipeline cache contents to a file, and then, in a
subsequent run, reloading the cache contents, this is reduced to 5-7 ms
on the same system, meaning we get a 6-7x improvement.

The generated data is always specific to a given Qt version, RHI
backend, graphics device, and driver version. Much of the implementation
consists of adding and verifying the appropriate header to the blobs
retrieved from the driver, to allow gracefully ignoring data that was
generated with a device or driver that differs from the one used at
run time. This should provide robustness, even if the Vulkan or OpenGL
implementation is for some reason not prepared to identity and reject
incompatible cache/program blobs.

Fixes: QTBUG-90398
Change-Id: I67b197f393562434f372c7b7377f638abab85cb3
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-01-22 10:26:03 +01:00
..
compressedtexture_bc1 CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
compressedtexture_bc1_subupload CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
computebuffer CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
computeimage CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
cubemap rhi: vulkan: Fix mipmap generation for cubemaps 2020-09-25 09:24:25 +02:00
cubemap_render rhi: Regenerate shaders for some manual tests 2020-10-11 10:58:56 +02:00
cubemap_scissor CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
float16texture_with_compute rhi: Regenerate shaders for some manual tests 2020-10-11 10:58:56 +02:00
floattexture CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
hellominimalcrossgfxtriangle rhi: Stop hardcoding the Vulkan backend's desired instance extensions 2021-01-18 13:21:15 +01:00
instancing rhi: Fix up vertex inputs with matrices 2020-10-14 22:35:19 +02:00
mrt CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
msaarenderbuffer CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
msaatexture CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
multiwindow Add a dedicated QWindow surface type for D3D 2021-01-04 10:37:11 +00:00
multiwindow_threaded Add a dedicated QWindow surface type for D3D 2021-01-04 10:37:11 +00:00
noninstanced rhi: Make the new direct buffer update available for non-uniform buffers 2020-10-12 07:55:37 +02:00
offscreen CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qrhiprof Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE 2020-11-30 17:16:21 +01:00
shadowmap rhi: shadowmap manual test: use Nearest filtering 2021-01-04 17:30:26 +01:00
shared rhi: Stop hardcoding the Vulkan backend's desired instance extensions 2021-01-18 13:21:15 +01:00
texuploads CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
triquadcube rhi: Pipeline cache load/save 2021-01-22 10:26:03 +01:00
CMakeLists.txt rhi: Add a many cubes manual test 2020-10-11 10:58:44 +02:00
rhi.pro rhi: Add a many cubes manual test 2020-10-11 10:58:44 +02:00