Release the sky material's graphics resources when it is destroyed


The sky material stored its per-face IBL and background uniform
buffers in the draw call data cache with itself as the cid of the
key, and the srbs for the environment cube and background passes
are cached with the material's binding lists as the key. None of
these entries were released when the render object was destroyed;
the type does not take part in the material cleanup, and it did not
carry the HasGraphicsResources flag, so the scene manager deleted
the node directly instead of deferring to the render thread.

A sky material whose only scene manager reference comes from the
SceneEnvironment.skyMaterial assignment, for example one provided
through a QML singleton, has its backend node destroyed on every
swap-out and recreated on every re-assignment, growing the caches
on every swap.

Key the uniform buffers following the key's convention, with the
driving pass as the cid (the layer's sky material pass for the IBL
cube, the background pass for the background) and the material in
the resource slot, so that cleanup on material destruction finds
the entries and a material shared between views gets one uniform
buffer per layer. Tag the type with HasGraphicsResources so it is
cleaned up on the render thread while the rhi context is active,
and release the draw call data and the two cached srbs there.

Pick-to: 6.12
Fixes: QTBUG-149590
Change-Id: I36f21413d28472733e39e4a446338448307cae30
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
commitb30b1157e47ff1b8da061d05ab2a377d3ddd3f18
parent66810a3b7f24d379e0450cf4d674ce6f5c376033
authorChristian Strømme <christian.stromme@qt.io>
committerChristian Strømme <christian.stromme@qt.io>
commit timeWed, 9 Sep 2026 08:30:38 +0000