Hi,
We are using Urho3D on a raspberry pi to animate planes with textures. As the pi has limited graphics memory we use the resource cache to load the textures in the background before they are needed, and unload them after they are used.
This works mostly fine.
We just noticed that even if the loading part is done in the background, it finishes with an Texture2D::EndLoad()
, that is performed in the main thread.
In EndLoad, the function bool success = SetData(loadImage_);
is called, and on our platform that call takes between 20 ms to 50 ms. In our compilation on the PI, the code from OGLTexture2D.cpp
is used.
As this is done in the main thread, we currently struggel to come under the 16.66 ms per frame we need to rech a 60 fps target. Actually we can not even reach a 30 fps target when the texture loading behaves like this. The texture we use is about 1920*1080, and in RGBA.
Therefore i wonder what is done during this face of the process, and what we can do to make it faster. Can we use other picture formats? Currently we use PNG. Or is the time spent copying raw image data from memory to graphics memory?
Does this process really need to be in the main thread?
I guess this is something that is unique to the raspberry pi, or at least not a commom problem on other platforms. Or do we miss something basic in how we work with textures and texture loading?
Sincerely,
Alexander