-
Notifications
You must be signed in to change notification settings - Fork 269
macOS Apple Silicon support via Mesa Zink → KosmicKrisp → Metal #2991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
iamaperson000
wants to merge
28
commits into
beyond-all-reason:master
Choose a base branch
from
iamaperson000:upstream-pr-macos-apple-silicon
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
efe70fe
macOS: add Platform/Mac files and Apple Silicon CMake support
iamaperson000 49c6d69
Fix macOS CMake: SDL2, libunwind, GLAD, OpenAL EFX, linker warnings
MarkKropf b22cb25
Fix DevIL include path and add missing headless GL stubs
MarkKropf 4199e07
Fix macOS ARM64 build against upstream master
MarkKropf 16622a9
Fix INLINE macro collision between smmalloc and simdjson
MarkKropf 43ae6c9
Fix vendored library compilation on macOS/Clang
MarkKropf cc3cad9
Fix macOS Clang C++ compatibility issues
MarkKropf 1e75080
Rendering: guard CTextureAtlas::GetTexID against null atlasTex
iamaperson000 13a0c60
Window: persist logical (point) size, not the backing-pixel size
iamaperson000 17c55de
GL: skip legacy ARB-extension name check on core-profile contexts
iamaperson000 28c2a93
macOS: parameterize Mesa libEGL via SPRING_MAC_LIBEGL
iamaperson000 08d2b01
macOS: add EGL init diagnostics
iamaperson000 6e2ccc1
macOS: run engine on Mesa surfaceless EGL + Zink + KosmicKrisp
iamaperson000 52f065e
macOS: manual Metal present path (pbuffer -> CAMetalLayer)
iamaperson000 f549beb
macOS: present real frames via SwapBuffers
iamaperson000 1dc0591
macOS: IOSurface zero-copy present (glReadPixels -> MTLTexture)
iamaperson000 6a60935
GlobalRendering: viewport must match the FBO, not the drawable
iamaperson000 4f0dbc4
macOS/Zink: prefer GL compatibility-profile context
iamaperson000 a98ba7a
Rendering: env-gated headless frame capture (SPRING_FRAME_CAPTURE)
iamaperson000 4eb4f56
Rendering: async PBO readback + downsample / timing knobs
iamaperson000 e46af54
macOS: enable BAR Lua loading screen (CLuaIntro) by default
iamaperson000 3e2f933
LuaShaders: gate geometry-shader strip to macOS only
iamaperson000 5b60718
macOS: scale SDL mouse coords from logical points to backing pixels
iamaperson000 a255306
CMake: restore Lua/LuaLibs.cpp in dedicated and unitsync sources
iamaperson000 44e9078
LuaShaders: gate GS-strip diagnostics inside __APPLE__ block
iamaperson000 d39f04e
CMake: scope macOS-specific tweaks so Linux builds are unaffected
iamaperson000 5340742
Sound: move vendored OpenAL EFX headers under include/Mac/AL/
iamaperson000 6127c9c
macOS: detect P/E core split and hint QOS for sim workers
iamaperson000 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| /* OpenAL extensions header — vendored for macOS compatibility. | ||
| * | ||
| * Apple's OpenAL.framework does not include alext.h. | ||
| * These constants and typedefs are from OpenAL-Soft's alext.h | ||
| * for the ALC_SOFT_loopback extension used by the sound system. | ||
| * | ||
| * Functions are loaded at runtime via alcGetProcAddress(). | ||
| */ | ||
|
|
||
| #ifndef AL_ALEXT_H | ||
| #define AL_ALEXT_H | ||
|
|
||
| #include <al.h> | ||
| #include <alc.h> | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif | ||
|
|
||
| /* ALC_SOFT_loopback */ | ||
| #define ALC_SOFT_loopback 1 | ||
| #define ALC_FORMAT_CHANNELS_SOFT 0x1990 | ||
| #define ALC_FORMAT_TYPE_SOFT 0x1991 | ||
|
|
||
| /* Sample types */ | ||
| #define ALC_BYTE_SOFT 0x1400 | ||
| #define ALC_UNSIGNED_BYTE_SOFT 0x1401 | ||
| #define ALC_SHORT_SOFT 0x1402 | ||
| #define ALC_UNSIGNED_SHORT_SOFT 0x1403 | ||
| #define ALC_INT_SOFT 0x1404 | ||
| #define ALC_UNSIGNED_INT_SOFT 0x1405 | ||
| #define ALC_FLOAT_SOFT 0x1406 | ||
|
|
||
| /* Channel configurations */ | ||
| #define ALC_MONO_SOFT 0x1500 | ||
| #define ALC_STEREO_SOFT 0x1501 | ||
| #define ALC_QUAD_SOFT 0x1503 | ||
| #define ALC_5POINT1_SOFT 0x1504 | ||
| #define ALC_6POINT1_SOFT 0x1505 | ||
| #define ALC_7POINT1_SOFT 0x1506 | ||
|
|
||
| /* Loopback function pointer types */ | ||
| typedef ALCdevice* (ALC_APIENTRY *LPALCLOOPBACKOPENDEVICESOFT)(const ALCchar*); | ||
| typedef ALCboolean (ALC_APIENTRY *LPALCISRENDERFORMATSUPPORTEDSOFT)(ALCdevice*, ALCsizei, ALCenum, ALCenum); | ||
| typedef void (ALC_APIENTRY *LPALCRENDERSAMPLESSOFT)(ALCdevice*, ALCvoid*, ALCsizei); | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
|
|
||
| #endif /* AL_ALEXT_H */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,149 @@ | ||
| /* OpenAL EFX extension header — vendored for macOS compatibility. | ||
| * | ||
| * Apple's OpenAL.framework does not include EFX headers. | ||
| * These constants and typedefs are from the OpenAL 1.1 EFX specification | ||
| * (originally distributed with OpenAL-Soft). | ||
| * | ||
| * Functions are loaded at runtime via alGetProcAddress() in EFXfuncs.cpp, | ||
| * so only compile-time constants and typedefs are needed here. | ||
| */ | ||
|
|
||
| #ifndef AL_EFX_H | ||
| #define AL_EFX_H | ||
|
|
||
| #include <al.h> | ||
| #include <alc.h> | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif | ||
|
|
||
| /* Effect types */ | ||
| #define AL_EFFECT_TYPE 0x8001 | ||
| #define AL_EFFECT_NULL 0x0000 | ||
| #define AL_EFFECT_REVERB 0x0001 | ||
| #define AL_EFFECT_CHORUS 0x0002 | ||
| #define AL_EFFECT_DISTORTION 0x0003 | ||
| #define AL_EFFECT_ECHO 0x0004 | ||
| #define AL_EFFECT_FLANGER 0x0005 | ||
| #define AL_EFFECT_FREQUENCY_SHIFTER 0x0006 | ||
| #define AL_EFFECT_VOCAL_MORPHER 0x0007 | ||
| #define AL_EFFECT_PITCH_SHIFTER 0x0008 | ||
| #define AL_EFFECT_RING_MODULATOR 0x0009 | ||
| #define AL_EFFECT_AUTOWAH 0x000A | ||
| #define AL_EFFECT_COMPRESSOR 0x000B | ||
| #define AL_EFFECT_EQUALIZER 0x000C | ||
| #define AL_EFFECT_EAXREVERB 0x8000 | ||
|
|
||
| /* EAX Reverb effect parameters */ | ||
| #define AL_EAXREVERB_DENSITY 0x0001 | ||
| #define AL_EAXREVERB_DIFFUSION 0x0002 | ||
| #define AL_EAXREVERB_GAIN 0x0003 | ||
| #define AL_EAXREVERB_GAINHF 0x0004 | ||
| #define AL_EAXREVERB_GAINLF 0x0005 | ||
| #define AL_EAXREVERB_DECAY_TIME 0x0006 | ||
| #define AL_EAXREVERB_DECAY_HFRATIO 0x0007 | ||
| #define AL_EAXREVERB_DECAY_LFRATIO 0x0008 | ||
| #define AL_EAXREVERB_REFLECTIONS_GAIN 0x0009 | ||
| #define AL_EAXREVERB_REFLECTIONS_DELAY 0x000A | ||
| #define AL_EAXREVERB_REFLECTIONS_PAN 0x000B | ||
| #define AL_EAXREVERB_LATE_REVERB_GAIN 0x000C | ||
| #define AL_EAXREVERB_LATE_REVERB_DELAY 0x000D | ||
| #define AL_EAXREVERB_LATE_REVERB_PAN 0x000E | ||
| #define AL_EAXREVERB_ECHO_TIME 0x000F | ||
| #define AL_EAXREVERB_ECHO_DEPTH 0x0010 | ||
| #define AL_EAXREVERB_MODULATION_TIME 0x0011 | ||
| #define AL_EAXREVERB_MODULATION_DEPTH 0x0012 | ||
| #define AL_EAXREVERB_AIR_ABSORPTION_GAINHF 0x0013 | ||
| #define AL_EAXREVERB_HFREFERENCE 0x0014 | ||
| #define AL_EAXREVERB_LFREFERENCE 0x0015 | ||
| #define AL_EAXREVERB_ROOM_ROLLOFF_FACTOR 0x0016 | ||
| #define AL_EAXREVERB_DECAY_HFLIMIT 0x0017 | ||
|
|
||
| /* Filter types */ | ||
| #define AL_FILTER_TYPE 0x8001 | ||
| #define AL_FILTER_NULL 0x0000 | ||
| #define AL_FILTER_LOWPASS 0x0001 | ||
| #define AL_FILTER_HIGHPASS 0x0002 | ||
| #define AL_FILTER_BANDPASS 0x0003 | ||
|
|
||
| /* Lowpass filter parameters */ | ||
| #define AL_LOWPASS_GAIN 0x0001 | ||
| #define AL_LOWPASS_GAINHF 0x0002 | ||
|
|
||
| /* Highpass filter parameters */ | ||
| #define AL_HIGHPASS_GAIN 0x0001 | ||
| #define AL_HIGHPASS_GAINLF 0x0002 | ||
|
|
||
| /* Bandpass filter parameters */ | ||
| #define AL_BANDPASS_GAIN 0x0001 | ||
| #define AL_BANDPASS_GAINLF 0x0002 | ||
| #define AL_BANDPASS_GAINHF 0x0003 | ||
|
|
||
| /* Auxiliary effect slot properties */ | ||
| #define AL_EFFECTSLOT_EFFECT 0x0001 | ||
| #define AL_EFFECTSLOT_GAIN 0x0002 | ||
| #define AL_EFFECTSLOT_AUXILIARY_SEND_AUTO 0x0003 | ||
| #define AL_EFFECTSLOT_NULL 0x0000 | ||
|
|
||
| /* Context attribute for max auxiliary sends */ | ||
| #define ALC_MAX_AUXILIARY_SENDS 0x20003 | ||
|
|
||
| /* Air absorption factor range */ | ||
| #define AL_MIN_AIR_ABSORPTION_FACTOR 0.0f | ||
| #define AL_MAX_AIR_ABSORPTION_FACTOR 10.0f | ||
|
|
||
| /* Source properties for auxiliary send filter */ | ||
| #define AL_DIRECT_FILTER 0x20005 | ||
| #define AL_AUXILIARY_SEND_FILTER 0x20006 | ||
| #define AL_AIR_ABSORPTION_FACTOR 0x20007 | ||
| #define AL_DIRECT_FILTER_GAINHF_AUTO 0x2000B | ||
| #define AL_AUXILIARY_SEND_FILTER_GAIN_AUTO 0x2000C | ||
| #define AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO 0x2000D | ||
|
|
||
| /* EFX function pointer types — loaded at runtime via alGetProcAddress() */ | ||
|
|
||
| /* Effect functions */ | ||
| typedef void (AL_APIENTRY *LPALGENEFFECTS)(ALsizei, ALuint*); | ||
| typedef void (AL_APIENTRY *LPALDELETEEFFECTS)(ALsizei, const ALuint*); | ||
| typedef ALboolean (AL_APIENTRY *LPALISEFFECT)(ALuint); | ||
| typedef void (AL_APIENTRY *LPALEFFECTI)(ALuint, ALenum, ALint); | ||
| typedef void (AL_APIENTRY *LPALEFFECTIV)(ALuint, ALenum, const ALint*); | ||
| typedef void (AL_APIENTRY *LPALEFFECTF)(ALuint, ALenum, ALfloat); | ||
| typedef void (AL_APIENTRY *LPALEFFECTFV)(ALuint, ALenum, const ALfloat*); | ||
| typedef void (AL_APIENTRY *LPALGETEFFECTI)(ALuint, ALenum, ALint*); | ||
| typedef void (AL_APIENTRY *LPALGETEFFECTIV)(ALuint, ALenum, ALint*); | ||
| typedef void (AL_APIENTRY *LPALGETEFFECTF)(ALuint, ALenum, ALfloat*); | ||
| typedef void (AL_APIENTRY *LPALGETEFFECTFV)(ALuint, ALenum, ALfloat*); | ||
|
|
||
| /* Filter functions */ | ||
| typedef void (AL_APIENTRY *LPALGENFILTERS)(ALsizei, ALuint*); | ||
| typedef void (AL_APIENTRY *LPALDELETEFILTERS)(ALsizei, const ALuint*); | ||
| typedef ALboolean (AL_APIENTRY *LPALISFILTER)(ALuint); | ||
| typedef void (AL_APIENTRY *LPALFILTERI)(ALuint, ALenum, ALint); | ||
| typedef void (AL_APIENTRY *LPALFILTERIV)(ALuint, ALenum, const ALint*); | ||
| typedef void (AL_APIENTRY *LPALFILTERF)(ALuint, ALenum, ALfloat); | ||
| typedef void (AL_APIENTRY *LPALFILTERFV)(ALuint, ALenum, const ALfloat*); | ||
| typedef void (AL_APIENTRY *LPALGETFILTERI)(ALuint, ALenum, ALint*); | ||
| typedef void (AL_APIENTRY *LPALGETFILTERIV)(ALuint, ALenum, ALint*); | ||
| typedef void (AL_APIENTRY *LPALGETFILTERF)(ALuint, ALenum, ALfloat*); | ||
| typedef void (AL_APIENTRY *LPALGETFILTERFV)(ALuint, ALenum, ALfloat*); | ||
|
|
||
| /* Auxiliary effect slot functions */ | ||
| typedef void (AL_APIENTRY *LPALGENAUXILIARYEFFECTSLOTS)(ALsizei, ALuint*); | ||
| typedef void (AL_APIENTRY *LPALDELETEAUXILIARYEFFECTSLOTS)(ALsizei, const ALuint*); | ||
| typedef ALboolean (AL_APIENTRY *LPALISAUXILIARYEFFECTSLOT)(ALuint); | ||
| typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTI)(ALuint, ALenum, ALint); | ||
| typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTIV)(ALuint, ALenum, const ALint*); | ||
| typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTF)(ALuint, ALenum, ALfloat); | ||
| typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTFV)(ALuint, ALenum, const ALfloat*); | ||
| typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTI)(ALuint, ALenum, ALint*); | ||
| typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTIV)(ALuint, ALenum, ALint*); | ||
| typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTF)(ALuint, ALenum, ALfloat*); | ||
| typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTFV)(ALuint, ALenum, ALfloat*); | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
|
|
||
| #endif /* AL_EFX_H */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
magic getenvs sound like a thing that requires documentation or else they will become tears in the rain in two weeks tops