More iOS cleanup

This commit is contained in:
Henrik Rydgård
2026-03-05 13:40:07 +01:00
parent ecf7fee8fb
commit b80f235090
3 changed files with 5 additions and 31 deletions
+2 -17
View File
@@ -95,9 +95,6 @@ PPSSPPBaseViewController *sharedViewController;
@interface PPSSPPViewControllerGL () {
IOSGLESContext *graphicsContext;
int imageRequestId;
NSString *imageFilename;
}
@property (nonatomic, strong) EAGLContext *glContext;
@@ -105,8 +102,6 @@ PPSSPPBaseViewController *sharedViewController;
@property (nonatomic, strong) CADisplayLink *displayLink;
@property (nonatomic, assign) NSTimeInterval lastTimestamp;
@property (nonatomic, strong) EAGLContext* context;
@end
@implementation PPSSPPViewControllerGL {}
@@ -144,12 +139,12 @@ void GLRenderLoop(IOSGLESContext *graphicsContext) {
- (bool)runGLRenderLoop {
if (!graphicsContext) {
ERROR_LOG(Log::G3D, "runVulkanRenderLoop: Tried to enter without a created graphics context.");
ERROR_LOG(Log::G3D, "runGLRenderLoop: Tried to enter without a created graphics context.");
return false;
}
if (g_renderLoopThread.joinable()) {
ERROR_LOG(Log::G3D, "runVulkanRenderLoop: Already running");
ERROR_LOG(Log::G3D, "runGLRenderLoop: Already running");
return false;
}
@@ -239,7 +234,6 @@ void GLRenderLoop(IOSGLESContext *graphicsContext) {
[self hideKeyboard];
// Initialize the motion manager for accelerometer control.
INFO_LOG(Log::G3D, "Done with viewDidLoad.");
}
@@ -340,15 +334,6 @@ void GLRenderLoop(IOSGLESContext *graphicsContext) {
_dbg_assert_(graphicsContext);
if (self.context) {
if ([EAGLContext currentContext] == self.context) {
[EAGLContext setCurrentContext:nil];
}
self.context = nil;
}
[[NSNotificationCenter defaultCenter] removeObserver:self];
graphicsContext->BeginShutdown();
// Skipping GL calls here because the old context is lost.
graphicsContext->ThreadFrameUntilCondition([]() -> bool {
+3 -3
View File
@@ -110,7 +110,7 @@
// This needs to be called really late during startup, unfortunately.
#if PPSSPP_PLATFORM(IOS_APP_STORE)
[IAPManager sharedIAPManager]; // Kick off the IAPManager early.
NSLog(@"Metal viewDidAppear. updating icon");
NSLog(@"viewDidAppear. updating icon");
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(4.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[[IAPManager sharedIAPManager] updateIcon:false];
[self hideKeyboard];
@@ -443,9 +443,9 @@ extern float g_safeInsetBottom;
}
- (void)updateResolutionWithView:(UIView *)view {
// 1. Get the scale from the window scene (safest for Metal)
// 1. Get the scale from the window scene
CGFloat scale = 1.0;
if (view.window.windowScene) {
if (view.window && view.window.windowScene) {
scale = view.window.windowScene.screen.nativeScale;
} else {
scale = [UITraitCollection currentTraitCollection].displayScale;
-11
View File
@@ -81,19 +81,8 @@ bool IOSVulkanContext::InitFromRenderThread(CAMetalLayer *layer, int desiredBack
VkPresentModeKHR presentMode = ConfigPresentModeToVulkan(draw_);
// This MUST run on the main thread. We're taking our chances with a dispatch_sync here.
g_Vulkan->InitSwapchain(presentMode);
if (false) {
delete draw_;
ERROR_LOG(Log::G3D, "InitSwapchain failed");
g_Vulkan->DestroySwapchain();
g_Vulkan->DestroySurface();
g_Vulkan->DestroyDevice();
g_Vulkan->DestroyInstance();
return false;
}
SetGPUBackend(GPUBackend::VULKAN);
bool shaderSuccess = draw_->CreatePresets(); // Doesn't fail, we ship the compiler.
_assert_msg_(shaderSuccess, "Failed to compile preset shaders");