PDA

View Full Version : Quartz extreme fun


Sohta
2003.12.02, 01:23 AM
Fetching around with the opengl driver monitor, i've found that quartz extreme, at any time, creates 2 openGL contexts, at least 130 textures (+ more for windows, 5 for finder, 23 for safari per window) and gobbles at the very least 12 Mb of video card memory at all time (again, more for each window, a good 2Mb for the safari window I'm typing in).


Now this is nice, but when my game is fullscreen, I'd like to use that memory for myself, especially since I have a 32Mb video card.

Here's the catch, I don't have it. When I go fullscreen, (calling CDCaptureDisplay first), QE doesn't release that memory, none at all actually. Also, turning QE off with the quartz debug app doesn't have any effect. The GL driver is still as busy as it was when QE was on.

Maybe there's something I'm missing here...

anyone has an idea?

arekkusu
2003.12.02, 03:41 AM
Those QE textures are AGP-mapped, though. So they'll be paged out and your app's textures paged in as soon as your app starts drawing. If you capture the display, other apps shouldn't ever draw, so their textures should never be paged back in. They'll still consume AGP space, but not VRAM.

This kind of question has been asked over and over on the mac-opengl list and the response from the Apple guys is "ALL the video ram is available to any app that needs it."

It's quite similar to how VM works-- you can load up 1 gig of data on a machine with 1 gig of ram, and other apps continue to have their stuff mapped into memory... it just happens to reside on disk while you're running.

OneSadCookie
2003.12.02, 03:51 AM
Is this Panther, Jaguar or Puma?

According to Apple -- VRAM is virtualized on Mac OS X. Physical VRAM is given to processes under very much the same conditions that physical RAM is given them. The window server only recomposites areas that have changed, so in the normal case for a windowed OpenGL application, where only the application's window is changing and nothing needs recompositing, all that VRAM should become available to the application.

Likewise in the full-screen case, if you need the VRAM, it should be available to you, since the window server doesn't need it...

You don't make it clear whether you're actually testing this or not... I wouldn't expect the memory to be released unless your application actually needs it, just as I wouldn't expect a background application's memory to be paged out unless a foreground application needed it...

If you really are using enough VRAM that the window server should be being paged out, and have captured the display or are sure there's no recompositing going on, I'd say it's a bug.

Sohta
2003.12.02, 09:06 AM
AAAHHH thank you, I wasn't aware that the VRAM was virtualized. Thanks.