825: Add depth clamping support r=cwfitzgerald a=kvark
**Connections**
Implements https://github.com/gpuweb/gpuweb/pull/900
**Description**
Depth clamping is useful for shadow mapping and stuff. We'd want to use it in our `shadow` example.
**Testing**
Untested, should work though :)
Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
824: Naga update, remove spirv_headers dependency r=cwfitzgerald a=kvark
**Connections**
Many changes went into Naga, including https://github.com/gfx-rs/naga/pull/81
**Description**
We'll get better SPIR-V parsing and even a bit of WGSL validation.
**Testing**
Working on it...
Co-authored-by: Dzmitry Malyshau <kvarkus@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>
* Replace &[T] in descriptor structs with Cow<[T]>
* Changed label fields to use Cow<'a, str>
* Deduplicate types across the tracing API
Introduce the ToStatic trait
* Deduplicate trace::RenderBundleDescriptor
* Remove ugly ToOwned bounds
* Simplifiy Action variants
* Make Clone bounds on type defs less verbose
* Fix a error in play.rs
* Remove ToStatic, and Make Action<'a> borrow descriptors instead
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>
816: Error types for buffer mapping API r=kvark a=GabrielMajeri
**Connections**
Part of #638
**Description**
Adds safe error handling for buffer mapping/unmapping functions.
**Testing**
Checked with core, and ran tests with player.
Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
819: swap_chain_present returns SwapChainStatus r=kvark a=rukai
**Connections**
Needed by https://github.com/gfx-rs/wgpu-rs/pull/452
**Description**
For `swap_chain_present` moves the PresentError cases out of the Err and into the Ok.
This means we can `.unwrap()` the result in wgpu and it will only panic on an error that the user cant handle.
**Testing**
Ran the wgpu-rs examples.
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>
814: Error type for texture creation r=kvark a=GabrielMajeri
**Connections**
Part of #638
**Description**
Creates an error type for texture creation functions.
**Testing**
Checked with core and player.
Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
813: Add buffer creation error type r=kvark a=GabrielMajeri
**Connections**
Part of #638
**Description**
Adds an error type for the buffer creation functions.
**Testing**
Checked with core and ran test on player.
Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
815: Remove error logging from `binding_model` r=kvark a=GabrielMajeri
**Connections**
Part of #638
**Description**
Removes some `log::error!` calls from `binding_model.rs`, instead encoding the messages in the error type.
**Testing**
Checked with core.
Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
812: Error type for `WaitIdle` r=kvark a=GabrielMajeri
**Connections**
Part of #638
**Description**
Adds an error type for the `wait_idle` function.
**Testing**
Checked with core.
Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
811: Error type for `command_encoder_finish` r=kvark a=GabrielMajeri
**Connections**
Part of #638
**Description**
Makes `command_encoder_finish` return an error type.
**Testing**
Checked with core.
Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
810: Convert the existing error types to `thiserror` r=kvark a=GabrielMajeri
**Connections**
Part of #638
**Description**
Converts the crate's existing error types from a manual `Display` implementation to using `thiserror`.
**Testing**
Tested with core and `wgpu-rs`.
Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
809: Safe error handling for swap chain r=kvark a=GabrielMajeri
**Connections**
Part of #638
**Description**
Error types for swap chain functions, using `thiserror` to avoid boilerplate code.
**Testing**
Checked with core and player.
Co-authored-by: Gabriel Majeri <gabriel.majeri6@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>
808: Use `thiserror` for validation module r=kvark a=GabrielMajeri
**Connections**
Part of #638
**Description**
_Describe what problem this is solving, and how it's solved._
**Testing**
Checked with core repo. This doesn't change any code, just adds an `Error`/`Display` implementation.
Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
803: Player-based GPU test framework r=cwfitzgerald a=kvark
**Connections**
Closes#786
**Description**
This change adds a GPU-based testing by re-using the Player from tracing infrastructure - #289.
It converts the player into a lib + binary, and adds an integration test into the crate that implements RON-specified testing.
Current implementation has a few requirements/gotchas that are listed in `test.rs`:
* in all the IDs, the backend is `Empty`
* all expected buffers have `MAP_READ` usage on them
* last action is `Submit`
I believe it's workable, and we can improve it down the road (e.g. with #792).
**Testing**
MUHAHAHA
`cargo test` nails it
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
806: Fix rods error check - fixes water example r=kvark a=rukai
**Description**
Fixes water example panic
**Testing**
Tested on every wgpu-rs example
Co-authored-by: Rukai <rubickent@gmail.com>