Latest Nvidia Driver bug!

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

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 tool to verify that your shader matches the GLSL language syntax.

Hi komat!

glslvalidate return successfull!

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

[quote]
The line you presented here does not have correct GLSL syntax.
hum?
[/QUOTE]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.

You have:
…), 1.0);
I guess it should be:
…, 1.0));

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!

What color is shown on the geometry in the new drivers?

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));

chocolate milk color! :slight_smile:

Originally posted by Golgoth:
chocolate milk color! :slight_smile:
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.

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.

btw u can go

gl_FragColor.xyz = …

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?

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.

Originally posted by Golgoth:
[b] Hi all!
<snip>
anyone can confirm this?

thx [/b]
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

Alright thx a lot!

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.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.