strange GL Error (VPs and glGet)

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

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”.

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

According to the spec, GL_MAX_VERTEX_ATTRIBS_ARB is accepted by GetIntegerv not GetProgramivARB. So it should work.

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.

You are right, but if it´s a driver bug, it should attract NVIDIAs attention, so that they can fix it .
I really like statistics, so would be very nice, if that function call would work (even if it always returns 16 g).

Diapolo

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

Yep, this is a driver bug and should be fixed in the next release. And yes, the result will be 16

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 .

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

ARB_fragment_program will only be available with hardware acceleration on NV30 and Radeon 9700 upwards.

An updated nv30specs and nvOpenGLspecs PDF should be up on the dev site today (hopefully ) along with several extension specs such as GL_NV_pixel_data_range.