Commit Graph

979 Commits

Author SHA1 Message Date
Jay Oster
5daef9acc2 Remove unnecessary features 2020-05-29 05:25:03 -07:00
Jay Oster
09328ec2eb Make libx11 optional 2020-05-27 21:05:53 -07:00
bors[bot]
4c136418ff Merge #667
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>
2020-05-26 22:23:31 +00:00
bors[bot]
6650b94ff6 Merge #668
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>
2020-05-26 21:26:15 +00:00
AlphaModder
e89c3d6b1c Alter swap_chain_get_next_texture to bubble up failures to the user. 2020-05-26 14:15:22 -07:00
bors[bot]
8034a17a72 Merge #672
672: Minor fixes in Gecko r=gecko a=kvark

Fixes requested in https://phabricator.services.mozilla.com/D73333

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2020-05-26 20:42:00 +00:00
Dzmitry Malyshau
79eb7b9c17 Minor fixes in Gecko 2020-05-26 16:41:24 -04:00
David Peicho
96bdaa2a9f storage: add attribute to pretty-print invalid resource usage 2020-05-26 18:46:10 +01:00
Paul Kernfeld
d529526e7f "Use the whole buffer" is !0, not 0 (#663)
* "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>
2020-05-26 13:25:06 -04:00
bors[bot]
f81638b4dd Merge #670
670: Switch CI to an older nightly for now, fix templates a bit r=kvark a=kvark



Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-05-26 14:05:53 +00:00
Dzmitry Malyshau
65b1568305 Switch CI to an older nightly for now, fix templates a bit 2020-05-26 10:01:11 -04:00
Dzmitry Malyshau
4e1d76013c Add missing repr(C) on copy views 2020-05-26 09:35:09 -04:00
Dzmitry Malyshau
e4659b6d05 Bring back BufferCopyView 2020-05-26 00:15:09 -04:00
Dzmitry Malyshau
679dba044b Remove array layers from texture copies 2020-05-26 00:15:09 -04:00
Dzmitry Malyshau
dff37bb65d Move TextureDataLayout to wgpu-types 2020-05-26 00:15:09 -04:00
Dzmitry Malyshau
fcf1d2762d Use TextureDataLayout consistently 2020-05-26 00:15:09 -04:00
Dzmitry Malyshau
2695d64269 Share code between write_buffer and write_texture 2020-05-26 00:15:09 -04:00
Dzmitry Malyshau
a4ea5358ef Implement write_texture 2020-05-26 00:15:09 -04:00
Dzmitry Malyshau
70154373f8 Fix indirect buffer access flags 2020-05-22 16:25:09 -04:00
bors[bot]
a203333c3e Merge #660
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>
2020-05-18 16:02:36 +00:00
yanchith
58a60392c2 Fix possible out-of-bounds when trace log level enabled
Also, even when there was no out-of-bounds access, the log statement talked
about an incorrect submission index.
2020-05-17 12:17:36 +02:00
bors[bot]
000bf85a20 Merge #657
657: Vecmap and Readme update r=kvark a=kvark



Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2020-05-15 14:43:51 +00:00
Dzmitry Malyshau
7ce83ad1cd Small readme refactor 2020-05-15 10:41:28 -04:00
Dzmitry Malyshau
8b9ddbfbca Vecmap dependency update to 0.8.1 2020-05-15 10:41:20 -04:00
bors[bot]
2484d00321 Merge #655
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>
2020-05-13 13:56:46 +00:00
bors[bot]
a7200bb865 Merge #653
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>
2020-05-13 13:29:09 +00:00
skierpage
67142eb944 use unambigous ISO8601 format for dates
06-04-2020 is in the future for ~400 million people.
Oblig. XKCD https://xkcd.com/1179/ 😉
2020-05-12 16:06:19 -07:00
Dzmitry Malyshau
4c62b20282 Multiple fixes and clean ups.
- 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.
2020-05-11 14:07:02 -04:00
Dzmitry Malyshau
786ead9701 Destroy temporary buffers 2020-05-11 10:53:21 -04:00
Dzmitry Malyshau
35f2e8b70e Move queue logic into a submodule 2020-05-10 22:40:04 -04:00
Dzmitry Malyshau
ba8c2eae54 Implement Queue::write_buffer 2020-05-10 01:21:47 -04:00
bors[bot]
da4f9006a8 Merge #641
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>
2020-05-09 22:07:30 +00:00
Gabriel Majeri
f70f32af87 Add optional SPIR-V shader validation
# Conflicts:
#	Cargo.lock
2020-05-09 19:55:10 +03:00
bors[bot]
54c6f6751b Merge #645
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>
2020-05-06 18:10:43 +00:00
Paul Kernfeld
29a4cee002 Add a loom test for RefCount 2020-05-06 13:53:57 -04:00
bors[bot]
0df263fe3e Merge #649
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>
2020-05-06 17:44:52 +00:00
Dzmitry Malyshau
cf8513baf5 Proper maintenance of the command pools 2020-05-06 11:15:08 -04:00
Dzmitry Malyshau
4c448c3fc5 Add a way to destroy a pass by a mutable reference (#647) 2020-05-05 21:52:06 -04:00
bors[bot]
e2d713a0d9 Merge #643
643: Refactor create_surface a bit r=antonok-edm a=kvark



Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-05-05 15:25:41 +00:00
Dzmitry Malyshau
3e57c11260 Refactor create_surface a bit 2020-05-05 09:47:51 -04:00
bors[bot]
bee826e79d Merge #640
640: Save bind group layout inside pipeline layouts r=kvark a=kvark

Fixes #639

Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
2020-05-05 03:55:38 +00:00
Dzmitry Malyshau
fbc533bfee Save bind group layout inside pipeline layouts 2020-05-04 23:46:06 -04:00
bors[bot]
e2d59201fd Merge #351
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>
2020-05-04 20:41:25 +00:00
Anton Lazarev
29ce9a44cf Pass through raw-window-handle 2020-05-04 15:55:19 -04:00
bors[bot]
644949d945 Merge #637
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>
2020-05-04 03:47:15 +00:00
Dzmitry Malyshau
71d4f77ab8 Wait for idle before destroying swapchains 2020-05-03 23:39:05 -04:00
bors[bot]
1e43dafa4d Merge #636
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>
2020-05-04 02:35:14 +00:00
Dzmitry Malyshau
831d908663 Properly destroy swap chains 2020-05-03 22:13:43 -04:00
Dzmitry Malyshau
7a3fd709da Create issue templates 2020-05-02 22:39:48 -04:00
bors[bot]
48decb6d78 Merge #634
634: Make assertions more verbose in src/command r=kvark a=paulkernfeld

This contributes to #485

Co-authored-by: Paul Kernfeld <paulkernfeld@gmail.com>
2020-05-02 22:35:42 +00:00