Comments (4)
Look who has cargo-gpu
on crates.io...a couple steps ahead of you 😄
from rust-gpu.
See https://doc.rust-lang.org/cargo/reference/manifest.html#the-metadata-table
With [package.metadata.rust-gpu.*]
we could configure anything beyond what we can with just dependencies.
And you have to keep in mind that we can't remove the spirv-std
dependency being explicit for several reasons (e.g. users wanting to compile common code, or even the entire shader, as a regular dependency of host code, or me wanting to have access to the breadth of Cargo path/git dependency/override specifiers.
from rust-gpu.
Food for thought, though I don't want this to be come like JS where every tool has its own config file, having a GPU.toml
or whatever might be a better route.
from rust-gpu.
krnl has krnlc, which includes rustc_codgen_spirv into the binary and at runtime copies it back to the target dir. I found I had to sym link the rust sys root libs as well. So that's a working example of a cli instead of a builder / build script.
It does something similar to what @eddyb describes with spirv-std, krnl has krnl-core which links to spirv-std, and krnlc looks for krnl-core via cargo_metadata, checks that the version is compatible, and copies that dependency into the generated Cargo.toml for the device crate. This ensures that host and device crates have identical krnl-core / krnl-macros versions. Macros are used to generate host / device bindings, so identical versions means that the private interface can be unstable.
One thing that is somewhat awkward is needing to install krnlc with a specific nightly version, so that it isn't as easy to update and it's more cumbersome to mix two different versions. The spirv-builder dependency means krnlc has to have its own workspace.
Considering that rust-gpu requires a specific nightly, I'm not sure it would make sense to have something like krnlc be installable on stable or even just nightly, but it could. So if rust-gpu handled installing the required nightly + components + rustc_codegen_spirv, that makes it easier for other tools like krnlc or naga to use it.
from rust-gpu.
Related Issues (20)
- Using `arch::ignore_intersection` causes shader compilation to fail
- Infrastructure for using ShaderToy as a test corpus HOT 5
- Ported shadertoy shader runs very slow (fractal pyramid) HOT 5
- Unable to build rustc_codegen_spirv with nightly 2023-09-30 HOT 5
- Improve documentation to include visual of what example app should look like? HOT 2
- Conditionals and code generation performance HOT 3
- Cargo component not available with nightly 2023-05-27 which is publicised on crates.io
- adding spirv-std anywhere in the worskspace, slows down the CPU code due to libm feature
- Compile with Proc Macro HOT 2
- Large array variable initialization (`let arr = [0; 32 * 1024];`) compiles very slowly. HOT 2
- Inliner->`mem2reg` can quadratically amplify already-exponential inlining (turning seconds into minutes).
- Make error messages more human HOT 1
- Warn (or error) on a non-pub entrypoint HOT 1
- spirv-tools: Assertion `env != SPV_ENV_WEBGPU_0' failed.(my bug report)
- Allow to compile rust-builder as a static c library with the builder calls exported
- Allow for dynamic indexing of texture arrays. HOT 3
- Operator Overlaoding support HOT 2
- Compiling uom crashes the compiler
- spirv_builder sometimes cannot find symbols
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust-gpu.