Fix use-after-free when reloading a SkyMaterial-backed skybox
RenderHelpers::rhiPrepareSkyBox_helper() left QSSGRenderLayer::skyBoxSrb
(or the reflection-map equivalent) untouched whenever the current frame
had no valid light probe texture, e.g. right after swapping to a new
SkyMaterial whose custom shader texture hasn't finished loading yet.
If that swap also changed radianceMapSize, QSSGRenderSkyMaterialManager
would already have deleted the previous environment/prefiltered cube
maps while resizing, leaving the stale SRB pointing at freed QRhiTexture
objects. SkyboxPass only null-checked the SRB, not its freshness, so
the next frame rendered with a dangling texture pointer.
Fixes: QTBUG-149007
Pick-to: 6.12
Change-Id: I2cd92fd8ad90dae01e9f0109ec7dcccf73559484
Reviewed-by: Andrei Yankovich <EndrIIMail@gmail.com>
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>