Good evening.
I am little test application where I have 3 significantly large textures and I am using these to map an arbitrary object. Unfortunately starting the second render frame it crashes often with this error. When I mean often really mean that in rare cases it works, using the very same unchanged code. Here is the situation:
Hardware:
Nvidia GTX 660 2GB (or 4), supports opengl 4.4 and textures of size 2048 according to the glGet
16GB RAM
Textures tested the different combinations:
3x 2D texture arrays of size 4096x4096x10, no mipmaps.
3x 2D texture arrays of size 2048x2048x40, no mipmaps.
6x 2D texture arrays of size 2048x2048x20, no mipmaps.
These are all the same textures but with different configurations and eventual corresponding triangle->texture mapping, trying to reduce the size of each texture by adding depth and then by splitting the textures into two texture units each.
I have a vao and an array buffer where I update the currently visible triangles by doing some culling, this code doesn’t seem to be the problem as when I remove one/two of the used textures the code always runs correctly, leading me to believe that my problem is with the textures.
I am using
glTexStorage3D(GL_TEXTURE_2D_ARRAY, 1, InternalFormat,Width, Height, Depth);
and
glTexSubImage3D(GL_TEXTURE_2D_ARRAY, 0, 0, 0, TextureDepthNum, Width, Height, 1, Format, Type, Data);
for allocating and filling the textures respectively, with InternalFormat being GL_RGB8,format GL_RGB and Type GL_UNSIGNED_BYTE.
The textures are all loaded into Data correctly. No errors are being thrown by OpenGL, checking after every call with glGetError and in the shader compilation and link as per defined in the documentation.
I am definitely confused as to what might be bringing this error about, and how I should fix it. I hope I explained enough of my situation so that I won’t waste much of your time, but any more information that you might require I am happy to provide.
Thank you very much for the attention, I hope someone can help me get over this problem :D