824: make all labels use `wgpu::Label` r=kvark a=LU15W1R7H
This PR does a very minor change.
It replaces all occurences of `label: Option<'a str>` with `label: crate::Label`,
making the usage consistent all across the API.
This doesn't bring any benefit other than consistency.
I hope to have catched every occurance.
Co-authored-by: Luis Wirth <lwirth2000@gmail.com>
1291: Add color blend modes r=kvark a=cwfitzgerald
Continuation of #1289, because apparently you can't re-open an accidentally closed pull request if you force pushed...
Should be GTG.
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
823: Fix crash-on-resize in skybox example r=kvark a=danwilhelm
Problem: Skybox example currently crashes on resize.
- Solution: Now, recreates depth texture on resize event.
---
Problem: Shadow example currently duplicates texture creation code on resize.
- Solution: Now, shadow is refactored identically to skybox & water examples -- minimizes code duplication, makes examples more similar.
Co-authored-by: Dan Wilhelm <dan@danwilhelm.com>
819: Boost texels alpha channel in cube example. r=kvark a=VincentFTS
Permits to have a good rendering for WebGL.
822: Update wasm-bindgen and web-sys to latest r=kvark a=grovesNL
#821 for `master`
On `master` it should be ok to update wasm-bindgen and web-sys, so we don't need to fix syn's version
Co-authored-by: VincentFTS <platforms@ftsoftware.fr>
Co-authored-by: Joshua Groves <josh@joshgroves.com>
814: Update to latest wgpu, naga, gfx. r=kvark a=Gordon-F
Update to latest wgpu, naga, gfx and enable `EXPERIMENTAL_TRANSLATION` with GL backend for `boids`, `cube` and `hello-compute`.
Co-authored-by: Gordon-F <ishaposhnik@icloud.com>
813: Fix dropping for command encoders r=grovesNL a=kvark
We weren't dropping them properly, and since the ID is just an obfuscated `Box<RealStuff>` that made the contents leak.
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
1281: Rename `level_count` to `mip_level_count` r=kvark a=grovesNL
**Description**
This PR renames `level_count` to `mip_level_count` on `TextureViewDescriptor`. This follows the naming in the specification, located at https://gpuweb.github.io/gpuweb/#texture-view-creation
**Testing**
`cargo build` and `cargo test` only, naming changes will be made downstream in wgpu-rs too.
Co-authored-by: Joshua Groves <josh@joshgroves.com>
1276: Align create_swap_chain function signature r=cwfitzgerald a=kvark
**Connections**
Follow-up to #1034
**Description**
Swapchains are a bit special. Browsers don't use wgpu-core's swapchains, so we never bothered to convert them into the error model. But we still need this for Deno and webgpu-headers.
**Testing**
Untested, but also harmless
Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
809: Add overflow detection to hello-compute r=kvark a=danwilhelm
Description
The `hello-compute` example sometimes gives incorrect results if an intermediate Collatz value overflows.
Proposed Solution
We can detect overflows before they occur, since the `3n+1` step is the only possible overflow. (WGSL only supports u32.)
Example
`cargo run --example hello-compute 77031 837799 8400511 63728127`
> Incorrect Current Output: `[350, 524, 312, 346]`
> Correct Output: `[350, 524, 685, 949]`
> Proposed Solution: `[350, 524, OVERFLOW, OVERFLOW]`
Notes
- The `hello-compute` example appears to be [borrowed from naga](https://github.com/gfx-rs/naga/blob/master/tests/in/collatz.wgsl), so this would cause the implementations to differ.
- Hexadecimal literals are not yet implemented in naga for WGSL shaders, so the shader literals are not as pretty as they could be.
- Revised terminology `times` -> `steps` to be consistent with [Wikipedia](https://en.wikipedia.org/wiki/Collatz_conjecture).
Co-authored-by: Dan Wilhelm <dan@danwilhelm.com>
1280: Rename color/depth attachments to match spec r=kvark a=grovesNL
**Description**
- Rename `ColorAttachmentDescriptor` to `RenderPassColorAttachment` (https://gpuweb.github.io/gpuweb/#color-attachments)
- Rename `DepthStencilAttachmentDescriptor` to `RenderPassDepthStencilAttachment` (https://gpuweb.github.io/gpuweb/#depth-stencil-attachments)
- Rename `attachment` fields on both attachments to `view`
**Testing**
None (just `cargo build`) because the renaming downstream should be trivial.
Co-authored-by: Joshua Groves <josh@joshgroves.com>
- Rename `ColorAttachmentDescriptor` to `RenderPassColorAttachment`
- Rename `DepthStencilAttachmentDescriptor` to `RenderPassDepthStencilAttachment`
- Rename `attachment` fields on both attachments to `view`
1279: Fix some typos r=kvark a=grovesNL
**Description**
Fix a few small typos in doc comments
**Testing**
None
Co-authored-by: Joshua Groves <josh@joshgroves.com>
1278: Rename copy views and layout to match spec r=kvark a=grovesNL
**Description**
Match the specification naming changes from https://github.com/gpuweb/gpuweb/pull/1375
**Testing**
None because the changes downstream to wgpu-rs and wgpu-native should be trivial (renaming only)
Co-authored-by: Joshua Groves <josh@joshgroves.com>
1275: rows_per_image & rows_per_image are now optional r=kvark a=Wumpf
Fixes#988
Was surprisingly hard, hope it's correct; testing could be more extensive...
Ideas for more elegant handling very welcome.
**Testing**
Tested against wgpu-rs samples
Co-authored-by: Andreas Reich <r_andreas2@web.de>
806: Remove "how to compile the shaders" section on README r=kvark a=yutannihilation
I believe all the examples now use WGSL, so this section is no longer needed.
Co-authored-by: Hiroaki Yutani <yutani.ini@gmail.com>