Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Ray Tracing #3

Open
cheako opened this issue Mar 27, 2020 · 7 comments
Open

Ray Tracing #3

cheako opened this issue Mar 27, 2020 · 7 comments

Comments

@cheako
Copy link

cheako commented Mar 27, 2020

Any interest?

@coffeenotfound
Copy link

This crate seems pretty dead (last updated 3 years ago).
But if you're doing raytracing you might aswell compile spir-v shaders properly either at compile time or runtime with something like the shaderc Rust bindings

@cheako
Copy link
Author

cheako commented Mar 30, 2020

I couldn't figure out how to use shaderc at compile time.

@JakubKoralewski
Copy link

I couldn't figure out how to use shaderc at compile time.

I guess you can put the shader compilation inside build.rs?

@cheako
Copy link
Author

cheako commented Apr 1, 2020

@JakubKoralewski Why yes and alternatively build.rs can call a command line compiler. Neither solution addresses the same problems this crate does.
For example how does that inline glsl? With that solution the glsl would either be in build.rs or in separate files. It's not obvious how to have build.rs parse glsl out of *.rs source files.

@JakubKoralewski
Copy link

It's not obvious how to have build.rs parse glsl out of *.rs source files.

I don't understand what you mean by that.

For example how does that inline glsl? With that solution the glsl would either be in build.rs or in separate files.

You can look at this example of mine. I precompile all the .spv shaders in the shaders directory and save them with the added .spv extension.

In actual application code I use the include_bytes! macro like here, which will inline the bytes into the compiled binary.

Is that what you meant?

@cheako
Copy link
Author

cheako commented Apr 1, 2020

"Inline" rust code and glsl existing in a single file. That's what this crate does and the solution it offers that others don't.

@cheako
Copy link
Author

cheako commented Apr 2, 2020

Hence: I couldn't figure out how to use shaderc at compile time. At runtime shaderc is the obvious solution.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants