Macos ios fixes (#1192)
* Configure MoltenVK to use a dedicated compute queue for compute[*] examples with sync barriers * Modify descriptorindexing example for iOS and variable descriptor count limitations on MoltenVK * Remove obsolete macOS #ifdefs no longer needed for modern MoltenVK versions * Update iOS project to fix missing vkloader.c reference and revise example list * Set required features and API version for VVL in debugprintf example * Remove unnecessary Apple-specific code from descriptorindexing example * Add Layer Settings capability to VulkanExampleBase::createInstance() * Replace setenv() in examples with Layer Settings configuration for macOS/iOS * Update comments in examples.h and fix missing initializer in computeraytracing example * Update imgui overlay and example to support iOS Simulator * Update more comments in examples.h and remove redundant initializers in deferred* examples * Separate variable descriptor count declarations for apple and non-apple platforms * Consolidate variable descriptor count declarations for apple vs. non-apple platforms * Configure MoltenVK with a dedicated compute queue in VulkanExampleBase() and remove from samples
This commit is contained in:
parent
e1c962289f
commit
9a562a5426
17 changed files with 221 additions and 83 deletions
|
|
@ -23,6 +23,7 @@
|
|||
- (void)applicationWillResignActive:(UIApplication *)application {
|
||||
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
||||
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
|
||||
[(DemoViewController *)_viewController appInBackground];
|
||||
}
|
||||
|
||||
- (void)applicationDidEnterBackground:(UIApplication *)application {
|
||||
|
|
@ -36,6 +37,7 @@
|
|||
|
||||
- (void)applicationDidBecomeActive:(UIApplication *)application {
|
||||
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
||||
[(DemoViewController *)_viewController appInForeground];
|
||||
}
|
||||
|
||||
- (void)applicationWillTerminate:(UIApplication *)application {
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
/** The main view controller for the demo storyboard. */
|
||||
@interface DemoViewController : UIViewController <UIKeyInput>
|
||||
-(void) appInBackground;
|
||||
-(void) appInForeground;
|
||||
-(void) shutdownExample;
|
||||
@end
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ CALayer* layer;
|
|||
MVKExample* _mvkExample;
|
||||
CADisplayLink* _displayLink;
|
||||
BOOL _viewHasAppeared;
|
||||
BOOL _appInForeground;
|
||||
CGPoint _startPoint;
|
||||
}
|
||||
|
||||
|
|
@ -75,6 +76,7 @@ CALayer* layer;
|
|||
[self.view addGestureRecognizer: pinchSelector];
|
||||
|
||||
_viewHasAppeared = NO;
|
||||
_appInForeground = NO;
|
||||
}
|
||||
|
||||
-(void) viewDidAppear: (BOOL) animated {
|
||||
|
|
@ -85,8 +87,18 @@ CALayer* layer;
|
|||
-(BOOL) canBecomeFirstResponder { return _viewHasAppeared; }
|
||||
|
||||
-(void) renderFrame {
|
||||
//_mvkExample->renderFrame();
|
||||
_mvkExample->displayLinkOutputCb(); // SRS - Call displayLinkOutputCb() to animate frames vs. renderFrame() for static image
|
||||
if (_appInForeground)
|
||||
{
|
||||
_mvkExample->displayLinkOutputCb(); // SRS - Call displayLinkOutputCb() to render/animate at displayLink frame rate
|
||||
}
|
||||
}
|
||||
|
||||
- (void)appInForeground {
|
||||
_appInForeground = YES;
|
||||
}
|
||||
|
||||
- (void)appInBackground {
|
||||
_appInForeground = NO;
|
||||
}
|
||||
|
||||
-(void) shutdownExample {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue