1054: Flush write_texture staging memory r=kvark a=kvark
**Connections**
Fixes part of https://github.com/gfx-rs/wgpu-rs/issues/648
**Description**
Adds the missing flush to the staging buffer in `write_texture`
**Testing**
Untested
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
1051: Register init-destination buffer in the pending writes r=kvark a=kvark
**Connections**
Fixes#1049
**Description**
At some recent point we introduced the map of destination buffers for copies, and I missed the case where buffers are mapped at creation.
**Testing**
Tested on the test-case in #1049
Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
1050: player: use the wgpu-cores's gfx-select macro r=kvark a=kvark
**Connections**
Looks like I broke the player in #1034, surprised we didn't notice, and that `cargo test` still passed. The problem was having the `Empty` backend for the device.
**Description**
Fixes the `device` backend in the player, switches the backend set to be `PRIMARY`, and re-uses the `wgc::gfx-select`.
**Testing**
Replaying a trace from #1049
Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
1048: Make VertexFormat::size a const fn r=kvark a=Imberflur
**Connections**
Addresses #836
**Description**
The `vertex_attr_array!` macro uses this function. This change enables the macro to be used in `const` contexts and for instance allows returning a `VertexBufferDescriptor` constructed in function without having the difficulties of ensuring the array from `vertex_attr_array!` lives long enough.
**Testing**
I don't believe testing is needed for this.
<!--
Non-trivial functional changes would need to be tested through:
- [wgpu-rs](https://github.com/gfx-rs/wgpu-rs) - test the examples.
- [wgpu-native](https://github.com/gfx-rs/wgpu-native/) - check the generated C header for sanity.
Ideally, a PR needs to link to the draft PRs in these projects with relevant modifications.
See https://github.com/gfx-rs/wgpu/pull/666 for an example.
If you can add a unit/integration test here in `wgpu`, that would be best.
-->
Co-authored-by: Imbris <imbrisf@gmail.com>
639: Make BindingResource::TextureViewArray more flexible (addresses #588) r=grovesNL a=98devin
Fixes#588
Rather than having a field of `&[TextureView]`, which requires either keeping all TextureViews in a vector in the first place or moving them into a temporary vector or array and back, use `&[&TextureView]` instead. Obviates the need for hacky workarounds if you keep your TextureViews in non-contiguous structs, maps, or can't move them, etc.
For those using a vector previously, the required transformation is merely `.iter().collect()`.
Co-authored-by: Devin Hill <98devin@gmail.com>
635: Staging belt: do not panic by unwrapping send result in recall (fixes#634) r=kvark a=myfreeweb
Co-authored-by: Greg V <greg@unrelenting.technology>
1041: Update gpu-alloc and naga with linear allocation fixes r=kvark a=kvark
**Connections**
Fixes#1038
**Description**
Includes b807b5fb41
**Testing**
Tested on the API trace
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
615: Update web bindings r=kvark a=grovesNL
- Use newer buffer mapping API everywhere and remove polyfill.
- There's a weird thing here where we hand out `&[u8]`/`&mut [u8]`s for users to write into, but later have to copy back into the browser-provided `ArrayBuffer`. It's done during `Drop` here but open to some other ideas.
- Add in `web_sys::GpuTextureComponentType::DepthComparison` though it looks like we don't have it in Gecko yet:
> GPUDevice.createBindGroupLayout: 'depth-comparison' (value of 'textureComponentType' member of GPUBindGroupLayoutEntry) is not a valid value for enumeration GPUTextureComponentType.
- `mipmap` fails because `layout` is still required in Gecko:
> GPUDevice.createRenderPipeline: Missing required 'layout' member of GPUPipelineDescriptorBase.
- Add in some parts that we can implement now, including labels, debug markers, render bundles, and `get_bind_group_layout`
Co-authored-by: Joshua Groves <josh@joshgroves.com>
633: Port to the updated wgpu error model r=scoopr a=kvark
Depends on https://github.com/gfx-rs/wgpu/pull/1034
I removed most of the helping sugar we had before, in exchange for simple `match` and a `handle_error` function.
I believe this way it's easier to maintain and debug (stepping through closures is a pain today).
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
1034: Fearless object creation r=kvark a=kvark
**Connections**
Fixes#977Fixes#1032
**Description**
Requiring a separate `xxx_error()` is very convenient for `wgpu-core`, but getting repetitive and complicated for all the users of the API. This PR changes it so we return an object ID unconditionally, and sometimes it's an error. The actual error is passed on the side.
**Testing**
Tested on https://github.com/gfx-rs/wgpu-rs/pull/633
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
1037: Add Ids to PassErrorScope r=kvark a=scoopr
Also makes it pub, and the places it is used.
Tweak some error messages.
Co-authored-by: Mikko Lehtonen <scoopr@iki.fi>
1036: Stop using Borrow<RefCount> r=scoopr a=kvark
**Connections**
Follow-up to #931
**Description**
Takes advantage of the new `trait Resource` in the state tracker, reducing the code.
**Testing**
Not tested outside of `cargo test`
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
631: Temporarily use `BackendBit::PRIMARY` in examples r=kvark a=grovesNL
`BackendBit::all()` allows GL/surfman to be used on macOS which appears to prevent rendering with Metal (e.g. hello-triangle displays an empty window).
surfman will be removed in later versions of gfx, which will allow us to switch back to `BackendBit::all()` in the examples.
Co-authored-by: Joshua Groves <josh@joshgroves.com>
`BackendBit::all()` allows GL/surfman to be used on macOS which appears
to prevent rendering with Metal (e.g. hello-triangle displays an empty
window).
surfman will be removed in later versions of gfx, which will allow us
to switch back to `BackendBit::all()` in the examples.