Commit Graph
2124 Commits
Author SHA1 Message Date
daxpedda eb6eec5c95 Implement enumerate_adapters. 2020-02-10 19:54:36 +01:00
Dzmitry Malyshau e05471ad6d Encode render targets into the render pass blob 2020-02-10 12:44:44 -05:00
Dzmitry Malyshau ab416bcc68 All the missing Gecko fixes 2020-02-09 20:15:55 -05:00
bors[bot]andIstvan Miklos d4a46cb60e Merge #479
479: Serialize BindGroupBinding r=kvark a=imiklos



Co-authored-by: Istvan Miklos <istvan.miklos@h-lab.eu>
2020-01-28 12:41:08 +00:00
Istvan Miklos 38ba0e625a Serialize BindGroupBinding 2020-01-28 12:47:23 +01:00
daxpedda cd8e2a30b2 Duplicate DeviceType from gfx-hal. 2020-01-26 23:09:58 +01:00
daxpedda 8c80557dd6 Return custom AdapterInfo that contains backend. 2020-01-25 18:22:34 +01:00
bors[bot]andAlmar Klein 009bde0f90 Merge #468
468: Switch value of BufferUsage's INDIRECT and STORAGE_READ fields r=kvark a=almarklein

Closes #467. This makes the value of `INDIRECT` equal to it's value in the IDL spec. (`STORAGE_READ` is not present in the IDL spec.)

I changed the value in `resource.rs` and then ran `make ffi/wgpu.h`.


Co-authored-by: Almar Klein <almar.klein@gmail.com>
2020-01-23 16:26:53 +00:00
Dzmitry Malyshau b9e7449b43 Fix building on Rust 1.37
It doesn't like by-move pattern with an `if`
2020-01-23 00:52:04 -05:00
Almar Klein 299a051db1 Switch value of BufferUsage's INDIRECT and STORAGE_READ fields
This makes the value of INDIRECT equal to it's value in the IDL spec.
(STORAGE_READ is not present in the IDL spec).
2020-01-22 08:07:07 +01:00
Dzmitry Malyshau 8a5de68aab Refactor the swap chain frame tracking 2020-01-21 14:24:45 -05:00
Dzmitry Malyshau ec54038e7c Improve STORAGE_READ support for buffers 2020-01-21 14:13:27 -05:00
Dzmitry Malyshau ad7045455c Optionally request vertex shader stores and atomics 2020-01-21 14:12:08 -05:00
yanchith ab205b042c Add # Safery docs to wgpu-core 2020-01-17 16:15:05 +01:00
yanchith 0d9ad70468 Add TODOs for range_plus_one clippy warnings 2020-01-17 14:44:17 +01:00
yanchith 53b9a01b2f Resolve trivial clippy warning 2020-01-17 14:44:02 +01:00
bors[bot]andLayl 3a41272cba Merge #448
448: Fix framebuffers not always being cleaned up if invalid r=kvark a=LaylConway

This changes framebuffers to be cleaned up if only one view is cleaned up, instead of if all views are cleaned up. This is necessary because currently, at least for me, swapchain images will have a different view every frame. This means that if other views continue to exist between frames, the resulting framebuffers will never be cleaned up.

Fixes #447

Co-authored-by: Layl <2385329-layl@users.noreply.gitlab.com>
2020-01-15 14:24:19 +00:00
Layl 6202d5ddad Fix framebuffers not always being cleaned up if invalid 2020-01-15 15:11:16 +01:00
bors[bot]andIstvan Miklos 881222a947 Merge #451
451: Make BindGroupLayoutBinding Serializable r=kvark a=imiklos

cc @kvark @zakorgy

Co-authored-by: Istvan Miklos <istvan.miklos@h-lab.eu>
2020-01-14 20:04:21 +00:00
Istvan Miklos 0fdf77feb5 Make BindGroupLayoutBinding Serializable 2020-01-14 12:43:58 +01:00
Dzmitry Malyshau a51019795e Switch to a custom fork of peek-poke 2020-01-13 16:52:59 -05:00
Dzmitry Malyshau 92441c38a2 Fix missing transitions before the render pass 2020-01-13 16:52:58 -05:00
Dzmitry Malyshau f798f7c631 Add missing render pass methods 2020-01-13 16:52:58 -05:00
Dzmitry Malyshau e0574ee899 Remove the old render and compute passes 2020-01-13 16:52:58 -05:00
Dzmitry Malyshau 40ac14e92c Switch the examples to use the new raw passes 2020-01-13 16:52:58 -05:00
Dzmitry Malyshau 941fcca08d Raw render pass encoding 2020-01-13 16:52:58 -05:00
Dzmitry Malyshau c01a7c6abe Use peek-poke for compute pass encoding 2020-01-13 16:52:58 -05:00
Dzmitry Malyshau 20cd803d67 Standalone render passes 2020-01-13 16:52:58 -05:00
Dzmitry Malyshau 7808a4d4cd Stand-alone compute passes 2020-01-13 16:52:58 -05:00
Zakor Gyula 2fbda5a3c1 Fix missing memory release 2020-01-13 15:44:15 +01:00
Zakor Gyula 94fe1436f1 Fix missing memory allocator disposal 2020-01-13 15:44:15 +01:00
Aaron Loucks 5ca57374f6 Check power/battery status when selecting adaptors
PowerPreference::Default will now prefer discrete GPUs
when on AC power and will prefer integrated GPUs while
on battery power (i.e. the battery is discharging).
2020-01-12 17:26:54 -05:00
Aaron Loucks 4b46e885fd Prefer discrete GPU for PowerPreference::Default 2020-01-11 03:07:45 -05:00
Dzmitry Malyshau bcf533fd89 Refactor usage tracker init() 2020-01-08 23:19:52 -05:00
Dzmitry Malyshau 017a54ff97 Refactor usage tracking to be truly sparse 2020-01-08 22:43:19 -05:00
Dzmitry Malyshau bbe0d7df1b Command buffer/encoder destruction 2020-01-08 18:14:45 -05:00
Dzmitry Malyshau 59a9d14c81 Suspect unlinked resources used in submissions 2020-01-08 18:14:07 -05:00
Dzmitry Malyshau 040efa2820 Fix refcount use of the texture view source 2020-01-08 18:13:43 -05:00
Dzmitry Malyshau bf8c9fe27b Make device tracker to be the last home for destroyed resources 2020-01-08 18:13:43 -05:00
Dzmitry Malyshau 73f6fbbf88 use full Id paths in the device module 2020-01-08 18:10:53 -05:00
Dzmitry Malyshau 3a40ba2d60 Move lifetime tracker into a separate module 2020-01-08 18:10:53 -05:00
Dzmitry Malyshau 9acefac5b3 Heavy refactor of resource lifetime tracking 2020-01-08 18:06:28 -05:00
Layl a221ca1c12 Fix cmd buffer cleanup not always using lowest active index 2020-01-08 01:17:58 +01:00
Dzmitry Malyshau 7be921495d Fix clippy warnings and errors 2020-01-04 13:20:28 -05:00
Layl ac8f75288f Use current active list instead of storing last done 2020-01-02 01:33:45 +01:00
Layl b55cd162bf Defer command buffer recycling until allocate 2020-01-02 01:33:45 +01:00
bors[bot]andLayl 2a2ab3dc2a Merge #418
418: Hotfix deadlocks on resource cleanup r=kvark a=LaylConway

