PDA

View Full Version : strange GL Error (VPs and glGet)



Diapolo
09-27-2002, 06:36 AM
Hi,

I try to execute the following code:
int iMaxVertexAttribs = 0;
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS_ARB, &iMaxVertexAttribs);

But that generates an:
invalid enumerant error

The token GL_MAX_VERTEX_ATTRIBS_ARB is defined in my header file as follows:
#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869

Iīm using the NVIDIA 40.71 drivers, that was released yesterday.

Anyone an idea for that?

I try to get into some VP coding and first thing I wanted to know, what my GF3 is capable of ...

Regards,
Diapolo

secnuop
09-27-2002, 06:43 AM
Use "GetProgramivARB()", not "GetIntegerv()"...

The reason for this is that the values of these constants are different depending on whether or not it is a vertex program or a fragment program or some other kind of program we don't even know exists yet, and it's easier to use the same enumerant (i.e., "PROGRAM_INSTRUCTIONS_ARB") with a different target than it is to have, say, "VERTEX_PROGRAM_INSTRUCTIONS_ARB" and "FRAGMENT_PROGRAM_INSTRUCTIONS_ARB".

Diapolo
09-27-2002, 06:51 AM
Well, I tried:
glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_VERTEX_ATTRIBS_ARB, &iMaxVertexAttribs);

But I get the same error.

And I can prove, that this line generates the error, because if I comment it out, then there is no GL error reported.

Diapolo

BTW: The glGetProgramivARB functions works for all other possible tokens. And I wonder, why the current ARB_V_P specs donīt say, how I have to query for GL_MAX_VERTEX_ATTRIBS_ARB.

[This message has been edited by Diapolo (edited 09-27-2002).]

PH
09-27-2002, 07:03 AM
According to the spec, GL_MAX_VERTEX_ATTRIBS_ARB is accepted by GetIntegerv not GetProgramivARB. So it should work.

secnuop
09-27-2002, 07:22 AM
Originally posted by PH:
According to the spec, GL_MAX_VERTEX_ATTRIBS_ARB is accepted by GetIntegerv not GetProgramivARB. So it should work.

Hmph... you're right. (I guess MAX_VERTEX_ATTRIBS_ARB doesn't make much sense for anything other than vertex programs... duh.)

Well I'm stumped then. Sounds like a driver bug to me.

For what it's worth though, if this value is anything other than 16 I'd be really surprised, since 16 is the number of vertex attributes in NV_vertex_program.

Diapolo
09-27-2002, 08:04 AM
You are right, but if itīs a driver bug, it should attract NVIDIAs attention, so that they can fix it http://www.opengl.org/discussion_boards/ubb/smile.gif.
I really like statistics, so would be very nice, if that function call would work http://www.opengl.org/discussion_boards/ubb/biggrin.gif (even if it always returns 16 *g*).

Diapolo

[This message has been edited by Diapolo (edited 09-27-2002).]

jra101
09-27-2002, 08:10 AM
Yep, this is a driver bug and should be fixed in the next release. And yes, the result will be 16 http://www.opengl.org/discussion_boards/ubb/smile.gif

Diapolo
09-27-2002, 08:25 AM
That was fast, thanks for the info.
Any infos, when there will be a final 40.xx driver and a new NV OGL Ext specs PDF?
I know, why I really like the NV developer support http://www.opengl.org/discussion_boards/ubb/biggrin.gif.

Iīve got another small question, unrelated to that one, will ARB_fragment_program only work (be supported) on the latest chips from ATI & NVIDIA (R300 / NV30) or will this extension work (h/w accelerated) on GF3/GF4, too but with some limitations in number of instructions and all that stuff?

Diapolo

Asgard
09-27-2002, 08:35 AM
ARB_fragment_program will only be available with hardware acceleration on NV30 and Radeon 9700 upwards.

jra101
09-27-2002, 08:37 AM
An updated nv30specs and nvOpenGLspecs PDF should be up on the dev site today (hopefully http://www.opengl.org/discussion_boards/ubb/smile.gif) along with several extension specs such as GL_NV_pixel_data_range.