Resizing UTexture2D programmatically

Given a UTexture2D object that I created programmatically, by creating FTexturePlatformData and necessary mips, how do I resize it programmatically? My data dynamically changes size, but setting new sizes for PlatformData and locking/updating/unlocking mip doesn’t seem to do the trick - I keep running in race error with RHI (it seems to assert on size difference between UTexture2D and underlying tex resource, which seems to not be updated). What’s the proper way of doing this?

Any help/pointers are very much appreciated.

2 Likes