Code Monkey home page Code Monkey logo

Comments (7)

coffeenotfound avatar coffeenotfound commented on June 1, 2024

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

from glsl-to-spirv-macros.

cheako avatar cheako commented on June 1, 2024

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

from glsl-to-spirv-macros.

JakubKoralewski avatar JakubKoralewski commented on June 1, 2024

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

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

from glsl-to-spirv-macros.

cheako avatar cheako commented on June 1, 2024

@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.

from glsl-to-spirv-macros.

JakubKoralewski avatar JakubKoralewski commented on June 1, 2024

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?

from glsl-to-spirv-macros.

cheako avatar cheako commented on June 1, 2024

"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.

from glsl-to-spirv-macros.

cheako avatar cheako commented on June 1, 2024

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

from glsl-to-spirv-macros.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.