glTexImage3D crashes for certain sizes, for example the following code will crash:
int width = 65; int height = 64; int depth = 64; int size = width * height * depth; byte *data = new byte[size]; GLuint tex; glGenTextures(1, &tex); glBindTexture(GL_TEXTURE_3D, tex); glTexImage3D(GL_TEXTURE_3D, 0, GL_R8, width, height, depth, 0, GL_RED, GL_UNSIGNED_BYTE, data);
It’s totally weird, it is ok for width= 63, 64 and 67 but it crashes for 65 and 66.
I think when it is divisible by 4 then it’s ok, but not always crashes when it’s not divisable by 4.
Vista 64 bit