Question about Quartz on MacOS X 10.5+

Hi!

Im porting some application to MacOS X 10.5 using SDL 1.2.14 and I read
in the MacOS X FAQ that Quartz is the video backend to be used. If I
understood well whatever I read, there are the standard Quartz Extreme
and QuartzGL. The latter one is disabled by default and I could enable
it using Quartz Debug but I suppose that by default, SDL is using Quartz
Extreme, it is not? the question is that asking for a SDL_HWSURFACE does
not seem to work as when I got the information about current video mode
or for a given surface (after a DisplayFormat) I got that the surface is
created on system memory and the video backend information tell me that
there is not any kind of hardware acceleration in place.

I read on the FAQ that Quartz is a GPU accelerated thing and that it
creates a buffer where your application write/read and after a Flip, it
performs required steps to blit your single buffer into the real video
buffer simulating a kind of double-buffer. If this is fine, why Am I
only getting software surfaces and the video backend has not hardware
accel. features? Are the surfaces in the video memory but the SDL flags
are confusing me?

Could some one clarify me these question please?

Thanks you very much in advance!
Cheers
Roberto

There are two completely unrelated concepts you are talking about,
Quartz and SDL_HWSURFACE.

Consider SDL_HWSURFACE an anachronism from another time. All it really
means that SDL surfaces are stored in video hardware memory instead of
whatever the operating system prefers (which could be anywhere). In
many (most, all?) modern cases, SDL_HWSURFACE will be slower than
SDL_SWSURFACE assuming you can even get a SDL_HWSURFACE now.

Generally, speaking, you probably should ignore SDL_HWSURFACE and
pretend it doesn’t exist (at least until you know exactly what it does
and how it works).

As for Quartz Extreme vs QuartzGL, both are Apple specific
implementations to try to leverage more of the OpenGL subsystem
directly to increase drawing speeds. Quartz Extreme does simple things
like caching textures and rendering them on quads. QuartzGL is the
more aggressive of the two and tries to find even more ways of
utilizing OpenGL directly. However, there can be tradeoffs using it.
First, it might not render correctly because of bugs. Second, there
are certain types of drawing operations that are slower in
hardware/OpenGL than in software so performance is worse. Long story
short, there where enough of these two cases where Apple couldn’t
enable QuartzGL by default. Apple has since moved on to Core Animation
as a different way to leverage OpenGL drawing directly without making
programmers use OpenGL directly.

Starting in Leopard, there is a per-application flag you can set in
your Info.plist to opt-in to QuartzGL.

Whether you will see a performance boost for your SDL app is something
you will have to benchmark yourself. I personally would be interested
in seeing what kind of results you get since I have no idea what it
will do to/for SDL in general.

However, if you are really concerned about getting OpenGL speed, then
you might consider using OpenGL directly (which SDL lets you do).

-EricOn 12/10/09, Roberto Prieto wrote:

Hi!

Im porting some application to MacOS X 10.5 using SDL 1.2.14 and I read
in the MacOS X FAQ that Quartz is the video backend to be used. If I
understood well whatever I read, there are the standard Quartz Extreme
and QuartzGL. The latter one is disabled by default and I could enable
it using Quartz Debug but I suppose that by default, SDL is using Quartz
Extreme, it is not? the question is that asking for a SDL_HWSURFACE does
not seem to work as when I got the information about current video mode
or for a given surface (after a DisplayFormat) I got that the surface is
created on system memory and the video backend information tell me that
there is not any kind of hardware acceleration in place.

I read on the FAQ that Quartz is a GPU accelerated thing and that it
creates a buffer where your application write/read and after a Flip, it
performs required steps to blit your single buffer into the real video
buffer simulating a kind of double-buffer. If this is fine, why Am I
only getting software surfaces and the video backend has not hardware
accel. features? Are the surfaces in the video memory but the SDL flags
are confusing me?

Could some one clarify me these question please?

E. Wing wrote:> On 12/10/09, Roberto Prieto <@Roberto_Prieto> wrote:

Hi!

Im porting some application to MacOS X 10.5 using SDL 1.2.14 and I read
in the MacOS X FAQ that Quartz is the video backend to be used. If I
understood well whatever I read, there are the standard Quartz Extreme
and QuartzGL. The latter one is disabled by default and I could enable
it using Quartz Debug but I suppose that by default, SDL is using Quartz
Extreme, it is not? the question is that asking for a SDL_HWSURFACE does
not seem to work as when I got the information about current video mode
or for a given surface (after a DisplayFormat) I got that the surface is
created on system memory and the video backend information tell me that
there is not any kind of hardware acceleration in place.

I read on the FAQ that Quartz is a GPU accelerated thing and that it
creates a buffer where your application write/read and after a Flip, it
performs required steps to blit your single buffer into the real video
buffer simulating a kind of double-buffer. If this is fine, why Am I
only getting software surfaces and the video backend has not hardware
accel. features? Are the surfaces in the video memory but the SDL flags
are confusing me?

