The performance hit is inevitable because there are effectively extra layers of
buffering for every single frame.
With the old-style pre-compiz way of doing things, there are a number of
functions internal to the graphics card which handle 2D operations including
fast drawing of basic primitives (rectangles and lines) and replacing a frame on
the screen is a simple matter of replacing a rectangular region from a
backbuffer with a simple bitstream. As much as this buffer may have to be
formatted and byte-aligned, it’s still just a transfer of data from one memory
space to another. It’s been this way since at least the '90s.
When using something like Compiz/Aero/Quartz, all the old 2D functonality is no
longer accessible and everything has to be done with textures so the new frame
has to be sent to the graphics card to be converted to a texture which is then
used to overwrite a texture which is linked to a plane. It’s not quite as simple
a process. Add to this all the stuff being done in the background to have all
those effects that compiz provides and this uses resources that just aren’t
being used without it. Then there’s the mipmapping conversion if you have that
switched on for the fancy cube effect which means your image is being copied and
resized several time on every single new frame.
Of course, the extra resource use also means there’s a performance hit for 3D
games as well, and not just because they have to go through an extra layer of
rendering to texture rather than accessing the screen directly. For every single
frame on screen of a windowed game, the entire context has to be switched out to
render the game frame to a texture, then render the compiz desktop with that
texture. It’s still a fairly hefty performance impact.
Hope this answers some of your questions.
Regards, Paul> ----- Original Message -----
From: jerlark386@gmail.com (Jeremiah)
To: SDL Development List
Sent: Wed, 18 August, 2010 22:26:40
Subject: Re: [SDL] 2D game performance issue when compiz is enabled
I’m confused as well about the lower 2D performance. 3D acceleration
interfering with 2D acceleration?
Unless this has something to do with Xrender. I wonder if Xrender is
optional in SDL?
If so, the solution maybe to detect loss in FPS and disable Xrender.
Falling back to the old style.
On Wed, Aug 18, 2010 at 9:39 AM, Torsten Giebl wrote:
Hello !
I’m developing a 2D game on linux which have a win32 port (with mingw.)
Lately I got a new faster computer and upgraded to ubuntu lucid. I got
now
compiz working fine but my game is just running much slower, unless I
disable compiz. I think this relates to compiz using opengl and hardware
acceleration. So I’m looking for a way to have the game running at normal
speed but without disabling compiz. Until now, I’ve been unable to
fix the problem. Does anyone have a clue about what’s going on?
Compiz has an option to unredirect fullscreen apps, so it’s best to run
games in fullscreen mode.
Furthermore, KDE suspends compositing completely for fullscreen apps by
default.
But i don’t understand what the real reason for
the slow down is. Gfx cards have accelerated blits from
the system memory to the video memory.
Is this something that can be fixed with the Xorg drivers ?
CU
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org