SethRobinson / proton

Proton SDK: Seth's GL/GLES messy multi-platform C++ game SDK. Can output to Windows, OS X, iOS, Android, Linux (Raspbian too), HTML5, Flash
Other
79 stars 16 forks source link

M1 Mac target woes #30

Closed iProgramMC closed 8 months ago

iProgramMC commented 10 months ago

I've managed to compile RTBareBones for MacOS, but it's blank upon startup, InitDeviceScreenInfoEx is never called upon startup, only when resizing the window, however it gives me errors and the window stays blank:


2023-08-23 21:45:33.979035+0200 RTBareBones[82611:5050099] Built in debug mode
2023-08-23 21:45:33.979149+0200 RTBareBones[82611:5050099] Unable to load font interface/font_trajan.rtfont
2023-08-23 21:45:33.979177+0200 RTBareBones[826=================================================================
11:5050099] Couldn't init app
Main Thread Checker: UI API called on a background thread: -[NSView inLiveResize]
PID: 82611, TID: 5050137, Thread name: CVDisplayLink, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4   RTBareBones                         0x0000000103012fd0 -[MyOpenGLView drawView] + 252
5   RTBareBones                         0x00000001030126f4 -[MyOpenGLView getFrameForTime:] + 84
6   RTBareBones                         0x00000001030127e8 _ZL21MyDisplayLinkCallbackP15__CVDisplayLinkPK11CVTimeStampS3_yPyPv + 52
7   CoreVideo                           0x00000001a2aa6be8 _ZN13CVDisplayLink9performIOEP11CVTimeStamp + 308
8   CoreVideo                           0x00000001a2aa5b90 _ZN13CVDisplayLink11runIOThreadEv + 664
9   libsystem_pthread.dylib             0x00000001033095d4 _pthread_start + 148
10  libsystem_pthread.dylib             0x0000000103313a88 thread_start + 8
2023-08-23 21:45:33.985234+0200 RTBareBones[82611:5050137] [reports] Main Thread Checker: UI API called on a background thread: -[NSView inLiveResize]
PID: 82611, TID: 5050137, Thread name: CVDisplayLink, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4   RTBareBones                         0x0000000103012fd0 -[MyOpenGLView drawView] + 252
5   RTBareBones                         0x00000001030126f4 -[MyOpenGLView getFrameForTime:] + 84
6   RTBareBones                         0x00000001030127e8 _ZL21MyDisplayLinkCallbackP15__CVDisplayLinkPK11CVTimeStampS3_yPyPv + 52
7   CoreVideo                           0x00000001a2aa6be8 _ZN13CVDisplayLink9performIOEP11CVTimeStamp + 308
8   CoreVideo                           0x00000001a2aa5b90 _ZN13CVDisplayLink11runIOThreadEv + 664
9   libsystem_pthread.dylib             0x00000001033095d4 _pthread_start + 148
10  libsystem_pthread.dylib             0x0000000103313a88 thread_start + 8
2023-08-23 21:45:34.019511+0200 RTBareBones[82611:5050137] ERROR: OpenGL error 0x0506 (1286) in GenerateFillRect file /Users/iProgramInCpp/Documents/proton/shared/util/GLESUtils.cpp:501

2023-08-23 21:45:34.019634+0200 RTBareBones[82611:5050137] ERROR: OpenGL error 0x0506 (1286) in GenerateFillRect file /Users/iProgramInCpp/Documents/proton/shared/util/GLESUtils.cpp:501

2023-08-23 21:45:34.019683+0200 RTBareBones[82611:5050137] ERROR: OpenGL error 0x0506 (1286) in RenderGLTriangle file /Users/iProgramInCpp/Documents/proton/shared/util/RenderUtils.cpp:249

2023-08-23 21:45:34.019961+0200 RTBareBones[82611:5050137] Checking pixel data..
2023-08-23 21:45:34.020007+0200 RTBareBones[82611:5050137] Did memcpy, width is 128
2023-08-23 21:45:34.020038+0200 RTBareBones[82611:5050137] It's power of 2...
2023-08-23 21:45:34.020169+0200 RTBareBones[82611:5050137] Loading BMP texture of size 128 by 128
2023-08-23 21:45:34.020573+0200 RTBareBones[82611:5050137] ERROR: OpenGL error 0x0506 (1286) in Blit file /Users/iProgramInCpp/Documents/proton/shared/Renderer/Surface.cpp:870

