281: The Context trait r=grovesNL a=kvark
The main motivation here is to avoid blocking the wgpu-core updates by `wgpu-native`. Instead, `wgpu-native` becomes a branch, and the dependency of `wgpu-rs` -> `wgpu-native` starts adhering to the contract/API of the standard webgpu-native headers.
The biggest change is the introduction of the Context trait. I recall us discussing 2 downsides to having this trait:
1. inconvenient for the users to include. This is a non-issue here, since it's private.
2. more code to maintain. This is less of an issue if we aim to have 3 backends.
What this gives in return is a well established contract with the backends. Unlike gfx-rs, the backend code is right here, a part of the crate, so the contract is only for internal use.
Fixes#156 : the "direct" implementation of it goes straight to wgpu-core. What this gives us is less overhead for command recording, since there is no longer an extra indirection on every command, and no heap allocation at the end of a render pass.
The downside of this PR is one extra `Arc` (with addref) per object.
This commit also has small improvements:
- consuming command buffers on submit (Fixes#267)
- Instance type
- proper call to destructors
- fallible `request_device`
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
Main change here is the introduction of the Context trait.
The "direct" implementation of it goes straight to wgpu-core.
This commit also has small improvements:
- consuming command buffers on submit
- Instance type
- proper call to destructors
When looking into wgpu-rs as a replacement for WebGL I went to the
examples directory on GitHub to browse for a bit.
I wanted to see some of the examples at a glance without needing to
clone the repository.
This commit enables that by adding a README to each example with a
description of the example and screenshots / example output.
In a few cases the description is a bit redundant - but my hope is that
in the future we can improve all the READMEs.
Being a web API and thus very accessible, WebGPU could end up being many
people's first introduction to graphics programming so the lower we make
the barrier the better.
271: Improve docs for BindingType r=kvark a=HalfVoxel
I think everything should be correct.
The readonly flags seem obvious at face value, but I couldn't find anything in the specifications about them (other than some unrelated validation), so I didn't add any documentation for those fields.
Co-authored-by: Aron Granberg <aron.granberg@gmail.com>
262: Reverse srgb in hello-triangle r=kvark a=grovesNL
Reverse srgb support in hello-triangle (these were backwards by mistake)
Co-authored-by: Joshua Groves <josh@joshgroves.com>
264: Use opaque texels in mipmap example r=kvark a=grovesNL
This fixes rendering for the mipmap example in Nightly
Co-authored-by: Joshua Groves <josh@joshgroves.com>
`File::create` isn't available on wasm, so we can't actually write the
output image anywhere unless we target something else as the file
system (e.g. local storage)
259: Remove zerocopy and replace with bytemuck. r=kvark a=StarArawn
fixes#146
I've removed `zerocopy` from the examples and replaced it with `bytemuck`. I ran all of the examples/tests and everything ran great in vulkan on my windows box.
Co-authored-by: StarToaster <startoaster23@gmail.com>
251: cargo fmt the code and tweak format rules r=kvark a=chao-mu
Ran cargo fmt after removing rules per @kvark, two of which were because they needed nightly to run.
Co-authored-by: Hackpoetic <chao-mu@hackpoetic.com>