ATI, uniform initializers and explicit gradients

Hello,

I found two problems with the current FirePro/FireGL drivers
First, uniform initializers don’t seem to work. I tried something like this:

uniform float u_scale=7.0;  

But it didn’t work as expected. The shader compiles and links, but produced wrong outputs. I needed to set the value manually via glUniformf to get the shader work.

The second problem concerns only FirePro V5700 and V8750 class cards, not V5600 cards, though.
I’m using texture2DLod() and texture2DGradARB() in a shader (GLSL 1.20 with extensions). On V5700 and V8750 I get artifacts at the edges of each triangle; the V5600 ouput looks good.
I did not yet investigate, if texture2DLod() or texture2DGradARB or both go wrong, though.

Can anyone confirm this or has similar problems?

I haven’t had problems with uniform initializers getting set in the actual shader but I’ve had problems querying initial uniform values using both ATI (post) and NVIDIA (post). I suspect not many people use this feature.

Regards,
Patrick

there were some fixes with textureLod and textureGrad functions in the past year. are you using a recent version of the driver ?

I’m using FirePro 8.663 (Nov. 2009) drivers, available from ATI’s website. The OS is WinXP64.

A user is also reporting a problem with uniforms on an ATI card (FWIW it works on nvidia) with latest drivers I think.

Heres the problem


uniform mat4 WS;
uniform float scale;
			
void main(void)								
{	vec4 vert = WS * vec4( gl_Vertex.x*scale, gl_Vertex.y*scale, gl_Vertex.z*scale, gl_Vertex.w );

== crash, but no errors messages when the shader compiles/links

glGetUniformfv(…) shows that scale is getting set correctly to 1.0

if I remove the uniform and use
float scale = 1.0;
then the program runs no problems

Is this a known problem?

Sorry I dont have access to ATI hardware (my next pc will have an ATI card :slight_smile: )

I can send a simple demo app if need be, that shows the issue

Heres the problem

I don’t know, but there seems like there’s something missing from this function. Like a closing brace. Or something that sets gl_Position (required in a vertex shader).

yes, well I though Ild make the sample as east to read as possible


uniform mat4 WS;
uniform float scale;
			
void main(void)								
{	vec4 vert = WS * vec4( gl_Vertex.x*scale, gl_Vertex.y*scale, gl_Vertex.z*scale, gl_Vertex.w );

gl_Position = gl_ModelViewProjectionMatrix * vert;
}
 [/b]
[/b]

uniform mat4 WS;
uniform float scale;
			
void main(void)								
{	vec4 vert = WS * vec4( gl_Vertex.x*scale, gl_Vertex.y*scale, gl_Vertex.z*scale, gl_Vertex.w );

gl_Position = gl_ModelViewProjectionMatrix * vert;
}

btw, Ive posted twice to see which displays better, [ code ] puts a horrible horizontal bar in the box

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