Qt Graphical Effects: Cache shaders between runs


In order to support multiple graphics backends, we generate qsb files
in the Qt 6 version of Qt Graphical Effects. For a few effects, like
anything depending on Gaussian Blur, this is done at runtime.

Generating these is expensive, and we were generating them once per
created item in the scene. Since the shaders will often be identical,
there is no need to do this. Instead, we cache them and reuse identical
shaders, even across runs.

As a failsafe, the environment variable QT_GFXSHADERBUILDER_REFRESH_CACHE
will force the cache to be updated.

Pick-to: 6.4
Fixes: QTBUG-107468
Change-Id: I94cab6cc6f528a4071833e3d66b50606e3200d97
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
commita3cb68f16d35ff1d750257a0fcd443a4c88ce572
parent153b7990dc473f7d1dbe24d5d760ddfe5e9538ed
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
commit timeTue, 11 Oct 2022 13:31:35 +0200