qt: use gpu to generate dynamic shadows when applicable
MultiEffect
[1] that is introduced with Qt 6.4 is the novel way of utilizing shaders to generate effects. Although it is a contemporary alternative to the old school Qt Graphical Effects (now deprecated), we can not simply switch to it as we are supposed to support minimum Qt 6.2.
At the same time, Qt Graphical Effects that is modified (reversion to its Qt 6.2 state) to not link against Qt Shader Tools library work really poorly and is completely broken with large radius. For that reason, I recently switched to software generated shadows in Player.qml
.
Now, I'm proposing to use MultiEffect
when available. It is used when Qt version is greater than or equal to 6.4.0, otherwise software generated shadow is used (which is not cached, so repeated generation does not exhaust the cache; but it is also much slower so is not really suited for dynamic generation as necessary in Player.qml
due to window size changes and variant aspect ratio of cover art).
[1] https://doc.qt.io/qt-6/qml-qtquick-effects-multieffect.html