🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

GLSL bug in NVidia driver

Started by
5 comments, last by SirKnight 17 years, 5 months ago
I just found a bug, that took me many hours to find: The nvidia opengl driver doesnt work under those circumstances: - u use a german linux. (LANG=UTF8_DE... or something) - you have constant float values in your shader. (e.g. 0.5, 1.0 works) then you get this error when linking vertex and pixel shader:

Fragment info
-------------
Internal error: assembly compile error for fragment shader at offset 828:
-- error message --
line 24, column 27:  error: expected '}'
-- internal assembly text --
!!ARBfp1.0
OPTION NV_fragment_program2;
# cgc version 1.6.0011, build date Dec 15 2006 10:27:43
# command line args:
#vendor NVIDIA Corporation
#version 1.6.0.11
#profile fp40
#program main
#semantic DiffuseMap
#semantic BumpMap
#var float4 gl_TexCoord[0] : $vin.TEX0 : TEX0 : -1 : 1
#var float4 gl_TexCoord[1] :  :  : -1 : 0
#var float4 gl_TexCoord[2] :  :  : -1 : 0
#var float4 gl_TexCoord[3] :  :  : -1 : 0
#var float4 gl_TexCoord[4] :  :  : -1 : 0
#var float4 gl_TexCoord[5] :  :  : -1 : 0
#var float4 gl_TexCoord[6] :  :  : -1 : 0
#var float4 gl_TexCoord[7] :  :  : -1 : 0
#var float4 gl_FragColor : $vout.COLOR : COL : -1 : 1
#var sampler2D DiffuseMap :  : texunit 0 : -1 : 1
#var sampler2D BumpMap :  : texunit 1 : -1 : 1
#var float3 toLight : $vin.TEX1 : TEX1 : -1 : 1
#const c[0] = 1 0,5 2 0
PARAM c[1] = { { 1, 0,5, 2, 0 } };
TEMP R0;
TEMP R1;
TEMP RC;
TEMP HC;
OUTPUT oCol = result.color;
DP3R  R0.x, fragment.texcoord[1], fragment.texcoord[1];
RSQR  R0.w, R0.x;
MULR  R1.xyz, R0.w, fragment.texcoord[1];
TEX   R0.xyz, fragment.texcoord[0], texture[1], 2D;
ADDR  R0.xyz, R0, -c[0].y;
MULR  R0.xyz, R0, R1;
DP3R  R0.x, R0, c[0].z;
MAXR  R1.xyz, R0.x, c[0].w;
TEX   R0.xyz, fragment.texcoord[0], texture[0], 2D;
MOVR  R1.w, c[0].x;
MOVR  R0.w, c[0].x;
MULR  oCol, R1, R0;
END
# 12 instructions, 2 R-regs, 0 H-regs
The problem is here:

PARAM c[1] = { { 1, 0,5, 2, 0 } };
The GLSL compiler outputs "," instead of "." when converting floats to strings, when language is german. A workaround is to type "export LANG=C" before launching the program. Can someone confirm this? Anyway, I want to warn all germans here about that wierd problem.:) Edit: The command line cgc compiler might have the same problem.
Advertisement
Did you report the bug to nVidia?

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

I reported this to the Cg compiler team. They'll know what to do. :)
I didnt submit it because i dont know how.

Thanks to SirKnight!

Is there a page or mailing list for bugs?
Ok turns out this is a known bug.

Basically the POSIX "internationalization" is quite broken which means that you can't portably use the C stdlib for many things, particulary if you want to be multithread-safe.
Quote: Original post by cody
I didnt submit it because i dont know how.

Thanks to SirKnight!

Is there a page or mailing list for bugs?


I believe the only way to access the bug database is to become a registered developer. http://developer.nvidia.com/page/registered_developer_program.html

Our support page is located here: http://www.nvidia.com/page/support.html


Thanks.
Just wanted to let you (well everyone) know that this comma vs period bug has been fixed. The next Cg release will have the fix.


Thanks.

This topic is closed to new replies.

Advertisement