[SceneKit Visualization] Refine blocklist again
* Remove exception variable setter Remove SceneKit crash variable setting exception handler from NSApplication delegate. * Restrict SceneKit to 10.13, 10.14, and 11.0+ Signed-off-by: Christopher Snowhill <kode54@gmail.com>swiftingly
parent
385335b37c
commit
071d23b1c6
|
@ -20,11 +20,6 @@
|
||||||
AppController *_appController;
|
AppController *_appController;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)reportException:(NSException *)exception {
|
|
||||||
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"sceneKitCrashed"];
|
|
||||||
[super reportException:exception];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)finishLaunching {
|
- (void)finishLaunching {
|
||||||
[super finishLaunching];
|
[super finishLaunching];
|
||||||
_appController = (AppController *)[self delegate];
|
_appController = (AppController *)[self delegate];
|
||||||
|
|
|
@ -15,8 +15,6 @@
|
||||||
|
|
||||||
#import "Logging.h"
|
#import "Logging.h"
|
||||||
|
|
||||||
@import Firebase;
|
|
||||||
|
|
||||||
#define LOWER_BOUND -80
|
#define LOWER_BOUND -80
|
||||||
|
|
||||||
static void *kSpectrumViewSKContext = &kSpectrumViewSKContext;
|
static void *kSpectrumViewSKContext = &kSpectrumViewSKContext;
|
||||||
|
@ -32,7 +30,6 @@ extern NSString *CogPlaybackDidStopNotficiation;
|
||||||
BOOL paused;
|
BOOL paused;
|
||||||
BOOL stopped;
|
BOOL stopped;
|
||||||
BOOL isListening;
|
BOOL isListening;
|
||||||
BOOL isWorking;
|
|
||||||
BOOL bandsReset;
|
BOOL bandsReset;
|
||||||
BOOL cameraControlEnabled;
|
BOOL cameraControlEnabled;
|
||||||
BOOL observersAdded;
|
BOOL observersAdded;
|
||||||
|
@ -51,44 +48,29 @@ extern NSString *CogPlaybackDidStopNotficiation;
|
||||||
@implementation SpectrumViewSK
|
@implementation SpectrumViewSK
|
||||||
|
|
||||||
+ (SpectrumViewSK *)createGuardWithFrame:(NSRect)frame {
|
+ (SpectrumViewSK *)createGuardWithFrame:(NSRect)frame {
|
||||||
if (![[NSUserDefaults standardUserDefaults] boolForKey:@"sceneKitCrashed"]) {
|
do {
|
||||||
return [[SpectrumViewSK alloc] initWithFrame:frame];
|
if(@available(macOS 11, *)) {
|
||||||
}
|
// macOS 11 and newer seems to be safe
|
||||||
return nil;
|
break;
|
||||||
|
} else if(@available(macOS 10.15, *)) {
|
||||||
|
// macOS 10.15.7 has a SceneKit bug with PBR noise
|
||||||
|
return nil;
|
||||||
|
} else {
|
||||||
|
// macOS 10.12 through 10.14.x seem to be safe too
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} while(0);
|
||||||
|
|
||||||
|
return [[SpectrumViewSK alloc] initWithFrame:frame];
|
||||||
}
|
}
|
||||||
|
|
||||||
@synthesize isListening;
|
@synthesize isListening;
|
||||||
@synthesize isWorking;
|
|
||||||
|
|
||||||
- (id)initWithFrame:(NSRect)frame {
|
- (id)initWithFrame:(NSRect)frame {
|
||||||
id<MTLDevice> device = MTLCreateSystemDefaultDevice();
|
id<MTLDevice> device = MTLCreateSystemDefaultDevice();
|
||||||
|
|
||||||
if(!device) return nil;
|
if(!device) return nil;
|
||||||
|
|
||||||
DLog(@"SceneKit visualizer accessed device named: %@", device.name);
|
|
||||||
[[FIRCrashlytics crashlytics] logWithFormat:@"SceneKit visualizer accessed device named: %@", device.name];
|
|
||||||
|
|
||||||
if([device.name containsString:@"AMD"]) {
|
|
||||||
if([device.name containsString:@"FirePro D"] ||
|
|
||||||
[device.name containsString:@" M2"] ||
|
|
||||||
[device.name containsString:@" M3"] ||
|
|
||||||
[device.name containsString:@" 460"] ||
|
|
||||||
[device.name containsString:@" 470"] ||
|
|
||||||
[device.name containsString:@" 480"] ||
|
|
||||||
[device.name containsString:@" 580"] ||
|
|
||||||
[device.name containsString:@" 590"]) {
|
|
||||||
return nil;
|
|
||||||
} else {
|
|
||||||
if([device.name containsString:@" 550"] ||
|
|
||||||
[device.name containsString:@" 560"] ||
|
|
||||||
[device.name containsString:@" 570"]) {
|
|
||||||
if(![device.name containsString:@"00"]) { /* Exclude RDNA2 */
|
|
||||||
return nil;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
NSDictionary *sceneOptions = @{
|
NSDictionary *sceneOptions = @{
|
||||||
SCNPreferredRenderingAPIKey: @(SCNRenderingAPIMetal),
|
SCNPreferredRenderingAPIKey: @(SCNRenderingAPIMetal),
|
||||||
SCNPreferredDeviceKey: device,
|
SCNPreferredDeviceKey: device,
|
||||||
|
@ -181,7 +163,6 @@ extern NSString *CogPlaybackDidStopNotficiation;
|
||||||
paused = NO;
|
paused = NO;
|
||||||
isListening = NO;
|
isListening = NO;
|
||||||
cameraControlEnabled = NO;
|
cameraControlEnabled = NO;
|
||||||
isWorking = NO;
|
|
||||||
|
|
||||||
[self setBackgroundColor:[NSColor clearColor]];
|
[self setBackgroundColor:[NSColor clearColor]];
|
||||||
|
|
||||||
|
@ -284,11 +265,6 @@ extern NSString *CogPlaybackDidStopNotficiation;
|
||||||
|
|
||||||
- (void)repaint {
|
- (void)repaint {
|
||||||
[self updateVisListening];
|
[self updateVisListening];
|
||||||
|
|
||||||
if(!isWorking) {
|
|
||||||
isWorking = YES;
|
|
||||||
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"sceneKitCrashed"];
|
|
||||||
}
|
|
||||||
|
|
||||||
if(stopped) {
|
if(stopped) {
|
||||||
[self drawBaseBands];
|
[self drawBaseBands];
|
||||||
|
|
Loading…
Reference in New Issue