Commit Graph

60 Commits

Author SHA1 Message Date
Dzmitry Malyshau
ad7045455c Optionally request vertex shader stores and atomics 2020-01-21 14:12:08 -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
bbe0d7df1b Command buffer/encoder destruction 2020-01-08 18:14:45 -05:00
Dzmitry Malyshau
9acefac5b3 Heavy refactor of resource lifetime tracking 2020-01-08 18:06:28 -05:00
Dzmitry Malyshau
7be921495d Fix clippy warnings and errors 2020-01-04 13:20:28 -05:00
Park Joon-Kyu
fc85128c41 Expose FFI for Wayland 2020-01-02 17:10:04 +09:00
bors[bot]
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](04e17b3f4f/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
Jonathan Behrens
461f114ad5 Make Origin3d::{x,y,z} all have type u32 2019-12-25 21:42:49 -05:00
Dzmitry Malyshau
109253247d Track render pass attachments in the pass tracker 2019-12-17 00:19:39 -05:00
Dzmitry Malyshau
3908d2b5a1 Cleanup exports 2019-11-19 10:59:24 -05:00
Dzmitry Malyshau
6c632d1366 Separate native from the core 2019-11-16 00:36:23 -05:00
Dzmitry Malyshau
b9aed69bed More licenses for Gecko 2019-11-15 11:51:46 -05:00
Joshua Groves
2b1ce5d6d9 Use callback for request_adapter 2019-11-07 09:55:27 -06:00
Dzmitry Malyshau
4635f1eb07 Extended remote example 2019-10-29 13:31:40 -04:00
Dzmitry Malyshau
538c23b039 Implement shutdown for the remote server 2019-10-25 22:56:52 -04:00
Dzmitry Malyshau
e37149b3a8 Remove all the IPC 2019-10-25 12:06:12 -04:00
Dzmitry Malyshau
4851284150 Switch from remote feature to local 2019-10-24 14:52:44 -04:00
Dzmitry Malyshau
f67894c310 Explicit Global hubs 2019-10-24 14:52:19 -04:00
Dzmitry Malyshau
c4906ee36f Always return an Id by request_adapter 2019-10-23 14:31:36 -04:00
Dzmitry Malyshau
9c58a5d11a Add license headers to all Rust sources 2019-10-04 15:24:17 -04:00
yanchith
ed8503ed6c Track and destroy samplers
This PR adds `ResourceId::Sampler`, `NativeResource::Sampler` and
`TrackerSet::samplers`. Samplers are (similarly to bind groups)
created with their own life guard and a device id to keep the device
ref count alive. Also added are `extern wgpu_sampler_destroy` and
`sampler_destroy`.

The rest of the implementation was guided by compiler errors, so there
is a good chance I didn't find something crucial that also needed
doing. Please check :)
2019-09-23 12:13:18 +02:00
Dzmitry Malyshau
5f1c432706 New swapchain model 2019-09-09 20:53:35 -04:00
Alichay
306dd09626 Exported function wgpu_render_pass_set_index_buffer 2019-09-06 20:49:11 -05:00
Dzmitry Malyshau
26e5b4258d Add a mask of backends for local adapter selection 2019-08-27 21:08:13 -04:00
Dzmitry Malyshau
e84ae4a4b2 Feature-less backend selection
This PR removes optional backend features in favor of run-time
selection at the `request_adapter` entry point. Adapters from all
supported gpu backends on the platform are reported.

It also makes gfx-rs dependency to be public (for now).
2019-08-27 20:55:49 -04:00
Dzmitry Malyshau
6fdeea23c5 Refactor Id logic.
This change merges `Id` with `GenericId` and abstracts away its contents, exposing itself as just u64. This will allow us to encode the backend type into it, in addition to index and epoch.

It also refactors `TypedId` to have a single function extracting all the fields, since this is how it's used all the times anyway.
2019-08-27 20:54:30 -04:00
Dzmitry Malyshau
1d36203c9a Raw window handle support instead of winit 2019-08-20 23:41:14 -04:00
bors[bot]
9c2019478a
Merge #298
298: Fix cbindgen flags r=grovesNL a=kvark



Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2019-08-20 23:24:57 +00:00
yanchith
3abaed36c3 Rename buffer to encoder in wgpu_command_buffer_copy_* functions
This also regenerates `wgpu.h` and updates uses of
`wgpu_command_buffer_copy_buffer_to_buffer` in `compute/main.c`
2019-08-20 21:43:49 +02:00
Dzmitry Malyshau
0296e82fab Fix cbindgen flags 2019-08-20 14:59:17 -04:00
Joshua Groves
8d8c670da1 Manually expand ID macros 2019-08-20 09:08:05 -02:30
Dzmitry Malyshau
f82ceba3c2 Minor renames to address the review comments 2019-08-16 22:36:30 -04:00
Dzmitry Malyshau
37afa0d98a Update API according to the upstream spec
Includes changes in texture view creation, enumeration mapping,
binding types, and more.
2019-08-15 23:24:35 -04:00
Dzmitry Malyshau
d37452ff27 Force pipeline barriers between unordered usages 2019-08-14 10:35:40 -04:00
Rukai
e61b16f7ed Update to gfx hal 0.3 2019-08-11 09:39:52 +10:00
Fabio Krapohl
6fee18f6f9 remove end pass return value and fix examples 2019-08-10 22:30:24 +02:00
bors[bot]
734245be94 Merge #247
247: Add support for indirect drawing r=kvark a=dragly



Co-authored-by: Svenn-Arne Dragly <dragly@cognite.com>
2019-07-30 15:22:00 +00:00
Svenn-Arne Dragly
92288e2988 Add support for indirect drawing 2019-07-30 09:18:54 +02:00
Noah Hüsser
c5c7092d9c Make PresentMode configurable
Disable vsync

Revert accidential hardcode of num_frames

Make the PresentMode configurable

Adapt examples
+ adjust style according to @kvrak

Adher to @kvarks wishes for style.

Examples build.

Fix unnecessary ampersand.
2019-07-11 18:58:44 +02:00
Dzmitry Malyshau
d92b623bd8 Remove the old tracking code, update local feature and the headers 2019-06-12 12:29:28 -04:00
bors[bot]
85740873d0 Merge #212
212: More consistent descriptor passing r=kvark a=porky11

also use pointer for descriptor in `wgpu_command_encoder_begin_render_pass` for consistency reasons

Co-authored-by: Fabio Krapohl <fabio.u.krapohl@fau.de>
2019-06-04 20:20:10 +00:00
Fabio Krapohl
8abc1c2668 also use pointer for descriptor in wgpu_command_encoder_begin_render_pass for consistency reasons 2019-06-04 22:13:48 +00:00
Fabio Krapohl
488367ce30 More consistent naming of pointer-size-pairs:
* always plural form without _ptr suffix for pointers
* always same name as pointer for size, but with _length suffix
* special case: single size applies to multiple pointers => only use length as name
2019-06-04 21:41:39 +00:00
Dzmitry Malyshau
351432aae2 hook up rendy-memory 2019-05-30 13:34:43 -04:00
Dzmitry Malyshau
9621fb3021 Validate vertex/instance/index buffer ranges 2019-05-29 23:49:27 -04:00