This resolves resource cleanup causing deadlocks with `maintain`, because of `Device::pending` being locked in reverse order.

I'm calling this a "hotfix" because I don't think this is a scaleable approach to resolve how the issue happened in the first place, but it alleviates current deadlocking isssues.

I'm not quite sure how `Token` works, so I don't know if I used that right here.

This fixes #417

Co-authored-by: Layl <2385329-layl@users.noreply.gitlab.com>
2019-12-31 06:07:35 +00:00
bors[bot]andDzmitry Malyshau 8f42ba6676 Merge #412
412: Another big tracking refactor r=later a=kvark

Fixes #409
Note: there is way more code that had to be thrown out in the process of this PR than there is in the PR itself.
Also fixes [this comment](https://github.com/gfx-rs/wgpu/blob/04e17b3f4fe44d816cebeadc0e89bf588cfefe70/wgpu-core/src/track/texture.rs#L29):
> //TODO: make this less awkward!

## Logic
Instead of having a run-time per-operation control over what state is being used for stitching (with `Stitch` enum), we are now deriving this automatically on a per-subresource level. Whenever we are detecting a transition for a sub-resource, and we know there wasn't any "first" state associated with it in the current tracker, we are saving this "first" state. Unlike previous code, where it was confusing what of `Unit` fields (`init`, `last`) are valid, now `first` is `Option<>`, so we know we should be using it if it's there.

This allows us to have this hybrid tracking state of a render pass, where all resources are immutable (and their usage is extended), except for the output attachments. This, together with a whole lot of refactoring, gets us #409.

I'm actually quite happy with the tracking code now. It's finally taking shape we aren't afraid to tell others about :)

Note: this was tested on wgpu-rs examples and vange-rs.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2019-12-30 23:11:52 +00:00
890bbcfbed Merge #416 #420 #424
416: Makefile package command and travis github releases r=kvark a=Korijn

Closes #414

Approach mostly mimicked from [gfx-portability](https://github.com/gfx-rs/portability) as recommended to me by @kvark. I needed a number of commits to iron out some kinks for the Windows builds, so I would recommend using squash merge when accepting this PR.

Note that the Windows rust=nightly build fails, but it's also broken on master, so it's unrelated to the changes in this PR.

/cc @almarklein

# Questions

- [x] Would it make sense to also regenerate the `ffi/wgpu.h` and `wgpu-remote.h` header files and include them in the zip archive?

# Todo for maintainers

- [x] Configure encrypted `api_key`
As in [gfx-portability](https://github.com/gfx-rs/portability/blob/master/.travis.yml#L61) you will need to create an API key and commit it to the `.travis.yml` file. I've checked "allow edits from maintainers" so you should be able to commit to this branch directly. You may want to reference the [Travis instructions](https://docs.travis-ci.com/user/deployment/releases/#authenticating-with-an-oauth-token) as well.

- [ ] Tag revisions
Previous versions (`v0.1` - `v0.4`) have not been tagged on the master branch, you will want to do so retroactively. Also, when releasing in the future, make sure to tag the commit before pushing. Alternatively, you can schedule a travis build manually after applying the tag retroactively.

420: Make Origin3d::{x,y,z} all have type u32 r=kvark a=fintelia

Fixes #419 

424: swapchain creation: check if selected present mode is supported r=kvark a=Veykril

Implements a simple check as talked about in #350 to fallback to `FIFO` should the selected present mode not be available on the system.

Co-authored-by: Korijn van Golen <k.vangolen@clinicalgraphics.com>
Co-authored-by: Korijn van Golen <korijn@gmail.com>
Co-authored-by: Jonathan Behrens <fintelia@gmail.com>
Co-authored-by: Veykril <lukastw97@gmail.com>
2019-12-30 19:26:21 +00:00
Veykril 9eab6fc19e swapchain check present mode, default to vsync if selection is unsupported 2019-12-28 13:34:07 +01:00