Quartz extreme fun

Member
Posts: 72
Joined: 2006.10
Post: #1
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?

- Sohta
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #2
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.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #3
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.
Quote this message in a reply
Member
Posts: 72
Joined: 2006.10
Post: #4
AAAHHH thank you, I wasn't aware that the VRAM was virtualized. Thanks.

- Sohta
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Immediate graphics in Quartz? Sparklight 3 3,830 Dec 14, 2010 03:12 PM
Last Post: SethWillits
  converting quartz to openGL ES aerospaceman 2 3,863 Apr 12, 2010 10:57 AM
Last Post: ThemsAllTook
  Quartz Composer macnib 3 4,093 Sep 7, 2009 10:33 AM
Last Post: maximile
  OpenGL vs Quartz Performance for 2D Game lfalin 1 3,737 Apr 25, 2007 09:51 PM
Last Post: OneSadCookie
  Quartz Composer Skorche 8 5,685 Jun 23, 2005 08:17 PM
Last Post: Jesse Abram