Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Mythra
Copy link

@Mythra Mythra commented Dec 21, 2025

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: f8d995e...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.def name 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 FetchContent the URL, and then FindPackage(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.

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.
- 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.
@Mythra Mythra force-pushed the mythra/cmake-packaging branch from 0137bd2 to 9c9227a Compare December 23, 2025 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant