Small Changes to Aid in Host Packaging#9
Open
Mythra wants to merge 7 commits into
Open
Conversation
this commit adds in support for building, and compiling shaders on windows.
this fixes the segfault when running tests while on macOS. this roughly comes down to two rough classes of issues: 1. macOS is a lot more strict around allocations, and enforcing that they seemingly are correct. - First macOS like windows, wants a size to be a power of two. - Second macOS enforces that size is not less than alignment. these seem small but were the cause of the 'SEGFAULTS'. 2. macOS's standard library also is not a fan of modifying lists/sets/etc. AS they're being iterated. it did cause some small issues with tests, i've fixed the ones that the test suite exercised, but this is not _necissarily_ all of them. If you're seeing improper compilations it may be best to look into other passes doing this.
this also fixes a potential for looping forever, although i was only able to hit this with weirdly formatted vertex shaders that may not have been valid. it still fixes the actual potential for it happening, and frankly looks cleaner.
0137bd2 to
9c9227a
Compare
this applies the same UB fix in program shader on vertex shader. caught this using a brand new VS that happened to have a size that fit.
- rename "glslcompiler" to "cafe-glslcompiler", this allows users to
have a glslcompiler for regular mesa (or any of the many other forks
of the glslcompiler). This also means we can check _if_ the project
is installed.
- I also applied to this the static library as the static library
could also techincally collide with a non-cafe library. I did
not change the rpl's/rpx's as those can _only_ be for the wii-u.
- also add in a basic CMake file for the _host_ toolchain. this expects
to be bundled with the resulting cmake + a static binary.
9c9227a to
e969acf
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Note
This PR builds ontop of #7 & #8 , and as a result the diff looks massive because of the enumerations being copied on the windows pr branch along with containing all the windows code.
I recommend just viewing the changes at: dba636d...9c9227a until the windows PR gets merged.
This way you see the small ~100 line pr.
This makes some small changes to the binary name to make it easier to find our specific GLSL compiler when in a packaged environment. Specifically for any artifact that can be the same as a host artifact (e.g. static libraries
.a, binaries that run on the host.exe/no file extension, etc.) we prepend "cafe-" to the front. To make it clear that it is for Cafe. And we don't attempt to use a host glsl compiler from regular mesa or something.RPL's/RPX's share the same name, notably because they can't really be mixed with anything other than Cafe. And also I wasn't fully sure if
exports.defname would support a-.I also added a simple CMake pkg-config file, so if you package the binary + cmake file (like I do), you can easily just
FetchContentthe URL, and thenFindPackage(CafeGLSL)and it all just works ™️. I mainly did this because Devkitpro (I imagine the toolchain pretty much everyone would use), supports CMake/Make, and for Make there's really no pkg-config esque file that would be helpful. So adding in compat for CMake seemed to make sense.