0

I was using this approach to make the background of my OpenGL application transparent (in collaboration with Compiz).

It works perfect but there is one fact I was recognizing: As soon as my application opens the transparent window (no matter if any OpenGL drawing is done), the Xorg process CPU load increases to ~30%.

Can anyone explain this behavior? I was thinking that the Xserver is bypassed by this approach and the whole processing is done by the graphics card?

Community
  • 1
  • 1
chrisg
  • 3
  • 2
  • Does anything change if you disable your compositor? – genpfault May 09 '12 at 15:42
  • 1
    if i disable compositor, the effect won't work at all. i was trying to use metacity with built-in compositing support .. but the performance of it is horrible. but i think i found some indication why this behaviour is caused. my opengl application is a hud animation, i was drawing it at full speed (max fps because there was no timer or sleep). for me, it is enough if the animation gets updated every 20msec, so i added usleep to limit the update speed. now, the cpu load by Xorg is not affected when i start my application! – chrisg May 09 '12 at 16:13

1 Answers1

0

Can anyone explain this behavior? I was thinking that the Xserver is bypassed by this approach and the whole processing is done by the graphics card?

The X server is not circumvented, just other parts of it are used. The thing with compositing is, that the window contents are represented as a X drawable (a pixmap), which the X server manages. In order to composit it, the X server must carry out the transfer into a texture, requested by the compositor. This may cause some management overhead, hence the drop in performance.

Also the code of most the compositors out there is horrible (its like the people who wrote Compiz/Metacity/KWin have no idea at all how OpenGL and GPUs works). This is one of the projects I have in my TODO list (writing a decent compositor, that's not lobotomized).

datenwolf
  • 159,371
  • 13
  • 185
  • 298
  • thank you for your response, this adds a proper picture of the behaviour. i wasn't looking at the code of metacity yet, but what you describe concerning OpelGl skills is likely to be true. if there's any progress on your compositor version, i would be very happy if you keep me updated! greetings from muc! microdevel@googlemail.com – chrisg May 10 '12 at 10:33