0

I have a feeling there are combinations of Cocoa Quartz Compositions and GPUs which can't be handled by the GPU and which fall back on the software renderer, even if Core Image is "accelerated" normally. How would I detect such a situation?

Or more generally, how do I detect that a machine is too underpowered to handle a certain composition of a certain size, without actually playing the composition and measuring the FPS?

(Measuring the FPS through playing the composition in a hidden window is unlikely to work, since the QCView might detect that situation and optimise away the whole operation, or parts thereof. And even if it didn't do that today it might start doing that with the next update from Apple - it'd be an unreliable solution.)

Update: to be thorough I did write some code to test render the composition at full resolution in an ordered out but properly sized window, trying to force the render to happen with [self startRendering];[self snapshotImage];[self stopRendering];. This took an amount of time which looked reasonable at first, until it turned out the slow machine was faster at running this test than the fast one. ;) In reality the slow machine renders the composition at a measly 2.24 FPS vs 27 FPS on the fast machine.

STW
  • 44,917
  • 17
  • 105
  • 161
Alexander Ljungberg
  • 6,302
  • 4
  • 31
  • 37

1 Answers1

1

I'm guessing you're asking so that you can make a simpler fallback animation for weaker systems?

One option may be to check the user's hardware string as is mentioned here: GPU Chipset Detection.

glGetString can return GL_VENDOR, GL_RENDERER, GL_VERSION, or GL_EXTENSIONS. You could theoretically use GL_VENDOR to identify Intel GMA's as too slow, or compare GL_RENDERER to a list of known poor-performing GPUs. If you're writing code for 10.6+ only, you only have to compare to GPUs used in Intel Macs, so the list shouldn't be too long.

This might not be quite the elegant solution you're looking for, but it should do the trick. I would also provide the user with an override to choose the higher or lower quality graphics if they wish.

Community
  • 1
  • 1
shrakner
  • 43
  • 1
  • 6
  • There's also some sample code from Apple called glcheck.c. Still, working based of a list feels so hackish. What if the list is incomplete as far as including all known slow Mac GPUs? And even banning Intel across the board feels wrong - maybe in 5 years or so they'll be caught up enough to run today's apps. ;) Haven't found a better solution yet though. – Alexander Ljungberg Feb 13 '11 at 02:29
  • Heh- well, some pigs do seem to be flying- the Sandy Bridge IGP seems to be a decent competitor to the NVIDIA 320m chipset for the C2Duo. But you're right, it is rather hackish. Perhaps you might be able to check against GL_VERSION or GL_EXTENSIONS to determine approximately how new or how powerful the GPU is. Or, combine GL_VENDOR with version or extensions somehow for a "smarter" determination. Honestly, I'd explore letting the composition test its own FPS and adjust itself accordingly, but that could cause some speed issues itself. – shrakner Feb 13 '11 at 06:04