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>
637: Wait for idle before destroying swapchains r=kvark a=kvark
Follow up to #636
I was trying to address the D3D12 error in https://github.com/gfx-rs/gfx/issues/3242
The debug messages complain about a resource being used by the queue while it's being destroyed. I thought forcing a wait there would help, but it does not. I think it's still a good change to land though.
In the meantime, I wonder if it considers the swapchain to be used because it's currently presented. Could be something else I'm missing here.
Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
636: Properly destroy swap chains r=kvark a=kvark
This is the last piece of the cleanup puzzle, I think, as closing an example becomes fully validation-free 🎉
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
634: Make assertions more verbose in src/command r=kvark a=paulkernfeld
This contributes to #485
Co-authored-by: Paul Kernfeld <paulkernfeld@gmail.com>