Pipeline stall

Started by
2 comments, last by gOOze 13 years ago
Hi

Something very strange came up in my code for HDR rendering.

The fact to enable blending (via the application using glEnable(GL_BLEND) as well as via the CGFX pass state definition BlendEnable = true ), makes the whole program to stop for several seconds on the CG commands cgResetPassState and/or cgSetPassState.
That makes my program run at 0.05 fps instead of 60!!
I need to enable blending in order to blend the blurred targets to produce a blooming effect in my scene.

Does anyone have any idea what causes the pipeline to stall like that?

Thanks
Advertisement
You call glEnable(GL_BLEND) and the FPS goes down to 0.05? How many objects/polygons are you rendering with blending enabled?
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
That's not just a pipeline stall, that's a drop back to software emulation in either the fragment processing or blending stage of the pipeline. You're obviously doing something that's supported by your driver but not in hardware. Can you double-check your glBlendFunc and glBlendEquation, and make sure that you don't have too many shader instructions.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

Thanks for your answers.

@V-man : I use additive blending in order to merge my blurred targets to get a blooming effect, this step being purely screen-space, I just draw basic fullscreen quads. The number of objects shouldn't be a problem here :)

@mhagain : I haven't thought about the software emulation, that would explain why this is sooooo slow.

I double checked everything and I actually found the cause. I declared my downsampled HDR render targets as [color=#1C2837][size=2]GL_RGBA16 instead of GL_RGBA16F_ARB... stupid mistake...
[color=#1C2837][size=2]I thought GL_RGBA16 targets were internally represented as RGBA8 targets, so that would obviously mess up my blooming effect but I don't really see why my hardware complained about blending 2 [color=#1C2837][size=2]RGBA16 targets together dry.gif

Thanks again!

This topic is closed to new replies.

Advertisement