When multiple "replace" style transitions are happening,
we weren't properly retaining the "first" state, which
is required for proper stitching of command buffers.
This logic is fixed and fortified with a new set of
"change" and "merge" tests in the track module.
We were improperly detecting if a swapchain image has already
been used by a command buffer. In this case, we need to assume
that it's already in the PRESENT state.
553: Fix order of maintenace between submission tracking and buffer mapping. r=kvark a=kvark
Fixes https://github.com/gfx-rs/wgpu-rs/issues/237
Logic needs to have the following order:
1. we first wait for the device to finish
2. then we move some tracked resources from per-submission lists into the "ready to destroy" or "ready to map" lists.
3. then we handle mapping, which goes through "ready to map" lists
4. then we destroy everything for realz that needs to be
That order got broken with #547
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
550: Add check for bound pipeline r=kvark a=kunalmohan
fix#456
Validate that a pipeline is bound before issuing any draw/dispatch call.
Co-authored-by: Kunal Mohan <kunalmohan99@gmail.com>
540: Add serialization to more types r=kvark a=HeroesGrave
With these changes, pretty much everything in wgpu-types can be serialized with the exception of BufferDescriptor, CommandEncoderDescriptor, and TextureDescriptor which contain a `*const c_char`.
Options for dealing with those:
- Leave these types as not de/serializable
- Skip when serializing, deserialize as nullptr
- Serialize as a string, deserialize as nullptr
AFAICT there's not really a way to allow a full roundtrip for these fields because nul-terminated strings don't play nicely with serde. Maybe it could serialize as a byte array?
Co-authored-by: HeroesGrave <heroesgrave@gmail.com>
514: Move some types into shared wgpu-types crate r=kvark a=grovesNL
As we discussed a while ago, we need to be able to share some types between wgpu-core/wgpu-native/wgpu-remote/wgpu-rs.
The problem is that we want to avoid a dependency on wgpu-core and wgpu-native when building [wgpu-rs for the wasm32-unknown-unknown target](https://github.com/gfx-rs/wgpu-rs/issues/101). We can avoid this by moving all shared types into a separate crate which is exposed on all targets.
Let me know if we should use some other approach or organize the types somehow. This isn't complete yet, but it might be easier to integrate this over several PRs instead of diverging my branch too far.
Co-authored-by: Joshua Groves <josh@joshgroves.com>
480: Implement `enumerate_adapters`. r=kvark a=daxpedda
This is take two of #478, it's a much smaller change with less abstraction.
- implement `internal_enumerate_adapters`, which refactors `instance.{BACKEND}.enumerate_adapters()` out of `pick_adapter`
- implement `enumerate_adapters`, which just returns a vector of all GPUs in the form of `AdapterId`
Co-authored-by: daxpedda <daxpedda@gmail.com>