Skip to content

Added Shaderc Implementation #10

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

Open
wants to merge 100 commits into
base: main
Choose a base branch
from

Conversation

sjcobb2022
Copy link

Hi there,

I needed shaderc for building my project so I implemented it here. It took a lot of attempts so I made this new branch with a nice clean commit tree.

There is one caveat however, being that llvm on macOS doesn't compile. I guess this isn't a problem yet though, since MoltenVK isn't implemented yet.

That's it really, it works fine now in my projects.

@sjcobb2022
Copy link
Author

After some quick debugging the implementation now compiles to debug. Added additional input to specify Release or Debug

@sjcobb2022
Copy link
Author

Hi @humbletim. After spending a lot more time trying to fix things, I have found this. KhronosGroup/glslang#2863 essentially stating that we can't use the combined lib directly. Consequently I don't think that my method is possible right now. This is also apparent in the shaderc vcpkg port in which they remove the compiling of the combined library.

https://github.com/microsoft/vcpkg/blob/dc9d737351f916eb349e7bc85671d3dba4043399/ports/shaderc/fix-build-type.patch#L56.

One "fix" for this would to point shaderc to glslang_SOURC_DIR and spirv-tools_SOURCE_DIR, which would take a longer time but would function. I think this is the implementaiton I will try and implement in a second.

btw sorry for the radio silence, I have been moving country for uni.

@sjcobb2022
Copy link
Author

@humbletim This is all complete and works in windows, linux and mac. I cleaned up all my debugging code so everything should be good to go.

I ended up simply directing shaderc to the location of the Glslang and SPIRV-Tools source directories. the linux vulkanSDK executable follows a similar process, however it re-clones the SPIRV-Tools and Glslang directories. Our method is a lot more storage efficient and time efficient since it does not need to re-clone the libraries.

I'll see if I have the time to build any of the other missing deps in the future, but for now I think I'll spend some more time on my own projects.

@Qubaef
Copy link

Qubaef commented Sep 12, 2022

@humbletim are there any plans to merge this PR? I need this feature and I would like to know if it will be ready anytime soon.

@humbletim humbletim self-requested a review September 12, 2022 22:07
@humbletim humbletim self-assigned this Sep 12, 2022
@humbletim
Copy link
Owner

@sjcobb2022 this looks great! i've scheduled some time this week to dive deeper, test drive and hopefully merge this into a new release.

some TODOs on my side:

  • update .github/workflow CI tests to also cover shaderc scenarios
  • update readme.md to reflect shaderc in the available components list
  • generate a new tagged action release

@sjcobb2022
Copy link
Author

sjcobb2022 commented Sep 13, 2022

@humbletim linking to shaderc is a bit annoying since it doesn't generate a FindShaderc.cmake file or anything. Here is my very messy way to link to shaderc on any platform. For implementation it should be as simple as

#include <shaderc/shaderc.hpp>

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.

3 participants