-
-
Notifications
You must be signed in to change notification settings - Fork 362
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] - Test Pioneer running on Raspberry Pi 5 #5700
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,9 +49,16 @@ namespace Graphics { | |
Uint32 winFlags = 0; | ||
|
||
winFlags |= SDL_WINDOW_OPENGL; | ||
// We'd like a context that implements OpenGL 3.2 to allow creation of multisampled textures | ||
// We'd like a context that implements OpenGL 3.1 to allow creation of multisampled textures | ||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); | ||
#if (defined(__arm__) || defined(__aarch64__) || defined(__PPC64__) || defined(__riscv)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of testing for platform feature flags here, prefer adding an explicit There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will try to work this out but I detest CMake, it's the worst possible build system and I can barely hack around in it at the best of times 🤷 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd probably consider Autotools to be worse, but I completely understand where you're coming from. |
||
// on Arm and other platforms we attempt to create an OpenGL 3.1 context as this is what Raspberry Pi 4 & 5 currently support | ||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); | ||
#else | ||
// x86/x64 we use newer OpenGL | ||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2); | ||
#endif | ||
|
||
// Request core profile as we're uninterested in old fixed-function API | ||
// also cannot initialise 3.x context on OSX with anything but CORE profile | ||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); | ||
|
@@ -180,11 +187,20 @@ namespace Graphics { | |
if (vs.enableDebugMessages) | ||
GLDebug::Enable(); | ||
|
||
#if (defined(__arm__) || defined(__aarch64__) || defined(__PPC64__) || defined(__riscv)) | ||
// on Arm and other platforms we attempt to create an OpenGL 3.1 context as this is what Raspberry Pi 4 & 5 currently support | ||
if (!glewIsSupported("GL_VERSION_3_1")) { | ||
Error( | ||
"Pioneer can not run on your device (Raspberry Pi?) as it does not appear to support OpenGL 3.1" | ||
} | ||
#else | ||
// x86/x64 we use newer OpenGL | ||
if (!glewIsSupported("GL_VERSION_3_2")) { | ||
Error( | ||
"Pioneer can not run on your graphics card as it does not appear to support OpenGL 3.2\n" | ||
"Please check to see if your GPU driver vendor has an updated driver - or that drivers are installed correctly."); | ||
} | ||
#endif | ||
|
||
if (!glewIsSupported("GL_EXT_texture_compression_s3tc")) { | ||
if (glewIsSupported("GL_ARB_texture_compression")) { | ||
|
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.
Instead of wrapping the
USE_SSE42
etc. if-defs, prefer adding a newoption(PIONEER_TARGET_RASPBERRY_PI)
declaration with the compile flags and adding a preset definition to either CMakePresets.json or a new scripts/CMakeExperimentalPresets.json which sets the appropriate options:If added to scripts/CMakeExperimentalPresets.json (preferred), you'll have to manually
cp scripts/CMakeExperimentalPresets.json CMakeUserPresets.json
before running e.g.cmake --preset linux-arm-raspberry-pi
.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.
My only problem with that is defaulting to USE_SSE42 is only correct for x86/64 and wrong for PPC, Arm, RiscV etc so we should guard it somehow
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.
If there's a way to default that option to off on non-x86 style platforms I'm all for it. Otherwise, it's assumed the options are managed via a CMake preset or explicit build flag set from a distribution build harness of some sort.
...which now that I think about it blindly omits Windows ARM64 builds, but I don't think I've seen anyone yet who's tried to build Pioneer on that platform.