479: Split framework limit situation into requested/required r=kvark a=cwfitzgerald
Requiring individual examples be responsible for panicing if their features aren't supported is a bit bug-prone, so this encodes requirements in the framework and enforces it in the framework.
Additionally made the verbs consistent.
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
475: Made RenderBundleEncoder derive Debug r=kvark a=Andful
This is a continuation of the pull request #466 and should resolve the issue #458.
Co-authored-by: Andrea Nardi <buongiorno19972@gmail.com>
466: add debug trait for public types r=kvark a=Andful
This pull request is to resolve the issue #458.
This pull request is still incomplete. The only problematic trait is `RenderBundleEncoder`.
For the native version, `RenderBundleEncoder` does not implement `Debug`. This would have to be implemented in the wgpu project.
FYI, Context does not need to implement `Debug`. The type that implements `Context` is used directly, i.e. `Arc<C>` is used and not `Arc<dyn Context>`
Co-authored-by: Andrea Nardi <buongiorno19972@gmail.com>
442: replace vertex_format_size macro with VertexFormat size function r=kvark a=bootra-dev
This pull request depends on https://github.com/gfx-rs/wgpu/pull/802
I'm not sure if multiple pull requests is the right way to handle this - let me know if I need to use another workflow.
Co-authored-by: bootra-dev <bootragames@gmail.com>
453: Added Static Lifetime to Statically Loaded SPIR-V Modules r=kvark a=Andful
The commit enables `include_spirv!` to return a `ShaderModuleSource<'static>`.
This allows `ShaderModuleSource` to outlive the context in which `include_spirv!` was called in.
An example where this implementation would work but the previews would not is the following.
```rust
fn get_vertex_module<'a>() -> wgpu::ShaderModuleSource<'a> {
wgpu::include_spirv!("shader.vert.spv")
}
let vs_module = device.create_shader_module(get_vertex_module());
```
Also it makes logical sense for a statically loaded module to have a static lifetime.
The only downside that this change might bring is the redundant presence of the binary string (the non aligned binary string and the aligned binary string) but from the produced assembly I could only find one copy of the binary string so I don't think this is the case.
Co-authored-by: Andrea Nardi <buongiorno19972@gmail.com>
452: Update to latest wgpu r=kvark a=rukai
public API changes:
* get_next_frame -> get_current_frame to better reflect the name of webgpu api being called.
Co-authored-by: Rukai <rubickent@gmail.com>
455: Fix early logging in the examples r=kvark a=yzsolt
Fix early logging in the examples by moving logger initialization from `start` into `setup`.
Note: I haven't actually checked this on the WASM target, but it should probably be fine.
Co-authored-by: Zsolt Bölöny <bolony.zsolt@gmail.com>
447: Remove Lifetimes from Push Constants r=kvark a=cwfitzgerald
This is sound because for render passes, compute passes, and render bundles we immediately copy the data into an internal buffer then refer to the data by offset into the buffer.
This also cleans up the example a bit as we don't need the array to outlive the statement.
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
443: Implement typical Error traits for SwapChainError r=kvark a=DasEtwas
Added Display and Error implementation for SwapChainError, imported Display and Error more nicely for the existing errors.
Co-authored-by: DasEtwas <18222134+DasEtwas@users.noreply.github.com>
439: Update to latest `wgpu-core` r=kvark a=GabrielMajeri
Pull in some of the latest changes from the `wgpu` repo
Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
441: Impl Error for Error types r=kvark a=cwfitzgerald
I believe these are the only two results the api returns.
thiserror seems like a big hammer for such a small job, especially as all wgpu-core errors are unwrapped by wgpu-rs. Lets keep doing log + error as we are now for all the rest. Keep our dep on syn off.
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
434: recreate swapchain on framework.rs examples on resize, ref #352 r=kvark,cwfitzgerald a=m4b
There still seem to be residual race condition like errors w.r.t. resizing on at least x11, but this does fix the panic on x11.
Co-authored-by: m4b <m4b.github.io@gmail.com>
433: make env_logger a dev dependency r=kvark a=cart
env_logger is only used in examples and adds a good number of dependencies to the build tree that arent needed
Co-authored-by: Carter Anderson <mcanders1@gmail.com>