PDA

View Full Version : GL_CONSTANT bug in 56.64?



hh10k
03-31-2004, 11:51 PM
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.

Hampel
04-05-2004, 11:21 PM
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...

evanGLizr
04-06-2004, 09:45 AM
Originally posted by Hampel:
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...It's probably due to the way GeForce FX uses constants. If you look at the NVIDIA hardware Siggraph 2002 presentation (http://developer.nvidia.com/object/IO_20020721_4874.html) 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.

SeskaPeel
04-08-2004, 12:41 AM
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.

martinho_
04-08-2004, 01:10 PM
The same hapened to me. I just use a 1x1 texture in another texture unit to workarround it.

plasmonster
04-10-2004, 11:43 AM
Dito here. My tests stopped working post 56.03.
Thanks to martinho_ for the texture trick... will give 'er a go.

hh10k
04-10-2004, 11:57 PM
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.

Hampel
04-15-2004, 08:31 PM
60.72 still has this bug...

plasmonster
04-15-2004, 08:33 PM
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.

esw
04-19-2004, 08:29 AM
This bug should be fixed as of the first
official Rel60 release.

Sorry for the trouble,
Eric

Hampel
05-13-2004, 10:09 PM
seems to be fixed 61.11 :)