| Summary: | Add GLES2 support for macOS via ANGLE library | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Andrey <djdron> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | enhancement | ||
| Priority: | P2 | CC: | icculus, kraft.aria |
| Version: | HG 2.1 | ||
| Hardware: | x86_64 | ||
| OS: | Mac OS X (All) | ||
| Attachments: |
Add GLESv2 & EGL support for macOS via Goolge ANGLE implementation
Add GLESv2 & EGL support for macOS via Goolge ANGLE implementation configure patch testgles2 screenshot testgl2 screenshot testgles2 demo |
||
|
Description
Andrey
2017-11-20 20:29:49 UTC
It looks like Mac OS X support is a work in progress. Feel free to contribute a tested patch! Created attachment 3102 [details]
Add GLESv2 & EGL support for macOS via Goolge ANGLE implementation
Ok, here is it :)
Created attachment 3103 [details]
Add GLESv2 & EGL support for macOS via Goolge ANGLE implementation
Patch added, thanks! https://hg.libsdl.org/SDL/rev/bc7ca7cfa6ca Hi Sam Lantinga !) There are 2 new files SDL_cocoaopengles.h/.m was added in my patch but they're not has been committed to hg repo. I put the two missing files into revision control: https://hg.libsdl.org/SDL/rev/49f8fb4f6ce2 --ryan. Oops, thanks Ryan! Please add this improvement in WhatsNew.txt file Can you add a patch with a patch note that you'd like for this? ;) Here's the patch note I added: Added support for OpenGL ES using ANGLE when it's available Thanks!) You're welcome! :) It looks like configure isn't adding EGL on MacOS even with ANGLE in place. INFO: SDL_GL_CreateContext(): SDL not configured with EGL support I can throw AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ]) into CheckMacGL then get: INFO: SDL_GL_CreateContext(): Could not create EGL context (call to eglCreateContext failed, reporting an error of EGL_BAD_CONFIG) Created attachment 3184 [details]
configure patch
Seems SDL_VIDEO_OPENGL_EGL is not enough.
Try to add defines from this patch
Created attachment 3185 [details]
testgles2 screenshot
post 3184 attachment - screenshot
Created attachment 3186 [details]
testgl2 screenshot
added for comparison sake
Thanks Andrey, attachment 3184 [details] resolves the EGL issue in configure. It now looks like I'm getting only a quarter of the image being displayed in testgles2 comparing to testgl2. testgles2 https://bugzilla.libsdl.org/attachment.cgi?id=3185 testgl2 https://bugzilla.libsdl.org/attachment.cgi?id=3186 (In reply to AriaMoKr from comment #17) > Thanks Andrey, attachment 3184 [details] resolves the EGL issue in configure. > It now looks like I'm getting only a quarter of the image being displayed in > testgles2 comparing to testgl2. Strange, but samples looks fine on my Mac mini late 2012. Try other samples with '--renderer opengles2' parameter. Created attachment 3187 [details]
testgles2 demo
Try to use this angle library (compiled by me for OSX 10.9 and up few month ago from latest google repo): https://www.dropbox.com/s/uu3fcsb0bpnskhv/ANGLE_MacOS.zip?dl=0 May be it's a bug with retina display? Try to run samples without retina Bingo! It looks to be a retina issue, trying with an external (non retina) display works just fine. I didn't suspect it to be a retina issue earlier because I wasn't the same behavior running testgl2, so maybe something specific to ANGLE. Running something like testdraw2 with --renderer opengles2 will also show the same bottom left quarter view problem. Testing disable of retina via "sudo defaults write /Library/Preferences/com.apple.windowserver.plist DisplayResolutionEnabled -bool true" didn't seem to work for me (probably High Sierra issue) but I was able to run SwitchResX to give me a non-retina mode and that fixed it as well. Running the attached libraries didn't change the behavior. Also try to pack app to bundle with <key>NSHighResolutionCapable</key> <true/> I packed the testgles2 into an app bundle and that ended up fixing it even without setting NSHighResolutionCapable (or having to create a Info.plist). mkdir -p testgles2.app/Contents/MacOS cp testgles2 testgles2.app/Contents/MacOS ./testgles2.app/Contents/MacOS/testgles2 seems to work fine, but just ./testgles2 gave me the quarter display issue. (executing both while in my ~/hg/SDL/test directory). (In reply to AriaMoKr from comment #24) > seems to work fine, but just ./testgles2 gave me the quarter display issue. Fine!) Sam Lantinga, please add apply this patch to configure script to enable gles2 support https://bugzilla.libsdl.org/attachment.cgi?id=3184 Added, thanks! https://hg.libsdl.org/SDL/rev/c808a74c019e |