GL_CONSTANT bug in 56.64?

When I do something like this:

glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, /* any old texture */);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_REPLACE);
GLfloat color[4] = /* different each frame */;
glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, color);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_CONSTANT)

The constant color seems to be cached the first time it it used, and ignores all GL_TEXTURE_ENV_COLOR calls after. I’ve tested this on someone else’s computer with older drivers and it works as expected (different color each frame), but I thought I’d ask here as a sanity check or to see if there are any work arounds.

I am having the same problem.

It seems that this is a (new?) bug for GeForce FX level hardware only (at least with current 56.72 driver; tested on GeForce FX 5600 and GeForce FX 5900XT). Same program works on a GeForce4 MX with 56.72 driver and on a GeForce4 GO with older 45.23 driver…

Originally posted by Hampel:
[b]I am having the same problem.

It seems that this is a (new?) bug for GeForce FX level hardware only (at least with current 56.72 driver; tested on GeForce FX 5600 and GeForce FX 5900XT). Same program works on a GeForce4 MX with 56.72 driver and on a GeForce4 GO with older 45.23 driver…[/b]
It’s probably due to the way GeForce FX uses constants. If you look at the NVIDIA hardware Siggraph 2002 presentation by Bill Mark, it says:

512 constants or uniform parameters
Each constant counts as one instruction

So constants are immediates embedded or inlined in the fragment program.

They probably forgot to regenerate the fragment program used for the fixed function pipeline (or patch the instruction holding the constant) every time you change the GL_CONSTANT.
If you change the state in such a way that you force the program to be regenerated, it should work around your problem.

We are having the same problem here …
We use the constant alpha texenv to lerp two textures … and with latest drivers, lerp becomes a on/off function.

FWIW,
SeskaPeel.

The same hapened to me. I just use a 1x1 texture in another texture unit to workarround it.

Dito here. My tests stopped working post 56.03.
Thanks to martinho_ for the texture trick… will give 'er a go.

Rather than use a texture, it’s possible to avoid the problem by using register combiners. I was going to make a path for combiners anyway (for bump mapping), so it’s not that bad.

60.72 still has this bug…

RATS! Does anyone know why this bug has slipped through the last 2 releases? I mean, hey, the constant color is fundamental to fixed function operation.

This bug should be fixed as of the first
official Rel60 release.

Sorry for the trouble,
Eric

seems to be fixed 61.11 :slight_smile: