Commit Graph

2761 Commits

Author SHA1 Message Date
AlphaModder
c538a53cf0 [rs] Rename SwapChain::get_next_texture to SwapChain::get_next_frame, and have it return errors to the user. 2020-05-30 18:41:31 -07:00
bors[bot]
a6d468086d Merge #686
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>
2020-05-30 05:20:58 +00:00
Dzmitry Malyshau
7181bfe977 Move BufferSize to wgpu-types 2020-05-30 01:19:42 -04:00
bors[bot]
f0ccd9d81f [rs] Merge #330
330: Add equality derives to `BindGroupLayoutEntry` r=kvark a=Kimundi



Co-authored-by: Marvin Löbel <loebel.marvin@gmail.com>
2020-05-29 21:03:01 +00:00
Marvin Löbel
de5ef8f1f2 [rs] Add equality derives to BindGroupLayoutEntry 2020-05-29 22:55:21 +02:00
bors[bot]
1a6d92fabc Merge #678
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>
2020-05-29 19:43:49 +00:00
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]
605fe735b6 [rs] Merge #321
321: Update wgpu and use write_texture r=grovesNL a=kvark

Depends on https://github.com/gfx-rs/wgpu/pull/666

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-05-26 14:15:51 +00:00
Dzmitry Malyshau
09d8e4b64c [rs] Update wgpu and use write_texture 2020-05-26 10:10:32 -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
bors[bot]
bd4804b88a [rs] Merge #320
320: Fix typo in Friends section of README r=kvark a=jakbyte



Co-authored-by: jakbyte <jakbyte@protonmail.com>
2020-05-23 15:01:49 +00:00
jakbyte
239be51348 [rs] Fix typo in Friends section of README 2020-05-22 17:24:39 -04:00
Dzmitry Malyshau
70154373f8 Fix indirect buffer access flags 2020-05-22 16:25:09 -04:00
bors[bot]
d8e2f384f3 [rs] Merge #315
315: Update wgpu-core rev r=urgent a=kvark

Fixes #314 

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-05-18 16:11:53 +00:00
Dzmitry Malyshau
0b124826a4 [rs] Update wgpu-core rev 2020-05-18 12:11:02 -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]
9691649fc5 [rs] Merge #311
311: Read WGPU_TRACE environment in the examples r=kvark a=kvark



Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2020-05-15 21:50:15 +00:00
Dzmitry Malyshau
07fb340ec4 [rs] Read WGPU_TRACE environment in the examples 2020-05-15 17:49:16 -04: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
Dzmitry Malyshau
cfd17fdcbd [rs] Disable GHA deploy temporarily 2020-05-14 10:12:47 -04:00
Dzmitry Malyshau
c548050b47 [rs] Update wgpu and use write_buffer in the examples 2020-05-14 10:12:47 -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
bors[bot]
fe904b0706 [rs] Merge #306
306: Improve example friendliness: Don't busy-redraw in examples r=kvark a=khoek

Looking around for solid Rust graphics libraries, I was a bit shocked when the `wgpu-rs` examples made my whole X desktop environment in Ubuntu laggy---maximizing/minimizing other windows or moving any of them had very noticeable latency when an example was running.

This almost turned me off, but after playing around I found that this was just because of the
```rust
match event {
            event::Event::MainEventsCleared => window.request_redraw(),
            ...
```
in all of the examples. Trying to add the least code possible I've replaced a `ControlFlow::Poll` with `ControlFlow::WaitUntil(...)` in the event loops and capped the redraws-per-second below 50, which completely solves this problem for me (plus the window resize response on the examples themselves are much improved, etc.).

I was just going for an unintrusive fix---this is by no means a perfect solution, but I think in the worst case it won't be any worse that what was there originally. Plus, I think it will make people like me who try to start by copying an example more likely to stick around in the short term.

Co-authored-by: Keeley Hoek <keeley@hoek.io>
2020-05-11 21:35:47 +00: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
Keeley Hoek
469b416632 [rs] Don't busy-redraw in examples 2020-05-12 03:20:19 +10: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
bors[bot]
1de6a6c084 [rs] Merge #302
302: Add BufferRange struct for #199 r=kvark a=paulkernfeld

- Use in set_index_buffer
- Use in set_vertex_buffer
- Use in BindingResource

Co-authored-by: Paul Kernfeld <paulkernfeld@gmail.com>
2020-05-10 21:50:06 +00:00
Paul Kernfeld
445786d474 [rs] Add Buffer.slice fn for #199
This fn is used for set_index_buffer, set_vertex_buffer, and
BindingResource
2020-05-10 17:37:19 -04:00