Add in windows support#7
Conversation
this commit adds in support for building, and compiling shaders on windows.
|
FWIW I've confirmed this builds on linux/macOS/windows, but it'd be good for someone else to confirm too that this still builds for cafeOS, my cafeOS build is trying to look for |
|
When compiling for Wii U via
|
|
Ah, I thought I had done a package search, but guess not. Thanks for that pointer. Luckily that's a really easy fix for this PR. Assuming I can compile safely I'll build and test the whole stack on the Wii-U as well. |
|
Thanks for the pointer! I've fixed the functions that the devkitPro standard library doesn't have, and also a linking error that popped up. Though i'm gonna be honest, I have 0 idea how on any earth this worked before. The Anyway to ignore whatever was happening there. I've removed the ifndef for RPL compilation so those functions are defined when building an RPL, and I've linked in Things seem to be working, but I'd appreciate any tests folks have with RPLs to happen to make sure there's nothing insidious sneaking in. |
this commit adds in support for building, and compiling shaders on windows using MSVC (this would've been much easier with clang on windows, but windows clang/cl2 is unsupported by meson (and older clang is so unsupported that setup is a nightmare), so we had to do quite a bit to get it to work with MSVC, and cl.exe). This probably has much more potential for problems, but we seem to at least be getting a compile. I've worked on fixing all warnings that were generated.
(As a side note the compilation issue I mentioned in the issue on windows turned out to be two things:
Warning
As a side note, while compilations do succeed, when comparing the outputs of the test sets. While test 1 is exactly the same. Test set 2 generates slightly different register use, this doesn't seem to be an issue as far as I can tell, but it'd be good for someone else to confirm, or if someone else has test shaders to run. To confirm they all load okay.
Linux block:
Windows Block:
I did validate all the test shaders I could find were able to be compiled.
Some of the changes that went through:
_aligned_mallocsincealigned_mallocdoesn't exist on windows, ensure it's always aligned to a power of 2 since windows requires that.<bit>header because it's only supported on c++20 on MSVC which we aren't compiling withglslcompilerhave the "correct" file extension for each platform (no extension on linux/mac/bsd's, exe on windows, and .elf on CafeOS).assert()isn't compiled in.__builtin_ctz, and__builtin_clz