glTexImage2D crashes on NV 93.71

anyone else get this crash?

GLuint texID;
glGenTextures(1, &texID);
glBindTexture(GL_TEXTURE_2D, texID);
int w=4000-1, h=4000;
char* pixels = new char[w*h*3];
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, w, h, 0, GL_RGB, GL_UNSIGNED_BYTE, pixels);

What’s your unpack alignment?

4, why do you ask?
sooorryyy. :slight_smile:

Considering your recent comments on catalyst “the unsinkable” I’m surprized to see such heroic attempt to exploit a weakness in your favoured driver.

Now seriously - what do you guys think of making alignment 1 by default? Should be convenient for beginners and if someone wishes to use 2 or 4 he can always easily change it anyway.
I guess such minor change wouldn’t be much of a problem to introduce even at late development stage of Longs Peak specs and implementation (I assume both NVIDIA and ATI started their implementations allready).

I doubted the chosen one, and was proven wrong. Praise be the chosen one.

It’s a legacy thing left over from when textures could only be power of two and hence would always have a width aligned to 4 pixels. I can’t get used to this freedom to have textures whatever size I want.
As with all legacy things, the default of 4 should be ousted in the new GL.

>>when textures could only be power of two and hence would always have a width aligned to 4 pixels.<<

Not true, the alignment is per row and tightly packed user data of a power-of-two 2x2 GL_RGB8 texture has rows not aligned to 4 bytes, which will bite beginners most often when using mipmaps.

come again?

What Relic says it that’s safe to use any format if your texture has power of two size and is at least 4x4.
If you want to pass mipmaps you have to pass 2x2 texture image (1x1 is no problem :slight_smile: ). That means with RGB8 you need to be carefull with alignment.

ah right, ok cheers.

I don’t know if you’ve fixed your problem, but looking at the code, the dimensions of the texture are not powers of 2 (3999x4000).

thank you joseph, good call.