Comments (9)
I can't confirm right now but I believe we don't assume any backend by default, so you'll need to specify cargo build --features metal
or cargo build --features gfx-backend-metal
depending on which crate you build.
We could probably provide an error when no backend has been selected.
from wgpu.
To clarify my understanding, is it correct to say that I've compiled wgpu with no backend, and then the C code calls correctly into the rust library which was compiled incorrectly?
That's right, the library needs to be compiled with a particular backend specified (most functions will fail when they hit an unimplemented
somewhere).
The Makefile is probably out of date because it existed before we switched to cmake for the C example.
I also don't see gfx-backend-metal in the features section of wgpu-native's Cargo.toml
I don't think this should be required because it's an optional crate (i.e. --features gfx-backend-metal
should work).
You should be able to run the command (including all of the cd
s) we just added to Travis: https://github.com/gfx-rs/wgpu/blob/master/.travis.yml#L47 I also forgot to mention the local
flag when building wgpu-native directly.
Edit: We also have a Gitter to chat if it's easier to discuss there.
from wgpu.
Brilliant! The command from travis builds a binary that works on my machine.
Thanks so much for being so responsive on this. Now I can start experimenting against the C API.
from wgpu.
I suspected it was something to do with selecting a backend. To clarify my understanding, is it correct to say that I've compiled wgpu with no backend, and then the C code calls correctly into the rust library which was compiled incorrectly?
from wgpu.
I've just cloned a fresh copy of the repo and built with cargo build --features metal
using the same repro steps above and am getting the same error.
from wgpu.
In addition, running the following from the root of a fresh copy of the repo:
make lib-native
cd examples/hello_triangle_c/
cmake .
make hello_triangle
./hello_triangle
Results in a Segmentation fault: 11
from wgpu.
I also don't see gfx-backend-metal
in the features section of wgpu-native
's Cargo.toml, which could explain why the conditional compilation of the metal backend is working for the rust example but not the C one.
from wgpu.
@cshenton don't hesitate to visit us on gitter or elsewhere! We'd be happy to showcase your screenshots in the gallery.
from wgpu.
The link provided above by grovesNL
no longer works, but I believe it refers to this line found here in 508b724.
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then (brew update && brew upgrade cmake && brew install glfw3 && cd wgpu-native && cargo build --features=local,gfx-backend-metal && cd ../examples/hello_triangle_c && mkdir build && cd build && cmake .. && make); fi
However, it seems such a long ago answer is no longer applicable if one faces the same issue in 2023 or onwards, at least in my own experience that's the case.
from wgpu.
Related Issues (20)
- can't compile compute shader HOT 8
- Setting a pipeline-overridable shader constant to `f64::INFINITY` results in a crash on certain platforms HOT 4
- In OpenGL backend, attempting to render to a multisampled texture with the usages `RENDER_ATTACHMENT | TEXTURE_BINDING` fails HOT 5
- Using `@builtin(sample_mask)` in a fragment shader with OpenGL panics due to a naga translation error HOT 1
- Restrict usage of `f64` with some built-in functions HOT 2
- Maximum dynamic offset limit is incorrect per the spec HOT 6
- get_bind_group_layout fails when layout is auto HOT 1
- Memory write concurrency guarantees HOT 1
- regression: compute example doesn't work on wayland HOT 12
- Mip level support with Metal not working? HOT 1
- Enable `clippy::tests_outside_test_module` lint HOT 2
- Took more than 10minutes to create compute pipeline on Linux HOT 6
- BufferAsyncError in webassembly (Linux only) HOT 2
- Support `first` and `either` interpolation sampling
- 0u64 has been mutated to a wierd value after transferring to webgpu then copy back (Webassembly only) HOT 1
- NotSupported(NotSupportedError) when attempting to run example HOT 1
- Sometimes cannot create compute pipeline HOT 1
- Unable to pass a pointer to a struct field as a function argument HOT 1
- Expose the translation units and parsers for naga frontends HOT 1
- BindGroupLayout[Id(0,1,mtl)] does not exist (recreating the same wgpu::Device)
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 wgpu.