Commit Graph

254 Commits

Author SHA1 Message Date
Zicklag
9310f264f1
Update Naga With New Storage Classes API (#1766) 2021-08-05 13:50:51 -04:00
Gordon-F
f0b1d5a673 Update winit to 0.25 2021-07-23 14:30:38 +03:00
Zicklag
0614ccea7e Enable All Backends for Trace Player 2021-07-09 20:42:59 -05:00
Dzmitry Malyshau
568ac3fa24 Switch all bitflag names to plural 2021-06-30 14:43:36 -04:00
Alex S
b4b3dd720c Reorder & reassign flags to group up the binding flags together. 2021-06-28 14:44:08 +03:00
Andreas Reich
a745383516 Do multiple queries in pipeline-statistics-query test 2021-06-27 11:20:53 +02:00
Andreas Reich
2525d6ce9d Add player test for pipeline statistics 2021-06-27 08:43:48 +02:00
Dzmitry Malyshau
4c03d286c6 Remove SPIRV entirely from wgpu-core 2021-06-22 12:35:22 -04:00
Dzmitry Malyshau
da38b8b077 Make spirv an optional feature 2021-06-21 12:09:12 -04:00
bors[bot]
96dbd06a1f
Merge #1525
1525: Add Naga bypass to allow feeding raw SPIR-V shader data to the backend. r=kvark a=ElectronicRU

**Connections**
Fixes #1520 .

**Description**
While Naga checking is undoubtedly very useful, it currently lags behind
what is possible in SPIR-V and even what is promised by WGPU (ie binding
arrays). This adds an unsafe method to wgpu::Device to allow feeding
raw SPIR-V data into the backend, and adds a feature flag to request a
backend supporting this operation.

**Testing**
`texture_arrays` example is runnable now, which uncovers an additional bug in Vulkan backend - binding arrays are instead treated like sole bindings, and indices shift, too. Lots of errors from validation layer ensue.


Co-authored-by: Alex S <alex0player@gmail.com>
2021-06-20 16:13:53 +00:00
Alex S
8bfa949261 Code review:
- rename ShaderInput variants
- rename feature flag
- hard error on Metal backend trying to compile SPIR-V
- fix test failing because of feature flag bits changing
2021-06-20 06:22:59 +03:00
Gordon-F
2873ac32d9 Remove MPL 2.0 header in files 2021-06-19 21:06:08 +03:00
Connor Fitzgerald
74d2becb18 Relicense to MIT/Apache 2021-06-18 13:40:31 -04:00
Dzmitry Malyshau
a421c1c8b6 Instance plumbing 2021-06-08 11:46:53 -04:00
Dzmitry Malyshau
569cd0cdd6 WIP new wgpu-hal 2021-06-08 00:46:08 -04:00
Andreas Reich
99e691932d add clear buffer/image to wgpu-rs api 2021-06-05 11:49:13 +02:00
Wumpf
f62d0d5edc
Native Extension: Expose fill buffer & clear image (#1335)
* Add command buffer fill buffer method

* Added test for buffer fill

* Added image clear + test

* image/buffer clear methods are now pure clear to zero

* fix cargo clippy & int type issues

* clear buffer alignment is now given by COPY_BUFFER_ALIGNMENT

* joined buffer/image clear player tests

* ImageSubresourceRange is now used in TextureViewDescriptor
2021-05-30 11:03:33 -04:00
Dzmitry Malyshau
19dfcd93ca Make player automatically start/stop the capture 2021-05-18 17:42:49 -04:00
Luca Casonato
751aa714f4 fix: zeroable buffer_get_mapped_range size
According to spec, size can be Some(0).
2021-05-06 22:03:43 -04:00
Dzmitry Malyshau
bc4c5c8f03 Change error type for the backend shader 2021-04-21 17:06:58 -04:00
Dzmitry Malyshau
de86f2a72f Mark unused implicit BGL ids as vacant 2021-04-19 23:35:33 -04:00
Dzmitry Malyshau
27f51ca252 Update naga to gfx-22, add interpolation sampling validation 2021-04-19 13:33:36 -04:00
adamnemecek
af8b94c729 removed autocapture 2021-04-02 09:43:38 -07:00
Dzmitry Malyshau
f953266bbe Align create_swap_chain function signature 2021-03-23 10:39:13 -04:00
Joshua Groves
a5693ab2a3 Rename color/depth attachments to match spec
- Rename `ColorAttachmentDescriptor` to `RenderPassColorAttachment`
- Rename `DepthStencilAttachmentDescriptor` to `RenderPassDepthStencilAttachment`
- Rename `attachment` fields on both attachments to `view`
2021-03-23 09:31:59 -02:30
Andreas Reich
50043875e5 rows_per_image & rows_per_image are now optional
Fixes #988
2021-03-20 12:33:28 +01:00
Dzmitry Malyshau
b97f5a5b24 Update naga to gfx-16 2021-03-17 09:07:08 -04:00
Connor Fitzgerald
cf6f9c3ca8 Move from tracing to log + profiling 2021-03-17 01:22:30 -04:00
Luca Casonato
82932d1f59
chore: validate offset + size in get_mapped_range (#1266)
* chore: validate offset + size in get_mapped_range

This commit introduces out of bounds & offset validation for
buffer_get_mapped_range, like described in the WebGPU spec. See
https://gpuweb.github.io/gpuweb/#dom-gpubuffer-getmappedrange.

Closes #818

* review comments

* fmt

* fix test

* fix tests

* update error message

* review comment

* use wgt::BufferAddress

* clippy
2021-03-16 13:00:44 -04:00
Dzmitry Malyshau
280c066e65 Update to naga-14 2021-03-14 00:27:57 -05:00
Dzmitry Malyshau
eef4a75454 Fix swapchain resize in the player 2021-03-10 15:34:21 -05:00
Dzmitry Malyshau
10245cece9 Early tracing of swapchain-related things, clean up the hub API 2021-03-03 19:59:29 -05:00
Dzmitry Malyshau
7c1db12cdc Refactor implicit BGLs to support early tracing 2021-03-03 16:48:23 -05:00
Dzmitry Malyshau
103e7763a3 Rename depth to depth_or_array_layers 2021-03-01 11:08:17 -05:00
Dzmitry Malyshau
91f5329b33 Update gfx and naga to gfx-12 2021-02-21 11:25:45 -05:00
Dzmitry Malyshau
b3387492a2 Handle player window resizing gracefully 2021-02-11 14:16:56 -05:00
Andreas Reich
fd810f839e merged buffer-zero-init-for-binding and buffer-zero-init-for-mapping-and-writing tests 2021-02-06 12:09:38 +01:00
Andreas Reich
52aee1a037 Better error output for player test 2021-02-03 23:44:50 +01:00
Andreas Reich
5e488d4fea Added player test with compute shader reading & writing an uninitialized buffer 2021-02-03 23:44:42 +01:00
bors[bot]
7c7501cab7
Merge #1182
1182: Update all versions r=kvark a=kvark

**Connections**
Picks up https://github.com/gfx-rs/gfx/pull/3620 and a bunch of other fixes in gfx-rs and naga.

**Description**
Updates the dependencies ("gfx-9" naga train) as well as self version to 0.7, to match the v0.7 branch.

**Testing**
Should just work :)

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-02-01 05:37:39 +00:00
Dzmitry Malyshau
8ed543f26a Update all versions 2021-02-01 00:35:40 -05:00
Andreas Reich
cc183c885f Added player test for buffer-zero-init 2021-01-31 21:56:31 +01:00
Dzmitry Malyshau
0346b43982 Update the render pipeline API 2021-01-27 15:09:13 -05:00
Dzmitry Malyshau
05bb482e49 Fix replaying issues with dropped texture views 2021-01-19 22:03:55 -05:00
bors[bot]
4f2d0bb8c8
Merge #1151
1151: Update gfx and naga to gfx-6 tag r=cwfitzgerald a=kvark

**Connections**
Fixes #1149 
Regression from https://github.com/gfx-rs/gfx/pull/3573

**Description**
The physical devices held references to `RawInstance` in Vulkan backend, and we weren't cleaning them up.
Note: an alternative fix could be in `gfx-backend-vulkan` - to move the `Entry` into `RawInstance`, thus delaying the shutdown. I didn't go this way because that would be less explicit.

**Testing**
Tested on wgpu-rs examples

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2021-01-16 06:39:44 +00:00
Dzmitry Malyshau
87c8cb8fde Update gfx and naga to gfx-6 tag, fix the hub clears 2021-01-16 01:38:57 -05:00
Connor Fitzgerald
a22037ced0 Add pipeline statistics and timeline queries 2021-01-16 00:48:54 -05:00
Dzmitry Malyshau
6c05470db0 Minor dependencies bumps 2021-01-15 01:11:28 -05:00
bors[bot]
89e585af61
Merge #1093
1093: Update naga and gfx, move the shader validation into a shader descriptor bit r=cwfitzgerald a=kvark

**Connections**
Includes https://github.com/gfx-rs/gfx/pull/3533 and a bunch of Naga things.

**Description**
Updates Naga with the new WGSL syntax, lots of fixes.
Large update of the GL backend.

**Testing**
Tested on some wgpu-rs examples.

Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
2020-12-17 16:34:28 +00:00
Dzmitry Malyshau
f07cc8156b Update naga and gfx, move the shader validation into a shader descriptor bit 2020-12-17 11:33:47 -05:00
Dzmitry Malyshau
b84301110c Optimize submit() for no command buffers 2020-12-16 15:02:09 -05:00
Dzmitry Malyshau
a316fff427 Update Naga to gfx-4, update gfx with GL fixes 2020-12-07 01:30:52 -05:00
Dzmitry Malyshau
3f33434c6f Enable experimental translation to playtests 2020-12-06 15:14:14 -05:00
Dzmitry Malyshau
dccc57e7b5 Switch playtests to WGSL 2020-12-06 14:51:23 -05:00
bors[bot]
d430e044b5
Merge #1076
1076: Fix player warnings r=kvark a=kvark

```
warning: unused `std::result::Result` that must be used
   --> player/src/bin/play.rs:142:29
    |
142 | ...                   gfx_select!(device => global.device_create_swap_chain(device, surface, &desc));
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(unused_must_use)]` on by default
    = note: this `Result` may be an `Err` variant, which should be handled
    = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

warning: unused `std::result::Result` that must be used
   --> player/src/bin/play.rs:147:29
    |
147 | ...                   gfx_select!(device => global.swap_chain_present(id));
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this `Result` may be an `Err` variant, which should be handled
    = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

warning: unused `std::result::Result` that must be used
   --> player/src/bin/play.rs:173:21
    |
173 |                     gfx_select!(device => global.device_poll(device, true));
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this `Result` may be an `Err` variant, which should be handled
    = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

warning: 3 warnings emitted
```

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-12-05 23:56:38 +00:00
Dzmitry Malyshau
91a66b4b4a Fix player warnings 2020-12-05 18:55:27 -05:00
Dzmitry Malyshau
749f737c89 Add pervasive Naga support to shader module loading
The purpose of the PR is to support Naga modules everywhere.
As a requirement, it updates the gfx-rs version used.
Most of the logic is dedicated towards building a shader interface,
where previously we just used naga's IR. Now we have our own mini-IR.
2020-12-05 11:31:03 -05:00
kejor
4513fb2b83 Match upstream API changes for IndexFormat 2020-12-01 19:19:41 -05:00
Dzmitry Malyshau
9e2f6c2f01 Move to gfx master 2020-11-30 22:50:13 -05:00
Dzmitry Malyshau
5949dec61d Update bind group layout API to match upstream 2020-11-28 00:30:27 -05:00
Dzmitry Malyshau
55851add9b player: use the wgpu-cores's gfx-select macro 2020-11-26 14:47:48 -05:00
Dzmitry Malyshau
c6bc37dbde [error] render bundles 2020-11-23 12:00:47 -05:00
Dzmitry Malyshau
6307294e2b [error] pipeline creation 2020-11-23 11:57:32 -05:00
Dzmitry Malyshau
ad824de268 [error] bind groups and layouts creation 2020-11-23 11:57:32 -05:00
Dzmitry Malyshau
fccbca28bd [error] shader module creation, separate descriptor 2020-11-23 11:57:32 -05:00
Dzmitry Malyshau
e96e5f917c [error] sampler creation 2020-11-23 11:57:32 -05:00
Dzmitry Malyshau
8287464855 [error] texture view creation 2020-11-23 11:57:32 -05:00
Dzmitry Malyshau
bedd037517 [error] buffer creation 2020-11-23 11:57:32 -05:00
Dzmitry Malyshau
eb4f633e39 [error] texture creation 2020-11-23 11:57:32 -05:00
Dzmitry Malyshau
6714c4fe7e
Update players readme 2020-11-05 16:58:40 -05:00
frbimo
fdd561e69e remove PowerPreference::Default
Signed-off-by: frbimo <fr.bimo@gmail.com>
2020-10-12 19:17:44 +08:00
bors[bot]
f963193be1
Merge #966
966: Immediate resource destruction and freeing r=cwfitzgerald a=kvark

**Connections**
Fixes #964

**Description**
We are making it so a buffer or a texture can have their native resources freed while they are still referenced, so without waiting for GC.

In addition, the PR adds a few missing cases where error IDs should have been handled, like at render pass encoding.

**Testing**
Tested on wgpu-rs examples, see https://github.com/gfx-rs/wgpu-rs/pull/591

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-10-11 17:10:42 +00:00
Dzmitry Malyshau
c87a94f976 Early texture destruction 2020-10-08 23:21:11 -04:00
Dzmitry Malyshau
c4c8e3b224 Early buffer destruction logic 2020-10-08 22:28:52 -04:00
Noah Charlton
5ff6b11daf CI playtests for Dx12, Vulkan 2020-10-08 17:17:16 -04:00
Dzmitry Malyshau
0a7d81351c Handle cases where buffer contents are destroyed 2020-10-08 12:57:17 -04:00
Dzmitry Malyshau
eed8bf84ef Playtest for binding a group 2020-09-04 23:47:24 -04:00
Noah Charlton
d05d1aeec1 Add Quad play test 2020-09-01 16:07:24 -04:00
Dzmitry Malyshau
901b043b19 Version bump to 0.6 and changelog update 2020-08-17 16:51:22 -04:00
Connor Fitzgerald
350637df40 Factor wgpu-subscriber into its own repo 2020-08-17 16:36:22 -04:00
Dzmitry Malyshau
d1da6d8106 Switch gfx-hal to 0.6 2020-08-17 10:34:50 -04:00
Dzmitry Malyshau
d8341c5996 Add labels to pipelines 2020-08-13 12:14:24 -04:00
Dzmitry Malyshau
d07d8503a0 Move the subscriber into a different crate 2020-08-12 15:00:15 -04:00
Dzmitry Malyshau
9d8dc0b04d Grand cleanup and refactor of the descriptors in the API 2020-08-12 14:13:32 -04:00
Dzmitry Malyshau
173c7c3dbf Create implicit layouts for render pipelines 2020-08-09 14:43:44 -04:00
Dzmitry Malyshau
a9b8a99e19 Create implicit layouts for compute pipelines 2020-08-09 08:33:33 -04:00
Dzmitry Malyshau
dbd7e2c579 Separate valid internal IDs from external ones 2020-08-04 11:16:59 -04:00
Gabriel Majeri
e860dd995f Handle command pool creation error 2020-07-29 09:56:42 +03:00
Dzmitry Malyshau
bf862b7907 Clarity renames according to the Gecko review 2020-07-28 16:58:28 -04:00
Gabriel Majeri
8316e9e678 Safe error handling for queue module 2020-07-26 17:49:53 +03:00
Connor Fitzgerald
cb485f3798 Convert all logging to tracing and add fmt logger 2020-07-25 19:33:21 -04:00
bors[bot]
6182495102
Merge #838
838: wait for buffer to be done in the player r=cwfitzgerald a=kvark

**Connections**
Fixes our code enough to replay #834 without issues. Doesn't help to solve the original problem though.

**Description**
There are two things in here:
  1. don't deduplicate the BGLs if we are not generating new IDs at this layer. This helps Servo/Gecko/player. cc @kunalmohan 
  2. have an option in `buffer_destroy` to *actually* kill it, at the cost of blocking on GPU sometimes. This is required for the player, since the very next command may try to reuse the ID.

**Testing**
Tested on the trace in #834 

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-07-24 22:57:04 +00:00
Gabriel Majeri
7cf9970121 Error handling for device functions 2020-07-24 22:56:51 +03:00
Dzmitry Malyshau
7e4ce4a4fe wait for buffer to be done in the player 2020-07-24 14:34:18 -04:00
Dzmitry Malyshau
82d149b871 Naga update, remove spirv_headers dependency 2020-07-22 11:05:42 -04:00
Marvin Löbel
4ed2c0a313
Replace borrowed slices in Descriptor structs with copy on write slices (#822)
* Replace &[T] in descriptor structs with Cow<[T]>

* Changed label fields to use Cow<'a, str>

* Deduplicate types across the tracing API

Introduce the ToStatic trait

* Deduplicate trace::RenderBundleDescriptor

* Remove ugly ToOwned bounds

* Simplifiy Action variants

* Make Clone bounds on type defs less verbose

* Fix a error in play.rs

* Remove ToStatic, and Make Action<'a> borrow descriptors instead
2020-07-20 12:31:05 -04:00
Gabriel Majeri
ec12d9547d Error types for buffer mapping API 2020-07-20 07:22:52 +03:00
Gabriel Majeri
e53aa70b9a Error type for texture creation 2020-07-19 20:42:31 +03:00
bors[bot]
d73683e35e
Merge #813
813: Add buffer creation error type r=kvark a=GabrielMajeri

**Connections**
Part of #638 

**Description**
Adds an error type for the buffer creation functions.

**Testing**
Checked with core and ran test on player.

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-19 17:19:01 +00:00
bors[bot]
8cfe8bb56d
Merge #812
812: Error type for `WaitIdle` r=kvark a=GabrielMajeri

**Connections**
Part of #638 

**Description**
Adds an error type for the `wait_idle` function.

**Testing**
Checked with core.

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-18 22:12:37 +00:00
Gabriel Majeri
fc460f4eab Propagate WaitIdleError up through the API 2020-07-18 20:39:11 +03:00
Gabriel Majeri
2ac778b312 Add buffer creation error type 2020-07-18 11:12:15 +03:00
Gabriel Majeri
04b0b4d3a5 Error type for command_encoder_finish 2020-07-18 10:46:47 +03:00
Gabriel Majeri
314074d13c Safe error handling for swap chain 2020-07-17 21:11:28 +03:00
Dzmitry Malyshau
eb7bdcd012 playtest: move the actions together with expectations 2020-07-17 10:59:02 -04:00
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