glGetError always returns zero

For some reason glGetError always returns zero in my functioning program (yes, valid GL context if you were wondering).

glBegin GL_TRIANGLES
glBindTexture GL_TEXTURE_2D, tex
glEnd

This fails to produce an error on the affected setup, on another machine the program reports the proper error value.

This happens on nVidia GeForce 7300 GT with the latest drivers. I have the “error reporting” turned to “On” on the NV control panel, but I don’t trust it. The new control panel seems rather buggy (besides being slow, bloated and ill-designed GUI-wise). I’ve had problems with other settings before, being “on” while they were checked off. I reinstalled the drivers a few times to reset them to the defaults. Either way, there’s no difference having the optimization off or on.

Can anyone give me some hints how to solve this? I think the NV control panel is to blame, but I’m not sure.

It may also be interesting to note that glIntercept did pick up a wglSwapbuffers error (due to premature WM_PAINT event that was triggered before the context was created) but otherwise it remains silent on GL errors.

I’ve solved the problem (well sort of). It is indeed the NV control panel “error reporting” optimization resulting in unpredictable behavior. First of all, when “error reporting” is turned ON it is actually OFF (i.e. not reporting GL errors)! This behavior is also the opposite of the description field (text which is not always shown, another bug I guess).

Second, it also seems that the per-application override settings do not work as they should. In fact, they sometimes seem to affect the global settings rather than the other way around.

Is there some way to get the good old control panel back? I’d love to know for sure what driver settings I’m running on, as well as see the temperature monitor. I know there’s a registry hack, but it only works once, and requires a driver re-install each time you use it.

I’m disappointed by the shoddy work, nVidia. I hope someone reads this…

Oh, here’s the registry hack:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\Global\NvCplApi\Policies]
"DevPolicies"=dword:00000000
"ModePolicies"=dword:00000000
"ModePersist_GPU:0_Mode:0"=hex:00,00,00,00,40,00,00,00,00,00,00,00,00,00,00,00,\
  05,00,00,00,00,00,00,00,05,00,00,00,00,00,00,00,00,00,00,00
"LutPersistDesktop_GPU:0_Head:0"=hex:00,00,00,00,64,00,00,00,64,00,00,00,64,00,\
  00,00,64,00,00,00,64,00,00,00,64,00,00,00,64,00,00,00,64,00,00,00,64,00,00,\
  00
"LutPersistFSVM_GPU:0"=hex:00,00,00,00,64,00,00,00,47,00,00,00,47,00,00,00,5a,\
  00,00,00,45,00,00,00,45,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
"ContextUIPolicy"=dword:00000001
"CplGroupUIPolicy"=dword:00000001
"TaskbarUIPolicy"=dword:00000001

Save as .reg and run it. Only works once, requires a driver re-install each time you use it.

Maybe this is a wild idea, but how about making the error reporting optional in OpenGL 3.0 to prevent driver optimizations breaking applications that rely on error checking? It would also make drivers using these optimizations OpenGL compliant, which IMO they clearly are not.

E.g.

glEnable(GL_ERRORS);
glDisable(GL_ERRORS);

By default error checks would be enabled. Should be fairly trivial to implement too.