Commit Graph

199 Commits

Author SHA1 Message Date
Dzmitry Malyshau
acef9206a6 Player-based GPU test framework 2020-07-17 00:08:43 -04:00
Dzmitry Malyshau
76e136e375 add the preferred format query 2020-07-16 11:27:05 -04:00
Gabriel Majeri
1b03fbe9be Safe error handling for commands API 2020-07-14 11:40:54 +03:00
Connor Fitzgerald
c8bcc50ed6 Implement PUSH_CONSTANTS feature 2020-07-13 12:47:09 -04:00
Gabriel Majeri
f3b80f1d8d Unify wgpu-core and wgpu-rs types 2020-07-13 18:39:49 +03:00
bors[bot]
7d5082753b
Merge #773
773: Error handling for data transfer API r=kvark a=GabrielMajeri

**Connections**
Work on the error model described in #376 

**Description**
Removes assertions from the transfer functions, instead returning a custom error type.

**Testing**
Checked with `player` and `wgpu-rs`: https://github.com/gfx-rs/wgpu-rs/pull/430

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-11 02:28:25 +00:00
Gabriel Majeri
98e4f73a10 Error handling for data transfer API 2020-07-10 21:50:22 +03:00
Dzmitry Malyshau
e693170aef Rename bindings to entries 2020-07-08 23:41:09 -04:00
bors[bot]
cfd21d4913
Merge #763
763: Remove raw pointers from the render pipelines API r=kvark a=GabrielMajeri

**Connections**
Rust-ification of API, as part of #689

**Description**
The objective is to get rid of raw pointers in the render pipeline descriptor and associated structures.

