-
Notifications
You must be signed in to change notification settings - Fork 75
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
Compiling for switch #22
Comments
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ). Hi Andy! I'm not familiar with the Switch dev sdk, but AFAIK you should have OpenGL ES 2 support since it's a Tegra device. Addding support to Switch should be trivial, but it's not supported because it just simply never even occurred me that someone could be interested ( also i don't own a Swich and didn't even know there was an open source devkit ). But if you're getting an undefined reference error is because you're not linking against libGL or libGLES2 ( -lGL or -lGLESv2 ). I'm mostly sure that you must add -lGLESv2 to the linker flags. I don't have any knowledge about the platform but an undefined reference is just that the linker can't find the symbols of that functions, so there's not to many options. Also, if you're going to use GLES2 you need to let SOIL2 know that GLES2 is being used, addding the macro definition for it, named: SOIL_GLES2 ( -DSOIL_GLES2 ). Regards, |
Original comment by Andy Adshead (Bitbucket: BaronKiko, GitHub: BaronKiko). Using -lGLESv2 solved my problem. I had been using -lEGL for my main application and assumed it would just use that. Thank you for the help with my silly mistake |
Original comment by Andy Adshead (Bitbucket: BaronKiko, GitHub: BaronKiko). For anyone in the future that may be reading this. Turns out the switch always reports feature unsupported even though it does support most features. You can just return 1 in this method or come up with a cleaner solution: https://bitbucket.org/SpartanJ/soil2/src/1c584821379872b5556fa750c55228964a63c67f/src/SOIL2/SOIL2.c#lines-302 |
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ). The Wwitch should be reporting the extensions supported by the GPU. I'm pretty sure this can be fixed the right way. Checking for the correct extensions names, they must be using other extension names that SOIL2 is not cheking. Can you send me what's the output of the GL extensions supported? You should be able to output the extensions with something like:
Regards |
Original comment by Andy Adshead (Bitbucket: BaronKiko, GitHub: BaronKiko). I can try run your code later, just heading out the door, but I'm assuming it's the same info as here: https://opengl.gpuinfo.org/displayreport.php?id=3154 That report was created by another dev so we didn't have to keep writing code to check these things. If that's not what you need let me know and I can try your code when I get back. Do remember I am:
|
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ). Oh ok. The extensions are fine. Then if it's failing it might be a bug in the OpenGL driver. The SOIL2 implementation is just valid, if fails it must be reporting something wrong the OpenGL driver. Anyway, since this isn't nothing official, i'm not very interested in fixing it. Patchs are welcomed tho. |
Original comment by Andy Adshead (Bitbucket: BaronKiko, GitHub: BaronKiko). Yeah there isn't a need for a fix. If you wanted a clean fix you could just wrap the change I mentioned earlier in a
but it's no big deal. Just figured I should mention it for future people that may want to use SOIL2 as it confused me for a bit. Having used it for a couple days everything else seems fine. It's a nice library, much better than STBI so thank you for your work. |
Original report by Andy Adshead (Bitbucket: BaronKiko, GitHub: BaronKiko).
I am trying to compile this library for the switch under switchbrew/devkitpro so that I may load DDS files.
I get lots of undefined reference errors to opengl functions such as glTexImage2D
I have tried various changes to the include logic at the top of SOIL2.c with no luck, including removing all the ifdef's and just referencing opengl directly. I am able to reference these methods from my code without issue and the linker options are defined appropriately.
To replicate you can use this project https://github.com/BaronKiko/Ryujinx-OGL-Demos/tree/master/cubemap
Main still uses stbi which I am trying to upgrade from, an updated version that uses SOIL2 can be found here: https://gist.github.com/BaronKiko/6a77f0b84802feb9b4e14ca8f40578fb
You should only need devkitpro to compile it through msys2 using make. The output nro file can be loaded with yuzu or an actual switch. Ryujinx does technically work but there are issues I'm trying to fix, hence the creation of this demo.
Thank you for your time and help
The text was updated successfully, but these errors were encountered: