688: Fix recycling of command buffers r=kvark a=kvark
**Connections**
Fixes https://github.com/gfx-rs/wgpu-rs/issues/333
**Description**
We used `lowest_common_submission()` for figuring out when to reset command buffers, but it returns !0 when there are no active submissions. Instead, we are using the exising "last done" semantics here, which works better.
**Testing**
Tested on wgpu-rs examples.
Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
686: Move BufferSize to wgpu-types r=kvark a=kvark
This is required to be able to update wgpu-rs, since it uses `BufferSize` in the internal API for its backends.
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
678: Make libx11 optional r=kvark a=parasyte
**Connections**
Fixes#676
**Description**
Make `libx11` optional with a new non-default feature. Default features need to go "to the edge". In its current state, a crate depending on `wgpu` cannot disable the `x11` feature on `gfx-backend-vulkan`.
- `wgpu` will be updated with a similar new feature, but will enable the `wgc/x11` feature by default. This should hopefully be backward compatible for any downstream user of `wgpu`.
- `wgpu-native` will also be given the same treatment.
**Testing**
This was tested with repro steps included in the linked ticket.
Co-authored-by: Jay Oster <jay@kodewerx.org>
667: Add asserts to validate that a resource exists when used r=kvark a=DavidPeicho
Hi,
As discussed in #610, this is mostly for C/C++ users. Some questions:
* Would it be possible to display the ID of the resource that failed? I don't know what you think about implementing the `Display` trait on the `Id` struct?
* Do you see other places needing for checks?
Thanks!
Co-authored-by: David Peicho <david.peicho@gmail.com>
668: Return failures to the user in swap_chain_get_next_texture, rather than transparently reconfiguring. r=kvark a=AlphaModder
TODO:
- [x] Change `Global::swap_chain_get_next_texture` in `wgpu-core`.
- [x] Update `wgpu_swap_chain_get_next_texture` in `wgpu-native`. (https://github.com/gfx-rs/wgpu-native/pull/32)
- [x] Wrap `SwapChainOutput`/`SwapChainStatus` in a nice enum in `wgpu-rs`. (https://github.com/gfx-rs/wgpu-rs/pull/323)
- [ ] Update `wgpu_bindings` (?)
Co-authored-by: AlphaModder <quasiflux@gmail.com>
* "Use the whole buffer" is !0, not 0
Fixes#654
Applies to BufferBinding, set_vertex_buffer, set_index_buffer
* Add BufferSize type alias
* Make BufferSize a transparent type
Add a custom serialization "buddy" type
Use BufferSize::WHOLE instead of crate::WHOLE_SIZE
* Move SerBufferSize into device::trace mod
Co-authored-by: Paul Kernfeld <paulkernfeld@gmail.com>
660: Fix possible out-of-bounds when trace log level enabled r=kvark a=yanchith
Also, even when there was no out-of-bounds access, the log statement talked
about an incorrect submission index.
Fixes https://github.com/gfx-rs/wgpu/issues/659
Co-authored-by: yanchith <yanchi.toth@gmail.com>
655: use unambigous ISO8601 format for dates r=kvark a=skierpage
06-04-2020 is in the future (June) for ~400 million people.
Oblig. XKCD https://xkcd.com/1179/😉
Co-authored-by: skierpage <info@skierpage.com>
653: Implement Queue::write_buffer r=nobody a=kvark
Implements https://github.com/gpuweb/gpuweb/pull/749
TODO:
- [x] handle a case where the buffer is dropped while there is a pending write. Edit: we bump the submission index on the buffer, so it will be kept alive.
- [x] properly free the temporary buffer and memory
- [x] properly destroy the pending command buffer on device drop
- [x] tweak the linear allocator settings - bumped to 16 megs
- [x] provide a patch to wgpu-rs and verify it works on the examples - https://github.com/gfx-rs/wgpu-rs/pull/307
- [x] provide a patch to wgpu-native - https://github.com/gfx-rs/wgpu-native/pull/25
- [x] check/fix the trace/replay support
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
- Clean up after the pending writes on destroy.
- Fix temporary buffer creation.
- Fix internal thread initialization by the command allocator.
- Clean up player event_loop usage.
641: Add optional SPIR-V shader validation r=kvark a=GabrielMajeri
This PR adds some basic validation for SPIR-V shaders when creating pipelines. Starts work towards #269.
Currently, I'm marking this as a draft because `naga` isn't mature enough to be able to parse shaders from the `wgpu-rs` examples.
For example:
- Trying to run `hello-triangle` from `wgpu-rs` results in the following error:
`Failed to parse shader SPIR-V code: UnsupportedInstruction(Function, Variable)`
- For `hello-compute` it is:
`Failed to parse shader SPIR-V code: UnsupportedInstruction(Type, TypeBool)`
Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
645: Add a loom test for RefCount r=kvark a=paulkernfeld
A first effort at gfx-rs/wgpu-rs#96
loom testing is gated behind cfg(loom)
Co-authored-by: Paul Kernfeld <paulkernfeld@gmail.com>
649: Proper maintenance of the command pools r=cart a=kvark
Fixes#648
This brings the memory consumption on the multi-threaded cube to constant 50Mb.
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
351: Optionally support XCB windows on Unix r=kvark a=antonok-edm
`gfx-hal` supports XCB windows on Unix platforms, but it can't be used through `wgpu`. I added a new `xcb` feature to enable that support. `x11` support is now enabled using a default feature to remain backwards compatible.
Co-authored-by: Anton Lazarev <antonok35@gmail.com>