**Testing**
Checked with `player` and the `trace` feature, and with `wgpu-rs` with the changes in https://github.com/gfx-rs/wgpu-rs/pull/425

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-07 17:29:37 +00:00
Gabriel Majeri
d4eeea8118 Remove pointers from pipelines API 2020-07-07 19:37:04 +03:00
Dzmitry Malyshau
46230720b5 Remove UnsafeFeatures as we decided the top level guard is not useful 2020-07-06 23:46:46 -04:00
Oskar Nehlin
8a51f4bc7f
Return result instead of panicking when requesting device. (#762)
* Return Result instead of panic for recoverable errors

* Update LimitsExceeded error variant

* Update LimitsExceeded error message
2020-07-06 16:45:11 -04:00
Connor Fitzgerald
ac62a11619 Convert Extensions + Capabilities into Features 2020-06-26 00:18:46 -04:00
Connor Fitzgerald
62a870280f Refine Logging Levels 2020-06-22 02:13:04 -04:00
Connor Fitzgerald
1b2cf3cd22 Add Tracing and Instrument Entry Points 2020-06-20 14:26:50 -04:00
bors[bot]
c7be94047d
Merge #739
739: Remove Peek-Poke r=cwfitzgerald a=kvark

**Connections**
Related to https://github.com/gfx-rs/wgpu/issues/738
Related to https://github.com/djg/peek-poke/issues/10

**Description**
As of #726 , the buffers have a minimum binding size that has to include the shader struct size. It, therefore, can't be zero.
We can remove the hacks we had previously and switch fully to the idiomatic `Option<NonZeroU64>`.

Peek-poke doesn't `NonZeroU64` and friends, so this made me reconsider the user of it entirely. Today, render bundles as well as the Player already represent command streams using a much rustier method. I tried to move everything to this method now, and I think this is going to work much better, and safer.

**Testing**
wgpu-rs works - https://github.com/gfx-rs/wgpu-rs/pull/396

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-06-20 17:52:29 +00:00
Gabriel Majeri
69b41dc0d3 Validate sampler type in create_bind_group 2020-06-20 17:29:58 +03:00
Dzmitry Malyshau
365f4e8786 Remove peek-poke.
There was a lot of highly unsafe use of serialization based on peek-poke that we
weren't entirely happy with. It's replaced by just serializing the passes now.
Also, switch BufferSize to Option<NonZero>.
2020-06-20 00:39:11 -04:00
Marvin Löbel
e88e3517d6 Move backend selection to Instance::new()
Keep `inputs` parameter in `pick_adapter()`
2020-06-18 22:04:16 +02:00
Dzmitry Malyshau
35a1dc3076 Basic support for WGSL 2020-06-17 13:29:43 -04:00
Dzmitry Malyshau
a27341bd6d Basic support for minBufferBindingSize 2020-06-16 00:34:58 -04:00
Dzmitry Malyshau
58de765961 Always use DepthStencilReadOnlyOptimal for sampled depth 2020-06-15 17:45:19 -04:00
Dzmitry Malyshau
c038c206e7 Add RODS texture binding property 2020-06-12 21:26:19 -04:00
Dzmitry Malyshau
7aa5753701 Re-architecture the bundles using normalized command streams.
This is a major change in how the bundles are implemented. Instead of
transparently injecting them into the pass command stream, we are now
treating bundles as first-class API objects and API tracing them
accordingly. The bundle contains a normalized command stream that is
very easy to inject into a native command buffer multiple times.
2020-06-11 15:34:45 -04:00
Connor Fitzgerald
57b3b72571 Implement TEXTURE_BINDING_ARRAY extension 2020-06-10 22:35:25 -04:00
Dzmitry Malyshau
cdbf23813a Return errors on create_render_pipeline 2020-06-08 01:04:26 -04:00
bors[bot]
417ea69b45
Merge #704
704: Pipeline layout validation r=cwfitzgerald a=kvark

**Connections**
Implements a solid part of #269
Starts converting the function to return results, related to #638
cc @GabrielMajeri 

**Description**
This change matches shader bindings against the pipeline layout. It's *mostly* complete, minus some bugs and not handling the `storage_texture_format` properly.

The risk here is that Naga reflection may have bugs, or our validation may have bugs, and we don't want to break the user content while this is in flux. So the PR introduces an internal `WGPU_SHADER_VALIDATION` environment variable. Switching it to "0" skips Naga shader parsing completely and allows the users to unsafely use the API.

Another aspect of the PR is that some of the functions now return `Result`. The way I see us proceeding is that any errors that we don't expect users to handle should result in panics when `wgpu` is used natively (i.e. not from a browser). These panics would happen in the "direct" backend of wgpu-rs (as well as in wgpu-native), but the `Result` would not be exposed to wgpu-rs, so that it matches the Web behavior.

At the same time, browser implementations (Gecko and Servo) will check the result on their GPU process and implement the WebGPU error model accordingly. This means `wgpu-core` can be super Rusty and safe.

**Testing**
Running on wgpu-rs examples. Most of them fail to get parsed by Naga, but `boids` succeeds and passes validation 🎉 

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-06-06 22:01:49 +00:00
Connor Fitzgerald
f32cb103b8 Implement extensions interface as described in #691 2020-06-06 02:00:41 -04:00
Dzmitry Malyshau
15cdc794fa Shader binding validation 2020-06-05 12:48:34 -04:00
Dzmitry Malyshau
534d7ac504 Validate pipeline layout creation 2020-06-05 12:48:34 -04:00
Dzmitry Malyshau
f158709dd0 Validate bind group layouts 2020-06-05 12:48:34 -04:00
Dzmitry Malyshau
e648516ff9 player: enable x11 on Unix/Vulkan 2020-06-01 16:54:40 -04: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
Dzmitry Malyshau
79eb7b9c17 Minor fixes in Gecko 2020-05-26 16:41:24 -04:00
Dzmitry Malyshau
e4659b6d05 Bring back BufferCopyView 2020-05-26 00:15:09 -04:00
Dzmitry Malyshau
fcf1d2762d Use TextureDataLayout consistently 2020-05-26 00:15:09 -04:00
Dzmitry Malyshau
a4ea5358ef Implement write_texture 2020-05-26 00:15:09 -04: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
Anton Lazarev
29ce9a44cf
Pass through raw-window-handle 2020-05-04 15:55:19 -04:00
Dzmitry Malyshau
2d09b1d08d Fix player validation errors on exit 2020-05-01 23:33:16 -04:00
Dzmitry Malyshau
5bbe6ec38c
Integrate with RenderDoc on winit-less captures (#627) 2020-05-01 15:34:32 -04:00
Dzmitry Malyshau
f64b2dd3bb trace: make Id serialization nicer 2020-04-30 09:55:52 -04:00
Dzmitry Malyshau
3c68fb17e4 player: full winit integration 2020-04-30 09:55:52 -04:00
Dzmitry Malyshau
77a5eda796 trace: fix reusing object ids 2020-04-30 09:55:52 -04:00
Dzmitry Malyshau
854c1be035 trace: support pipelines, refactor destruction sequence 2020-04-30 09:55:52 -04:00
Dzmitry Malyshau
018417f174 trace: replaying all the commands 2020-04-30 09:55:52 -04:00
Dzmitry Malyshau
47f37ad78e trace: player skeleton 2020-04-30 09:55:52 -04:00