-
Notifications
You must be signed in to change notification settings - Fork 56
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
Support include directives on shaderc #233
Conversation
e510325
to
2ae2edf
Compare
This is great, thank you so much! |
This is failing because shaderc is disabled on the build system by default, mainly because docs were not building for crates, so I need to check how to enable it only for the build system. Another option is avoid the compilation of the example if shaderc is not enabled. I'll take a look today. |
@fand is it ok to you if we remove the example? Only the example. I wasn't able to find a way to exclude the example from the What do you think? |
Thanks for review!
Yeah I totally agree 👍 I removed the example
Just curious, could you give me the link of the issue if you have? |
This reverts commit 2ae2edf.
This is the issue I found: rust-lang/cargo#7233 they are trying to avoid the compilation using a config flag (I did it with Sorry for the inconveniences and thank you so much for the PR! |
Hello 👋 Thanks for great library!!
I was tweaking around notan_macro to see if it's possible to support
#include
.Then I found
shaderc
can handle#include
directives by passing an additional option.So, this PR adds an option passed to
shaderc
to include shader files in following format:#include "foo/bar.glsl"
#include <foo/bar.glsl>
CARGO_MANIFEST_DIR
or.
)Also I added
examples/shaders/draw_shader_include.glsl
, an example file to test#include
.You can run it by
cargo run --example draw_shader_include --features shaderc
.NOTE: include directive only works on
include_fragment_shader!
/include_vertex_shader!
macros, not onfragment_shader!
/vertex_shader!
because it's difficult to determine the directory to search for the include files.