GNOME Bugzilla – Bug 659302
windowManager: Temporarily disable window dimming
Last modified: 2011-09-24 21:35:16 UTC
The way the window dimmer shader is written doesn't like the rounded corners or invisible borders, since it doesn't deal well with the multitexturing used by the MetaShapedTexture. Since it is a rather subtle effect, and it causes major graphical glitches, temporarily disable it for 3.2 until it can be fixed.
Created attachment 196790 [details] [review] windowManager: Temporarily disable window dimming
Review of attachment 196790 [details] [review]: We probably should just port it to ClutterShaderEffect (which deals with the multitexturing by redirecting it to an FBO). FBOs are relatively expensive but normally we don't end up dealing with 10 or more attached dialogs at a time.
Created attachment 196818 [details] [review] windowManager: Use an off-screen buffer for window dimming The way the window dimmer shader is written doesn't like the rounded corners or invisible borders, since it doesn't deal well with the multitexturing used by the MetaShapedTexture. Use an off-screen buffer to flatten the texture before being applied. -- Alternate solution, using an off-screen buffer. Doesn't work, appears to be a cogl bug: <magcius> drago01, (lt-gnome-shell-real:16452): Cogl-WARNING **: ./cogl-buffer.c:359: GL error (1282): Invalid operation <magcius> brillant <drago01> huh? <magcius> drago01, see any problems in http://fpaste.org/Id3D/ ? <drago01> magcius: non that would obviusly cause a gl error ... <magcius> I would love to know what invalid operation I'm doing. <drago01> hmm ... try commenting out the set_uniform_value calls * drago01 checks what cogl does in cogl-buffer.c:359 <magcius> GE( ctx, glBindBuffer (gl_target, buffer->gl_handle) ); <drago01> magcius: "GL_INVALID_OPERATION is generated if glBindBuffer is executed between the execution of glBegin and the corresponding execution of glEnd." <drago01> magcius: http://www.opengl.org/sdk/docs/man/xhtml/glBindBuffer.xml <drago01> magcius: can't see how this would be your fault <drago01> magcius: looks like a cogl bug
Review of attachment 196790 [details] [review]: We can do better than that.
(In reply to comment #3) > Created an attachment (id=196818) [details] [review] > windowManager: Use an off-screen buffer for window dimming > > The way the window dimmer shader is written doesn't like the rounded corners or > invisible borders, since it doesn't deal well with the multitexturing used by > the MetaShapedTexture. Use an off-screen buffer to flatten the texture before > being applied. > > > > -- > > Alternate solution, using an off-screen buffer. Doesn't work, appears to be a > cogl bug: > > <magcius> drago01, (lt-gnome-shell-real:16452): Cogl-WARNING **: > ./cogl-buffer.c:359: GL error (1282): Invalid operation > <magcius> brillant > <drago01> huh? > <magcius> drago01, see any problems in http://fpaste.org/Id3D/ ? > <drago01> magcius: non that would obviusly cause a gl error ... > <magcius> I would love to know what invalid operation I'm doing. > <drago01> hmm ... try commenting out the set_uniform_value calls > * drago01 checks what cogl does in cogl-buffer.c:359 > <magcius> GE( ctx, glBindBuffer (gl_target, buffer->gl_handle) ); > <drago01> magcius: "GL_INVALID_OPERATION is generated if glBindBuffer is > executed between the execution of glBegin and the corresponding execution of > glEnd." > <drago01> magcius: http://www.opengl.org/sdk/docs/man/xhtml/glBindBuffer.xml > <drago01> magcius: can't see how this would be your fault > <drago01> magcius: looks like a cogl bug That turned out to height being sent as int rather then float to the shader.
Created attachment 196825 [details] [review] windowManager: Use an off-screen buffer for window dimming The way the window dimmer shader is written doesn't like the rounded corners or invisible borders, since it doesn't deal well with the multitexturing used by the MetaShapedTexture. Use an off-screen buffer to flatten the texture before being applied. A bit hacky, but it works.
Created attachment 196826 [details] [review] windowManager: Incorporate invisible borders into window dimming effect Without this, the dim "fade" will start at the top of the untrimmed actor. With a large enough draggable_border_width setting, this will show no fade at all.
Created attachment 196892 [details] [review] windowManager: Use an off-screen buffer for window dimming The way the window dimmer shader is written doesn't like the rounded corners or invisible borders, since it doesn't deal well with the multitexturing used by the MetaShapedTexture. Use an off-screen buffer to flatten the texture before being applied. Here's something a little less hacky.
Created attachment 196893 [details] [review] windowManager: Incorporate invisible borders into window dimming effect Without this, the dim "fade" will start at the top of the untrimmed actor. With a large enough draggable_border_width setting, this will show no fade at all.
Review of attachment 196892 [details] [review]: Looks good to me. Should be fine to commit with the comment added (assuming no objections from Owen). ::: src/shell-util.c @@ +853,3 @@ + +void +shell_shader_effect_set_double_uniform (ClutterShaderEffect *effect, Add a comment explaining why we need this.
Review of attachment 196893 [details] [review]: Looks good, comment needs to be update to reflect your changes. (Fine to commit with that fixed). ::: data/shaders/dim-window.glsl @@ +23,3 @@ // when the fraction is 1.0. For other locations and fractions we linearly // interpolate back to the original undimmed color. + cogl_color_out = color + (cogl_color_out - color) * max(min((y - startY) / border_max_height, 1.0), 0.0); Adjust to comment to explain this as well.
(In reply to comment #3) > Created an attachment (id=196818) [details] [review] > windowManager: Use an off-screen buffer for window dimming > > The way the window dimmer shader is written doesn't like the rounded corners or "doesn't like" is a bad description. What actually happens? "triggers an assertion"? "Corrupts the state?" etc. Add to the commit message something more descriptive, please. And preferably a link to a cogl bug or whoever is at fault.
(In reply to comment #12) > (In reply to comment #3) > > Add to the commit message something more descriptive, please. And preferably a > link to a cogl bug or whoever is at fault. There is no cogl bug. The problem is that ClutterShader only operates on a single texture, which is no longer sufficient due to the invisible borders. So it redirects everything to an FBO and applies the shader on that (using ClutterShaderEffect). So when we just pass the texture to it we get wrong rendering. As for the commit message yeah should probably be improved.
Review of attachment 196892 [details] [review]: Marking as needs-work due to Colin's comment re commit message.
Created attachment 196950 [details] [review] windowManager: Use an off-screen buffer for window dimming The way the window dimmer shader is written will cause rendering errors with the rounded corners, invisible borders or shaped textures since it doesn't deal well with the multitexturing used by the MetaShapedTexture. Use an off-screen buffer to flatten the texture before being applied.
Created attachment 196951 [details] [review] windowManager: Incorporate invisible borders into window dimming effect Without this, the dim "fade" will start at the top of the untrimmed actor. With a large enough draggable_border_width setting, this will show no fade at all. Is this better?
Attachment 196950 [details] pushed as 82eccb5 - windowManager: Use an off-screen buffer for window dimming Attachment 196951 [details] pushed as 127ef83 - windowManager: Incorporate invisible borders into window dimming effect
*** Bug 660026 has been marked as a duplicate of this bug. ***