Mac: prefer integrated GPU

This commit is contained in:
Michael Buckley 2021-11-17 19:22:00 -08:00
parent edc32fc0bd
commit cf1a5901fc
1 changed files with 17 additions and 0 deletions

View File

@ -3119,6 +3119,23 @@ void QuitWithFatalError ( NSString *message)
[s9xView addConstraint:[NSLayoutConstraint constraintWithItem:s9xView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationGreaterThanOrEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:SNES_HEIGHT * 2.0]]; [s9xView addConstraint:[NSLayoutConstraint constraintWithItem:s9xView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationGreaterThanOrEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:SNES_HEIGHT * 2.0]];
s9xView.device = MTLCreateSystemDefaultDevice(); s9xView.device = MTLCreateSystemDefaultDevice();
S9xInitDisplay(NULL, NULL); S9xInitDisplay(NULL, NULL);
id<MTLDevice> device = nil;
for ( id<MTLDevice> candidate in MTLCopyAllDevices() )
{
if ( candidate.isLowPower )
{
device = candidate;
break;
}
}
if ( device == nil )
{
device = MTLCreateSystemDefaultDevice();
}
s9xView.device = device;
} }
- (void)start - (void)start