PDA

View Full Version : nVidia: Array Textures not working in GL3 ?



Jan
04-16-2009, 01:22 PM
Hi

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 ?

Thanks,
Jan.

Ilian Dinev
04-16-2009, 02:32 PM
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.

Jan
04-16-2009, 02:54 PM
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".

Ilian Dinev
04-16-2009, 06:33 PM
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.

RickA
04-16-2009, 11:58 PM
Hi
glTexImage3D (GL_TEXTURE_2D_ARRAY, 0, GL_RGBA8, 512, 512, layers, 0, GL_BGRA, GL_UNSIGNED_BYTE, NULL);


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.

Brolingstanz
04-17-2009, 11:21 AM
Haven't looked at this yet in GL3 but just out of curiosity does calling GenerateMipmaps right after TexImage3D(..., NULL) help?

Jan
04-17-2009, 01:19 PM
Lol, this is a funny bug :-D

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 ;)

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?).

Jan.

RickA
04-18-2009, 06:18 AM
Glad I could help :D


nVidia should be able to fix this fast, if they read this (or should i sent a bug-report?).
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.

Jan
04-18-2009, 06:35 AM
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 ?

barthold
04-22-2009, 12:11 PM
> 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.

Barthold

Jan
04-22-2009, 04:37 PM
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.

Jan.

barthold
05-05-2009, 10:48 AM
An updated driver is now available. Your bug should be fixed.

http://developer.nvidia.com/object/opengl_3_driver.html

Barthold