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>