Could some one clarify me these question please?

There are two completely unrelated concepts you are talking about,
Quartz and SDL_HWSURFACE.

Consider SDL_HWSURFACE an anachronism from another time. All it really
means that SDL surfaces are stored in video hardware memory instead of
whatever the operating system prefers (which could be anywhere). In
many (most, all?) modern cases, SDL_HWSURFACE will be slower than
SDL_SWSURFACE assuming you can even get a SDL_HWSURFACE now.

Generally, speaking, you probably should ignore SDL_HWSURFACE and
pretend it doesn’t exist (at least until you know exactly what it does
and how it works).

As for Quartz Extreme vs QuartzGL, both are Apple specific
implementations to try to leverage more of the OpenGL subsystem
directly to increase drawing speeds. Quartz Extreme does simple things
like caching textures and rendering them on quads. QuartzGL is the
more aggressive of the two and tries to find even more ways of
utilizing OpenGL directly. However, there can be tradeoffs using it.
First, it might not render correctly because of bugs. Second, there
are certain types of drawing operations that are slower in
hardware/OpenGL than in software so performance is worse. Long story
short, there where enough of these two cases where Apple couldn’t
enable QuartzGL by default. Apple has since moved on to Core Animation
as a different way to leverage OpenGL drawing directly without making
programmers use OpenGL directly.

Starting in Leopard, there is a per-application flag you can set in
your Info.plist to opt-in to QuartzGL.

Whether you will see a performance boost for your SDL app is something
you will have to benchmark yourself. I personally would be interested
in seeing what kind of results you get since I have no idea what it
will do to/for SDL in general.

However, if you are really concerned about getting OpenGL speed, then
you might consider using OpenGL directly (which SDL lets you do).

-Eric


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Then, let me change the question… are the SDL blitting operations done
by the CPU or the GPU using default SLD video backend Quartz?

Thanks
Roberto

SDL 1.2 is using the CPU. SDL 1.3 is largely using the GPU.On Fri, Dec 11, 2009 at 10:51 AM, Roberto Prieto wrote:

E. Wing wrote:

On 12/10/09, Roberto Prieto wrote:

Hi!

Im porting some application to MacOS X 10.5 using SDL 1.2.14 and I read
in the MacOS X FAQ that Quartz is the video backend to be used. If I
understood well whatever I read, there are the standard Quartz Extreme
and QuartzGL. The latter one is disabled by default and I could enable
it using Quartz Debug but I suppose that by default, SDL is using Quartz
Extreme, it is not? the question is that asking for a SDL_HWSURFACE does
not seem to work as when I got the information about current video mode
or for a given surface (after a DisplayFormat) I got that the surface is
created on system memory and the video backend information tell me that
there is not any kind of hardware acceleration in place.

I read on the FAQ that Quartz is a GPU accelerated thing and that it
creates a buffer where your application write/read and after a Flip, it
performs required steps to blit your single buffer into the real video
buffer simulating a kind of double-buffer. If this is fine, why Am I
only getting software surfaces and the video backend has not hardware
accel. features? Are the surfaces in the video memory but the SDL flags
are confusing me?

Could some one clarify me these question please?

There are two completely unrelated concepts you are talking about,
Quartz and SDL_HWSURFACE.

Consider SDL_HWSURFACE an anachronism from another time. All it really
means that SDL surfaces are stored in video hardware memory instead of
whatever the operating system prefers (which could be anywhere). In
many (most, all?) modern cases, SDL_HWSURFACE will be slower than
SDL_SWSURFACE assuming you can even get a SDL_HWSURFACE now.

Generally, speaking, you probably should ignore SDL_HWSURFACE and
pretend it doesn’t exist (at least until you know exactly what it does
and how it works).

As for Quartz Extreme vs QuartzGL, both are Apple specific
implementations to try to leverage more of the OpenGL subsystem
directly to increase drawing speeds. Quartz Extreme does simple things
like caching textures and rendering them on quads. QuartzGL is the
more aggressive of the two and tries to find even more ways of
utilizing OpenGL directly. However, there can be tradeoffs using it.
First, it might not render correctly because of bugs. Second, there
are certain types of drawing operations that are slower in
hardware/OpenGL than in software so performance is worse. Long story
short, there where enough of these two cases where Apple couldn’t
enable QuartzGL by default. Apple has since moved on to Core Animation
as a different way to leverage OpenGL drawing directly without making
programmers use OpenGL directly.

Starting in Leopard, there is a per-application flag you can set in
your Info.plist to opt-in to QuartzGL.

Whether you will see a performance boost for your SDL app is something
you will have to benchmark yourself. I personally would be interested
in seeing what kind of results you get since I have no idea what it
will do to/for SDL in general.

However, if you are really concerned about getting OpenGL speed, then
you might consider using OpenGL directly (which SDL lets you do).

-Eric


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Then, let me change the question… are the SDL blitting operations done by
the CPU or the GPU using default SLD video backend Quartz?

Thanks
Roberto


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC