I have verified that the only thing that is causing my game to hang during this process is the call to FImageUtils::CreateTexture2D
I have looked at the code for this function and I cannot see an easy way to break it up over multiple ticks.
I also cannot use Task Graph System because this is a modification / creation of a UObject
#The Question
Is there an alternative to FImageUtils::CreateTexture2D that will not cause the system to hang for a brief time?
The hang averages about 2 seconds.
#Loading from Binary Array
I will be loading images from compressed binary arrays and will need to turn them into T2Ds, so I really do need a way to make a T2D from color buffer that does not cause a hang
How many textures are there and how big are they? I would consider just doing all your CreateTexture2D calls ahead of time. You could basically write your own simple memory manager for textures and recycle these UTexture2D objects that way. Creating such a manager would be easiest if you restrict the size of the allowed textures, a problem you don’t usually get to ignore in that problem space.