I just got my new GeForce 6800 GT. I tried to compile some GLSL code on it and for some reason the code will not compile. The GLSL compiler returns an error :“Profile doesn’t support conditional returns.” and all of this is because I have a “return;” executed after an “if” statement as part of the statement success.
The strange thing is, this GLSL code compiled fine on my old Radeon 9800 PRO. Heck, I still have the 9800 PRO on my computer desk, since i have just installed my new GeForce.
Now, is this a compiler bug ? driver bug ? or should I be placing something in the GLSL header to allow for a modified profile, but if so, wouldn’t that be incompatible with ATI’s implementation, and shouldn’t GLSL run on all supporting hardware without any modifications ?
I am confused ? any ideas ?
Well, I removed the “return” statement so that the code would compile and made a simple modification so that the program would have the same effect after removal of the “return” statment. and to my surprise, the GLSL code does absolutely nothing. nada, total darkness is on my screen. Now this extremely simple GLSL code used to run well on my Radeon 9800 PRO, but for some reason, the 6800 GT prefers to produce a blank screen … humm !!!.
I have also went over the GLSL spec, there is nothing in there that say a return statement can’t be placed in an “if” statement result.
So, my question now is, Does the 6800 GT support GLSL ?
Shader Model 3.0 support for GLSL is still under development in the NVIDIA drivers. Search for an unofficial 70+ driver for conditional return and looping support.
Ok. Here is what I found out through debugging. And I may be wrong. It seems that NVidia’s GLSL compiler converts GLSL into vertex program and shader program assembly first and then compiles them … so it doesn’t compile from GLSL to shader code directly. I did manage to get an VP & FP assembly of my shader in the debug error result.
So GLSL is not supported natively, but it supported via converting it to vertex and fragment programs first.
Now, I may be wrong, but this is the only way i can explain the statement about the profile error and the VP, FP debug code that i code in the error code … i mean, I didn’t write those VPs & FPs.
As for the shader causing the error her it is, it is very simple:
</font><blockquote><font size=“1” face=“Verdana, Arial”>code:</font><hr /><pre style=“font-size:x-small; font-family: monospace;”>uniform sampler2D ColorTexture; // color texture
uniform vec4 Selected; // rgb color in xyz members, alpha = 1 -> draw rectangle
Ok. After a long night spent at debugging, here is what i found.
NVidia doesn’t have full/native GLSL support as they claim. It turns out that they take the GLSL code and convert that to VP & FP with NVidia’s extensions, the resulting code is then compiled and if any error messages are generated, they are reported as they are, without translating them into GLSL slang.
Actually, a lot of error messages are due to the limitations of the VP & FP and not a real GLSL error.
There are also some stability issues where it comes to uniforms. Sometimes it works and sometimes it doesn’t, depending on how many unforms you have. GLSL may allow it while the VP & FP may not allow it since they have different limitations from GLSL.
Well, i think that I will unplug my new 6800 GT and put my 9800 PRO back in, since it works better with GLSL.
Strange thing is, NVidia always had better drivers than ATI’s. So when I got the 6800 GT, I was pretty sure that it would work even better than ATI’s … Sadly this is not the case.
It seems that NVidia is still recovering from the mess it has, ever since the 5800 fiasco. yup, it seems they took a nose dive eversince that 5800 showed up.
anyways, thanks for your help.
I don’t want to start flaming, but Im using GLSL on FX5900 and 6800GT WITHOUT any problems. Even more, using NVEmulate (get it from nv developer page) I can check AMS output of my GLSL code.
Please, upload your code somewhere on net and give a link, so I can check whats going on with it!
ok, so they say that branching based on uniforms is not allowed in the fragment shader … now, this is confusing to me since i thought that branching was allowed in SM3.0 … and also, why was ATI allowing it in their SM2.0 ?
The current GLSL implementation in public NVIDIA drivers doesn’t support branching based on uniform drivers. Our Release 65 drivers will have full support for static and dynamic branching in the fragment shader as well as other Shader Model 3.0 features such as texture lookups in the vertex shader.
Originally posted by selwakad: any ideas why the code keeps getting truncated ?
I suppose it’s a forum app bug!
I have similar problems few days ago. I think that problem is in some combination of / in code comment’s.