Shader running in software when it says it is running in hardware

What could be the cause of a shader running in software when it says in the link log that it will run in hardware.

I have tried creating the simplest possible shader and rendering a small quad with it kills the framerate.

Here is my shader:

// Vertex shader
void main()
{
	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}

// Fragment shader
void main()
{
	gl_FragColor[0] = 1.0;
	gl_FragColor[1] = 0.0;
	gl_FragColor[2] = 1.0;
	gl_FragColor[3] = 1.0;
}

and here is how I use it

	glUseProgramObjectARB(simpleShader);
	glBegin(GL_QUADS);
	glColor4fv(color);
	glVertex2f(vertices.m_min.x, vertices.m_min.y);
	glVertex2f(vertices.m_max.x, vertices.m_min.y);
	glVertex2f(vertices.m_max.x, vertices.m_max.y);
	glVertex2f(vertices.m_min.x, vertices.m_max.y);
	glEnd();
	glUseProgramObjectARB(0);

The shader initialises with no errors and says it will run in hardware. It does render correctly with no glErrors, but it is running in software.

I am running this on my laptop which has an FireGL T2 card, this shouldnt be a problem though as it runs every glsl demo I have tried.

How do you know it is running on the cpu side ?

I dont know for sure that it is (is there a reliable way to check this?), but drawing a fullscreen quad without the shader runs at 100+fps, whereas drawing it with the shader causes it to run at 1-2fps.

I am assuming that this is because of the software renderer kicking in.

If the demos run well, then it really looks strange. Can you post your full code ?
Also for gl_FragColor I use gl_FragColor = vec4 (1,0,1,1) as it’s not an array. Maybe it’s simply that or another thing people here might discover when seeing your code. But like that I’m almost sure very few people could give the solution like that.

sorry, I cant post my code. I’m just going through it all now stripping everything out to be sure I havent missed anything obvious.

I just wondered if there is something I should look out for that could cause this.

I tried your gl_FragColor suggestion but it didnt fix it.

Thanks for your help

One thing I have just noticed is that glCreateProgramObjectARB() returns -2147483647.

I take it that this is not a normal return value?
Does anyone know what could cause this?

That looks like a normal value actually. At least if you’re using GLSL extension rather than GL2.

I found the cause of the problem.

I enable GL_LINE_SMOOTH at the start of my program, and for some reason this cripples the rendering of any primitive with a shader.

It was no problem to just enable and disable LINE_SMOOTH around my line rendering and the problem goes away.

I am running the latest IBM drivers on my T41p, I think they are based on the first set of ATI drivers that supported GL 2.0 (I’ve been waiting for them to update them with ATI’s latest drivers that support FBO’s).

Thanks everyone for your help.

GL2 on ATI returns large values. It’s not like glGenTextures.

I think line smooth and point smooth cause this problem.

Originally posted by killerseven:
[b]I found the cause of the problem.

I enable GL_LINE_SMOOTH at the start of my program, and for some reason this cripples the rendering of any primitive with a shader.

It was no problem to just enable and disable LINE_SMOOTH around my line rendering and the problem goes away.

I am running the latest IBM drivers on my T41p, I think they are based on the first set of ATI drivers that supported GL 2.0 (I’ve been waiting for them to update them with ATI’s latest drivers that support FBO’s).

Thanks everyone for your help.[/b]
I don’t have a FireGL card, but what drivers does that card use? Catalyst? I am not sure on this but you can try it or look into it, http://www.driverheaven.net/ and look around for the mod tool to make the newest drivers work with your laptop without waiting for IBM. HTH

The Fire GL does use the catalyst drivers, and I have tried using the hacked (non-IBM) ones before, but they messed up my power management so I stick to the official drivers now.

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