Add a set of QAbstractTextureImage implementations to a texture, each of the images providing the data for a different mipmap level.
Unfortunately this breaks or crashes in various ways due to GLTexture getting confused internally.
The first half is not relevant since we do not use a QTextureData generator (since this is not exposed in the public API so cannot be utilized in any meaningful way outside Qt3D itself - which is unfortunate). So we are stuck with separate textureimages.
Here the data() in the images contain data for a single mipmap level (or cubemap face etc.). This is unlike the other case where data() contains all mipmap levels, faces and layers in one single blob.
Now check the const QByteArray bytes(imgData->data()); call and note that it is
QByteArray QTextureImageData::data(int layer, int face, int mipmapLevel) const which has default values of 0 for all the parameters. This function is only prepared to handle the everything-in-single-blob case and ends up in a
which is all wrong in our case since mipmapLevel is 0 but the returned QByteArray's size cannot be the size of the data for mipmap level 0 since m_data contains data only for a given mipmap level, not for all of them.
What should have been done instead in the textureimage case is to take m_data as-is without any fancy calculations.
|For Gerrit Dashboard: QTBUG-69138|
|233379,2||Fix QTextureImageData data access with individual TextureImages||5.11||qt/qt3d||Status: MERGED||+2||0|