nVidia: Array Textures not working in GL3 ?


Just tried to get my engine to work with GL3 only. Most of it works, but my lightmaps, which i store in a GL_TEXTURE_2D_ARRAY are not accepted.

glGenTexture (1, …);
glBindTexture (GL_TEXTURE_2D_ARRAY, …);

This does NOT produce a gl error, so i assume array textures are supposed to work.

glTexImage3D (GL_TEXTURE_2D_ARRAY, 0, GL_RGBA8, 512, 512, layers, 0, GL_BGRA, GL_UNSIGNED_BYTE, NULL);

This next line gives me “INVALID_ENUM”. Is this a driver bug, or do i do something wrong? (note: it all works perfectly with GL 2.1)

glTexSubImage3D (GL_TEXTURE_2D_ARRAY, 0, 0, 0, i, 512, 512, 1, GL_BGRA, GL_UNSIGNED_BYTE, data);

This is the actual call to fill the texture (one layer at a time). It gives me “INVALID_VALUE”.

This is on an nVidia Geforce 9600 with the 185.66 (beta) driver.

Any ideas? Did anyone use array textures with GL3 already ?


With the forward-compatible bit set, some of the texturing doesn’t work for me :(, even more doesn’t work in a 3.1 context.

Yes, forward compatible flag is set (otherwise it just works as with 2.1). A 3.1 context fails at creation, even without that flag set, although those are the drivers, that nVidia claims has “full 3.1 support”.

I’m currently with drivers 182.47, and creation of a 3.1 context does work (I’ve been coding in a 3.1 ctx ever since 3.1 was unveiled), no matter whether I specify forward-compatible/debug bits or not. Now, getting graphics out of 3.1 and 3.0 with FCB set proves almost impossible though :). Framebuffers get incomplete, basic texture types are unrecognized, VBOs are not drawn at all. Discard my previous reply - you can safely assume nothing works with FCB set. When I disable the FCB, everything works fine - it’s only that glDrawArraysInstanced() and glDrawElementsInstanced() are not available.
There was a warning that FCB was not supported in the first 3.0 beta drivers, but it’s been months and several iterations of the drivers already. Oh well, not that we need to complain about it - things seem to work nicely with FCB cleared, and testing-out things later with FCB will need just one line of code.

I’ve had problems with my texturing also (basic, not array) with the FCB set but seem to have resolved it. Have you tried not using GL_BGRA, but rather GL_RGBA for the format argument? I’m pretty sure that fixed it for me, although I have no clue why it would.

Haven’t looked at this yet in GL3 but just out of curiosity does calling GenerateMipmaps right after TexImage3D(…, NULL) help?

Lol, this is a funny bug :smiley:

Tried GenerateMipmap, makes no difference.

HOWEVER, i also tried GL_RGBA instead of GL_BGRA and that works !

The “funny” part is, i first initialize the texture with NULL data and then fill it layer by layer, but it only complains if the first initialization uses GL_BGRA. If i use GL_RGBA for initialization, i do not get an “invalid enum” and can then fill the layers properly using GL_BGRA :wink:

I find this very interesting, since the driver could ignore the format altogether, when it gets a NULL pointer handed over.

Anyway, it works now, with only 2 characters swapped in one place, no additional work required. nVidia should be able to fix this fast, if they read this (or should i sent a bug-report?).


Glad I could help :smiley:

I’ve not notified them yet as I haven’t spent time testing around the area to see exactly was going on, so I’d recommend you do so. You seem to have a better grasp of the issue than I do anyway.

Well, nvidias website claims they do not know my developer account anymore (the devil knows why), so i sent it to devrel@nvidia.com, but that seems not to be a valid address. Anyone knows, where i should send it to ?

> i also tried GL_RGBA instead of GL_BGRA and that works !

Thanks for pointing this out. This is indeed a driver bug, and the fix will be in the next OpenGL 3.1 driver update.


Great, thanks for the reply.

I also found cubemaps not to work properly with GL3, but i didn’t have the desire to check where the problem lies exactly (i also get an “invalid enum” at loading time, so it could be the same issue). I just reverted to GL 2.1 for now.


An updated driver is now available. Your bug should be fixed.