On Apr 19, 2012, at 5:28 PM, Christopher Wright wrote:

>> What's the best way to "fallback" when a GPU doesn't have multi sample 
>> antialiasing available?
>> Is there a reliable way to do a check for MSAA or give some conditional 
>> logic that won't wind up with an app crashing?
> 
> best way to do fallback is to use a non-MSAA pixel format.
> 


Sure, these are the pixel format attributes I'm using for fallback:

NSOpenGLPixelFormatAttribute attributes[] = {NSOpenGLPFAAccelerated, 
NSOpenGLPFANoRecovery, NSOpenGLPFADoubleBuffer, NSOpenGLPFADepthSize, 24, 0}


> As for a reliable way to check  (I haven't actually tried this particular 
> approach to my knowledge, but I've dealt with this exact same problem before, 
> I just forget how):
> Ask for it (CGLChoosePixelFormat), and see if npix (the last argument, 
> returned by reference) is 0 (meaning no renderers support that format) - 
> that's a failure.  


I'm going to have to take a look at doing that.

> Or you can see if CGLCreateContext gives you a NULL context (meaning it 
> failed).  Check for non-zero error codes returned from CGLChoosePixelFormat 
> and CGLCreateContext.


Sure, that's what I'm trying now. I setup my MSAA pixel format init with those 
attributes, and then check with a "if(   _glContext == nil)". 

Except that doesn't work, and at least one sample project that I see that has 
done this, also doesn't (QCAdvancedPlayer), on an Intel X3100 gpu, that's 
running SL. Maybe it works on some other machines/gpu's, but on that one, it's 
a big fail.

Come to think of it, I think that project always failed on that machine, even 
when I was running Leopard. If one creates an app with the QuartzBuilder 
product, for instance, and enables MSAA, running it will fail on the machine 
I'm speaking about.

It seems like the best path is going to be to see if any renderers support that 
format first (as you suggest above), instead of starting out by setting the 
MSAA and seeing if the context failed. 

Generally, is Apple currently making any units that don't support MSAA? I know 
there's that GPU capabilities chart, but I figure you might have a feel for 
that, in general. At some point I'm going "if this is ancient, why sweat it?" 
ala how people feel about supporting PPC and other ancient stuff. The app is 
gpu intensive, so it probably won't run really slick on older gpu's anyway.


Thanks for the feedback,
gt
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to