2023-08-23 21:45:34.020617+0200 RTBareBones[82611:5050137] ERROR: OpenGL error 0x0506 (1286) in BlitEx file /Users/iProgramInCpp/Documents/proton/shared/Renderer/Surface.cpp:791

2023-08-23 21:45:34.020655+0200 RTBareBones[82611:5050137] ERROR: OpenGL error 0x0506 (1286) in BlitEx file /Users/iProgramInCpp/Documents/proton/shared/Renderer/Surface.cpp:791

2023-08-23 21:45:34.030327+0200 RTBareBones[82611:5050137] ERROR: OpenGL error 0x0506 (1286) in GenerateFillRect file /Users/iProgramInCpp/Documents/proton/shared/util/GLESUtils.cpp:501

2023-08-23 21:45:34.030373+0200 RTBareBones[82611:5050137] ERROR: OpenGL error 0x0506 (1286) in GenerateFillRect file /Users/iProgramInCpp/Documents/proton/shared/util/GLESUtils.cpp:501

2023-08-23 21:45:34.030407+0200 RTBareBones[82611:5050137] ERROR: OpenGL error 0x0506 (1286) in RenderGLTriangle file /Users/iProgramInCpp/Documents/proton/shared/util/RenderUtils.cpp:249

2023-08-23 21:45:34.032975+0200 RTBareBones[82611:5050137] ERROR: OpenGL error 0x0506 (1286) in Blit file /Users/iProgramInCpp/Documents/proton/shared/Renderer/Surface.cpp:870

2023-08-23 21:45:34.033016+0200 RTBareBones[82611:5050137] ERROR: OpenGL error 0x0506 (1286) in BlitEx file /Users/iProgramInCpp/Documents/proton/shared/Renderer/Surface.cpp:791

2023-08-23 21:45:34.033049+0200 RTBareBones[82611:5050137] ERROR: OpenGL error 0x0506 (1286) in BlitEx file /Users/iProgramInCpp/Documents/proton/shared/Renderer/Surface.cpp:791

2023-08-23 21:45:34.038254+0200 RTBareBones[82611:5050137] ERROR: OpenGL error 0x0506 (1286) in GenerateFillRect file /Users/iProgramInCpp/Documents/proton/shared/util/GLESUtils.cpp:501

2023-08-23 21:45:34.038355+0200 RTBareBones[82611:5050137] ERROR: OpenGL error 0x0506 (1286) in GenerateFillRect file /Users/iProgramInCpp/Documents/proton/shared/util/GLESUtils.cpp:501

2023-08-23 21:45:34.038394+0200 RTBareBones[82611:5050137] ERROR: OpenGL error 0x0506 (1286) in RenderGLTriangle file /Users/iProgramInCpp/Documents/proton/shared/util/RenderUtils.cpp:249

2023-08-23 21:45:34.038428+0200 RTBareBones[82611:5050137] ERROR: OpenGL error 0x0506 (1286) in Blit file /Users/iProgramInCpp/Documents/proton/shared/Renderer/Surface.cpp:870```
SethRobinson commented 10 months ago

Hrm. OpenGL Error error 0x0506 looks like a problem with the frame buffer initialization, but we don't see errors specifically about initialization on the log with that (maybe it needs more error checking), however, I do see "Unable to load font interface/font_trajan.rtfont" which probably causes an early exit from App::Init(), so need to clear that up first. Where is the font? Why can't it find it?

I still don't have an M1 Mac so unfortunately I don't think I can be of much help right now.

MastahChief commented 10 months ago

I've got the same issue with my M2 Mac, freshly trying out Proton SDK. I think this is an issue with all ARM-based Macs when trying to get Proton to run...

mar4ello6 commented 10 months ago

I've got the same issue with my M2 Mac, freshly trying out Proton SDK. I think this is an issue with all ARM-based Macs when trying to get Proton to run...

Actually it does the same thing on Intel Mac on latest macOS.

SethRobinson commented 10 months ago

Ok, I got a M2 Mac yesterday (my 10 year old mac can't do builds for my iPhone anymore, boo!) and got the exact same errors you guys are talking about on both the new machine and old. I guess something changed and resize events aren't send on startup, but the problem seemed deeper and I could never even get a black screen to render.

So, after hours of pulling my hair I just ripped out most of the mac GL init stuff and rewrote a greatly simplified version and it seems to work fine now.

I've updated the samples, but if you see "32-bit macOS targets are no longer supported" when opening your own Proton OSX projects, here's how to fix it:

SethRobinson commented 10 months ago

Oh, I added that and some stuff for getting FMOD audio to work on Mac here.