I am using an iMX6.Quad
I need to load quickly some 2048x2048 textures into the GPU Mem and the glTexDirectVIVMap extension is perfect for this purpose (Note: once in the GPU Mem, those textures do not need some refresh).
I am not sure about how to release the memory.
What am I doing is:
uchar* pData = new uchar[memsize]; //pData is 64bits aligned
GLuint iPhysical = ~0U;
[...] // Filling pData with some data
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexDirectVIVMap(GL_TEXTURE_2D, 2048, 2048, GL_VIV_UYVY, (GLvoid**)&pData, &iPhysical);
[...] // Using the texture with some GL instructions
It is working pretty well.
When the texture need to be released, I am just deleting it with: delete pData.
The question is:
Do I need to call glDeleteTextures(1, &iTex) to tell the GLES2 engine that the texture does not exist anymore? Or How can I be sure that the GPU wont use this shared memory space anymore?
Since I am using glTexDirectVIVMap, instead of glTexImage2D, my app crash because of the memory used.
Thank you for your help.