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>
commitd12b9f8c0a1ac9489c7160ac4e5a959cf73515f2
parent99c48d56f8a81b0b9f23d7c592548dd20b2309aa
authorJonas Karlsson <jonas.karlsson@qt.io>
committerJonas Karlsson <jonas.karlsson@qt.io>
commit timeWed, 12 Aug 2026 06:07:14 +0000