Fix shared asset problems #1282
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed after I merged #1280 that the cesium-unreal unit test related to shared assets was failing. The immediate cause was that the aggregated
TileLoadInputcreated by theCesiumIonTilesetLoaderwas not getting the newpSharedAssetSystemproperty.After fixing that, though, a new problem appeared: shared assets were causing load failures. The error case was like this:
postprocessis run.postprocessskips attempting to decode images when the conditionimage.pAsset && !image.pAsset->pixelData.empty()is true. However, because Unreal clears the CPU side memory,pixelDatais empty at this point.postProcessattempts to decode a 0-byte image, which fails.My solution was to change the conditional in
postProcessto simply check thatimage.pAsset != nullptr. Any time we already have an ImageAsset, the image has been loaded, no matter what the pixelData looks like.I'm going to merge this immediately for today's release.