PDA

View Full Version : Latest Nvidia Driver bug!



Golgoth
08-09-2006, 12:57 PM
Hi all!

I ve just updated Nvidia gforce 7800 driver from 84.21 to 91.31 and sampler2d doesn’t seams to work anymore:

gl_FragColor = vec4(texture2D(u_ColorMap, gl_TexCoord[0].xy), 1.0);

evrything compile fine, it is just not showing any texture so far…

anyone can confirm this?

thx

Komat
08-09-2006, 01:37 PM
Are you sure that the program compiled without any errors? The line you presented here does not have correct GLSL syntax. Older nVidia drivers were very forgiving to incorrectly written programs and it is possible that the compiler in the new version is more strict. Use GLSLValidate (http://developer.3dlabs.com/downloads/glslvalidate/index.htm) tool to verify that your shader matches the GLSL language syntax.

Golgoth
08-09-2006, 01:45 PM
Hi komat!

glslvalidate return successfull!



The line you presented here does not have correct GLSL syntax.hum?

Komat
08-09-2006, 02:05 PM
The line you presented here does not have correct GLSL syntax.hum? When I pasted line from your post into fragment shader with corresponding sampler and run glsl validator on it, I got "ERROR: 0:5: 'constructor' : too many arguments" on that line.

k_szczech
08-09-2006, 02:19 PM
You have:
...), 1.0);
I guess it should be:
..., 1.0));

Golgoth
08-09-2006, 02:31 PM
ya im sorry i forgot a detail in the example a provided...

gl_FragColor = vec4(texture2D(u_ColorMap, gl_TexCoord[0].xy).rgb, 1.0);

but my shader was correct. there is something going on with the new driver that glslvalidate cant catch up... i revert to the old driver and it works fine... weird!

Komat
08-09-2006, 02:35 PM
What color is shown on the geometry in the new drivers?

zeoverlord
08-09-2006, 02:38 PM
No the default return of texture2D is vec4, so you have effectivly defined a vec5 inside a vec4 (and vec5 does not exist).

so try either
gl_FragColor = vec4(texture2D(u_ColorMap, gl_TexCoord[0].xy).rgb, 1.0);
or
gl_FragColor = vec4(texture2D(u_ColorMap, gl_TexCoord[0].xy));

Golgoth
08-09-2006, 02:39 PM
chocolate milk color! :)

Komat
08-09-2006, 02:42 PM
Originally posted by Golgoth:
chocolate milk color! :) Is that color accidentaly somewhere inside your texture? It is possible that the fragment shader works correctly and failure is within the vertex shader feeding it with texture coordinates.

Golgoth
08-09-2006, 02:51 PM
It look like so indeed... It must be the texture coordinates, even though the vertex shader compiled successfully under the new driver, there is definitely a difference between the new version... I ll investigate more on this and I ll keep you posted...

thx guys.

zed
08-10-2006, 01:32 AM
btw u can go

gl_FragColor.xyz = .....

Golgoth
08-10-2006, 10:30 AM
Hi Zed,

I m not 100% sure, but I think I read a while ago in the orange book that glsl was optimized for vec4 and it was somehow better to use vec4 then vec3...

subject aside... what is the gl_FragColor.a for? At first I thought it will be use for vertex transparency… like vertex color alpha + blend state would work with ffp… any idea how vertex transparency is this accomplish in glsl?

Relic
08-10-2006, 10:35 AM
gl_FragColor.a is, uhm, the fragment color's alpha.
The fragment shader does not replace alpha test and alpha blend. See GLSL spec chapter 2.2.
The alpha value you write is just used for that, or just written into an existing destination alpha buffer you can use to your liking.

pocketmoon
08-10-2006, 12:38 PM
Originally posted by Golgoth:
Hi all!
<snip>
anyone can confirm this?

thx Yes! Well sort of... . Vertex texture fetch (GLSL) wasn't working for me (black black black!) so after a couple of late nights I started rolling back driver versions. Started at 91.28 got to 84.34 (iirc) and it started working.

I've logged a bug with Nv and mentioned it on the dev forums.

Cheers

Rob

Golgoth
08-10-2006, 01:10 PM
Alright thx a lot!

Humus
08-10-2006, 01:47 PM
Originally posted by Golgoth:
I m not 100% sure, but I think I read a while ago in the orange book that glsl was optimized for vec4 and it was somehow better to use vec4 then vec3...Not true. If you have something with three components, then don't use a vec4. And certainly don't use vec4 for scalars. ATI hardware can do a vec3 and a scalar in parallel, so if you can leave that scalar pipe free that may allow some other computation in the shader to run in parallel with it.