Gaussian blur, software fallback on GMA950
I've got a pretty trivial shader that falls back to software rendering:
This one falls back when I accumulate the brightnesses - I can add the first three terms, but the fourth causes fallback. It does suggest that I'm breaking the max instruction limit, but it does seem as a pretty low limit in that case? Does it seem like an explanation anyway?
Code:
uniform sampler2D bloomTexture;
void main ()
{
const float halfPixel = 0.5 / 256.0;
const vec2 left = vec2 (-1.0/256.0 + halfPixel, 0.0);
const vec2 right = vec2 (1.0/256.0 + halfPixel, 0.0);
const vec2 up = vec2 (0.0, -1.0/256.0 + halfPixel);
const vec2 down = vec2 (0.0, 1.0/256.0 + halfPixel);
float brightness0 = texture2D (bloomTexture, gl_TexCoord[0].st + right).a;
float brightness1 = texture2D (bloomTexture, gl_TexCoord[0].st + left).a;
float brightness2 = texture2D (bloomTexture, gl_TexCoord[0].st).a * 2.0;
float brightness3 = texture2D (bloomTexture, gl_TexCoord[0].st + up).a;
float brightness4 = texture2D (bloomTexture, gl_TexCoord[0].st + down).a;
float a = (brightness0 + brightness1 + brightness2 + brightness3 + brightness4) / 6.0;
gl_FragColor = vec4(vec3(1,1,1), a);
}This one falls back when I accumulate the brightnesses - I can add the first three terms, but the fourth causes fallback. It does suggest that I'm breaking the max instruction limit, but it does seem as a pretty low limit in that case? Does it seem like an explanation anyway?
Could you possibly be exceeding the maximum number of dependent texture reads? Or MAX_PROGRAM_TEX_INDIRECTIONS_ARB of 4? Just some ideas.
-Jon
-Jon
I know Reubert was having problems yesterday with a shader on the GMA 950 that did four texture reads, and his final solution was to have it do 3.
I know theoretically many more than four should work, but perhaps there is a bug in the driver...
In your case you could also be breaking the eight temporaries limit. You can try reordering the shader (which shouldn't matter, but might) and you can try writing an equivalent ARBfp program (to see whether it's a hardware issue or a GLSL compiler issue).
I know theoretically many more than four should work, but perhaps there is a bug in the driver...
In your case you could also be breaking the eight temporaries limit. You can try reordering the shader (which shouldn't matter, but might) and you can try writing an equivalent ARBfp program (to see whether it's a hardware issue or a GLSL compiler issue).
...or, since this most likely only affects the crap GMA950 in my MacBook, just silently kill the bloom effect if it can't run in hardware. Thanks for the insight though, but I'm nearing some sort of deadline and really can't be bothered with this kind of feature creep.
I see a divide by 6. Is that suppose to be a divide by 5? Its an average. Unless, there is a zero term in there.
I think this is a good bloom tutorial.
http://prideout.net/bloom/index.html
I think this is a good bloom tutorial.
http://prideout.net/bloom/index.html
There definitely seems to be something wrong with the driver as I did find that 3 was the limit. I'm not sure about texture dependencies or indirects, or exactly what that means, but your shader looks a lot like mine. ie. calculate some tex coords, do some lookups, do some math, spit out a color. It's not like any texture lookup depends on any previous lookup or anything like that.
Chopper, iSight Screensavers, DuckDuckDuck: http://majicjungle.com
To remove the texture indirections, you can modify all of the texture coordinates up in the vertex shader and pass texcoords for non-dependent reads down in several varyings.
Please file a radar on this issue as well. A max of 3 seems a bit low.
Please file a radar on this issue as well. A max of 3 seems a bit low.
macnib Wrote:I see a divide by 6. Is that suppose to be a divide by 5? Its an average. Unless, there is a zero term in there.
i see 6 values, the center is twice.
Frogblast Wrote:To remove the texture indirections, you can modify all of the texture coordinates up in the vertex shader and pass texcoords for non-dependent reads down in several varyings.
Unfortunately this made no difference, no matter what I do I am limited to 3 reads.
I believe in my case it may be to do with FBOs. I am both reading from an FBO and writing to an FBO.
Chopper, iSight Screensavers, DuckDuckDuck: http://majicjungle.com
I did try Frogblasts' suggestion too, and no improvement. I've filed a radar on it, which got upclassed from "Performance issue" (my submission) to "Serious bug", which might be a good indication.
Cool, good effort Fenris. I must figure out how to file radars one day.
Chopper, iSight Screensavers, DuckDuckDuck: http://majicjungle.com
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Gaussian blur | g00se | 0 | 1,893 |
Oct 3, 2011 12:58 PM Last Post: g00se |
|
| fbo causes software fallback? | aBabyRabbit | 5 | 3,801 |
Apr 5, 2008 12:00 AM Last Post: aBabyRabbit |
|
| GLSL fragment program limits on GMA950 (MacBook) | memon | 12 | 7,950 |
Oct 26, 2007 05:18 PM Last Post: arekkusu |
|
| Tell me about separable gaussian convolutions... | TomorrowPlusX | 11 | 5,240 |
Jul 17, 2006 03:48 PM Last Post: Jones |
|
| openGL blur | kelvin | 7 | 6,285 |
Mar 10, 2003 06:34 PM Last Post: Tycho |
|

