cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

JVertrees
Journeyman III

Strange behavior from shaders

When rendering on ATI w/Linux we get strange behavior from the shaders

Greetings,

We're using GLSL 1.20 across multiple platforms. Currently we have strange behavior on Linux (OpenSuse 11.4) with an ATI FirePro v8800 using the ATI drivers (v8.892: fglrx64_xpic_SUSE114-8.892-1.x86_64).

Some variables are being wiped out in the fragment shader and our objects are  not rendering correctly. Oddly, if we write:

// sphere.fs code here...

gl_FragColor = color;

vec4 final_color = gl_LightModel.ambient * color;

// more sphere.fs code here...

we get the solidly colored objects, which is ok in this part of the shader; however if we swap the two lines:

 

 

// code here...

vec4 final_color = gl_LightModel.ambient * color;

 

gl_FragColor = color;

// code here...

nothing shows up--the color varible has lost its data. As you can see "color" is never on the left hand side, but is somehow being modified.
Another strange thing we see is in the vertex shader. We try to set a varying ("color") from an attribute ("a_Color"). If I put the following at the _top_ of main:
color = a_Color;
then the (varying) color is not set from the (attribute) a_Color and (varying) color is blank in the fragment shader. But, if I move
color = a_Color;
to the bottom of the vertex shader, we do get small points that appear, indicating that there's a difference between where we put these statemets. Nowhere else in the shaders are 'color' and 'a_Color' ever on the left hand side of a statement.
The info logs for compiling and linking all return successfully:

* Vertex shader was successfully compiled to run on hardware.

* Fragment shader was successfully compiled to run on hardware.

* Vertex shader(s) linked, fragment shader(s) linked.

AMD's GPU Analyzer created assembly for both shaders, so they compiled and linked fine.

GL Info:

 

 Detected GLSL version 4.10.

 OpenGL graphics engine:

  GL_VENDOR: ATI Technologies Inc.

  GL_RENDERER: ATI FirePro V8800 (FireGL) Graphics Adapter

  GL_VERSION: 4.1.11079 Compatibility Profile Context FireGL

 

Our release cannot go forward until we fix these issues. We appreciate any help we can get.

Cheers,

-- Jason



0 Likes
3 Replies
gsellers
Staff

Hi,

We'll look into this. Is there any way that we can get hold of more complete examples - perhaps a shader that compiles correctly and one that does not? I don't think we'd need the full application at this point.

Thanks,

Graham

0 Likes

Happy to send the shaders.  

I sent you a PM.

Thanks,

-- Jason

0 Likes

Just an update in case someone else runs into this.

With the help of some of the good folks at AMD I found the bug. The Radeon FirePro v8800 on my Linux box using (at least the last two drivers: 8.85.7.1 and 8.85.7.2) apparently do not like writing to gl_FogFragCoord in the vertex shader. So, I just made the fog coordinate a varying and passed it along to the fragment shader.

Cheers,

-- Jason

0 Likes