Commit Graph

9013 Commits

Author SHA1 Message Date
AIOOB
1ac92cd942 Fixup clippy lints and remove unsafe 2020-03-15 21:09:08 -04:00
bors[bot]
fff08d2c63 [rs] Merge #200
200: Derive `Hash` and `PartialEq` for unique identifier wrapper types r=kvark a=mitchmindtree

This is particularly useful downstream for distinguishing between
instances of these types.

I was unsure about `Device` as I noticed it has a `Temp` field that
looks like it might eventually store some non-PartialEq/Hash-friendly
fields.

Let me know if you'd like me to add a derive for `Device` or if there
are any issues with those I have updated.

Co-authored-by: mitchmindtree <mitchell.nordine@gmail.com>
2020-03-15 23:18:13 +00:00
bors[bot]
c91758dc4a [rs] Merge #201
201: Add note that `slot` refers to the index in RenderPipelineDescriptor r=kvark a=aloucks

Add note that `slot` refers to the index in `RenderPipelineDescriptor::vertex_buffers`

Also fixed intra-doc links for `set_vertex_buffer`.

Co-authored-by: Aaron Loucks <aloucks@cofront.net>
2020-03-15 23:04:27 +00:00
Aaron Loucks
c89d7edff5 [rs] Add note that slot refers to the index in RenderPipelineDescriptor::vertex_buffers
Also fixed intra-doc links for `set_vertex_buffer`.
2020-03-15 15:38:31 -04:00
bors[bot]
fbff46dc8f [rs] Merge #197
197: Update for the latest spec changes r=grovesNL a=kvark

Blocked on https://github.com/gfx-rs/wgpu/pull/518

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2020-03-15 18:41:29 +00:00
mitchmindtree
ebf97c2843 [rs] Derive Hash and PartialEq for unique identifier wrapper types
This is particularly useful downstream for distinguishing between
instances of these types.

I was unsure about `Device` as I noticed it has a `Temp` field that
looks like it might eventually store some non-PartialEq/Hash-friendly
fields.

Let me know if you'd like me to add a derive for `Device` or if there
are any issues with those I have updated.
2020-03-15 18:43:16 +01:00
Dzmitry Malyshau
c467693253 Add quad -> MSL testing 2020-03-15 12:10:19 -04:00
Dzmitry Malyshau
4a72abb142 Remove Mul expression type 2020-03-15 12:10:19 -04:00
Dzmitry Malyshau
1957b09c4d Add WGSL parsing tests 2020-03-15 11:43:08 -04:00
Dzmitry Malyshau
fa0485f03f [rs] Update for the latest spec changes 2020-03-15 11:25:06 -04:00
Dzmitry Malyshau
a768af6011 Implement a fair bit of typifier logic, resolve access ids in WGSL 2020-03-15 10:59:12 -04:00
Dzmitry Malyshau
3c5a12412c Typifier lookups into constants, variables, and structs 2020-03-15 10:59:12 -04:00
Dzmitry Malyshau
6ba942330a Typifier skeleton 2020-03-15 10:59:12 -04:00
bors[bot]
39f17e5075 Merge #516
516: Move more shared types into wgpu-types r=kvark a=grovesNL



Co-authored-by: Joshua Groves <josh@joshgroves.com>
2020-03-15 02:01:36 +00:00
Joshua Groves
b58c15815b Move more shared types into wgpu-types 2020-03-14 23:08:05 -02:30
bors[bot]
e4df6ee288 Merge #518
518: Wholesome spec update r=grovesNL a=kvark

Addresses https://github.com/gfx-rs/wgpu-rs/issues/196
Biggest change is that buffer binding is done one by one. There is a number of renamings of the fields, also the binding types are expanded.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-03-14 16:45:33 +00:00
Dzmitry Malyshau
26657374f8 Update vertex layout naming 2020-03-14 12:44:04 -04:00
Dzmitry Malyshau
76eb307d35 Local variables, [wgsl] statement context 2020-03-14 09:36:26 -04:00
Dzmitry Malyshau
607b77899b [wgsl] add Lexer::skip() helper 2020-03-14 09:36:26 -04:00
Dzmitry Malyshau
d6a4e05e05 [wgsl] add parse_block, use for if statements 2020-03-14 09:36:26 -04:00
Dzmitry Malyshau
095f320470 Wholesome spec update.
Biggest change is that buffer binding is done one by one. There is a number of renamings of the fields, also the binding types are expanded.
2020-03-13 23:59:05 -04:00
Dzmitry Malyshau
16f018046a [wgsl] make lexer Error-aware 2020-03-13 17:11:55 -04:00
Dzmitry Malyshau
cb72a92bce [wgsl] improved decoration parsing 2020-03-12 14:13:42 -04:00
Dzmitry Malyshau
ee325a6a67 Add imported function calls 2020-03-12 14:13:42 -04:00
Dzmitry Malyshau
0f8e3e4b9b Singular, intrinsic, and derivative expressions 2020-03-12 13:09:19 -04:00
Dzmitry Malyshau
5e78c71a44 Rename Token/Id to Handle and Storage to Arena consistently 2020-03-11 16:28:13 -04:00
Dzmitry Malyshau
7e0b004c16 [wgsl] refactor Token 2020-03-11 13:36:14 -04:00
Dzmitry Malyshau
ee8e0699be [wgsl] remove Pest grammar 2020-03-11 13:36:14 -04:00
Dzmitry Malyshau
93d60ce8bf [wgsl] hand-written function parsing 2020-03-11 13:36:14 -04:00
Dzmitry Malyshau
e6fe97f410 [wgsl] rewrite with our own parser 2020-03-11 13:36:14 -04:00
bors[bot]
a74de20ac6 Merge #514
514: Move some types into shared wgpu-types crate r=kvark a=grovesNL

As we discussed a while ago, we need to be able to share some types between wgpu-core/wgpu-native/wgpu-remote/wgpu-rs.

The problem is that we want to avoid a dependency on wgpu-core and wgpu-native when building [wgpu-rs for the wasm32-unknown-unknown target](https://github.com/gfx-rs/wgpu-rs/issues/101). We can avoid this by moving all shared types into a separate crate which is exposed on all targets.

Let me know if we should use some other approach or organize the types somehow. This isn't complete yet, but it might be easier to integrate this over several PRs instead of diverging my branch too far.

Co-authored-by: Joshua Groves <josh@joshgroves.com>
2020-03-11 03:07:17 +00:00
Joshua Groves
24caf76765 Rename serde feature 2020-03-10 23:19:45 -02:30
Joshua Groves
9940aef599 Move some types into shared wgpu-types crate 2020-03-10 22:36:23 -02:30
bors[bot]
16855f6a7c [rs] Merge #192
192: Explicitly declare vertex attribute descriptors in cube example r=kvark a=aloucks

The new `vertex_attr_array!` macro is pretty wonderful, but it's nice to have at least one reference example of how `VertexAttributeDescriptor`s are constructed. 

Co-authored-by: Aaron Loucks <aloucks@cofront.net>
2020-03-08 23:37:25 +00:00
Aaron Loucks
738653d1fe [rs] Explicitly declare vertex attribute descriptors in cube example 2020-03-07 23:37:32 -05:00
Dzmitry Malyshau
a332377222 [rs] Add grr-2d 2020-03-06 11:38:54 -05:00
bors[bot]
79e9ab748d Merge #512
512: Add PresentMode::Mailbox r=kvark a=aloucks

@kvark 

Would you be open to renaming the presents modes to match the vulkan/gfx-hal nomenclature? Considering these aren't part of the webgpu spec, I think it would make more sense to keep things consistent.

I can update this PR if you're good with it.

```rust
pub enum PresentMode {
    /// The presentation engine does **not** wait for a vertical blanking period and 
    /// the request is presented immediately. This is a low-latency presentation mode,
    /// but visible tearing may be observed. Will fallback to `Fifo` if unavailable on the
    /// selected  platform and backend. Not optimal for mobile. 
    Immediate = 0,
    /// The presentation engine waits for the next vertical blanking period to update
    /// the current image, but frames may be submitted without delay. This is a low-latency 
    /// presentation mode and visible tearing will **not** be observed. Will fallback to `Fifo`
    /// if unavailable on the selected platform and backend. Not optimal for mobile.
    Mailbox = 1,
    /// The presentation engine waits for the next vertical blanking period to update 
    /// the current image. The framerate will be capped at the display refresh rate, 
    /// corresponding to the `VSync`. Tearing cannot be observed. Optimal for mobile.
    Fifo = 2,
}
```

Co-authored-by: Aaron Loucks <aloucks@cofront.net>
2020-03-06 15:04:41 +00:00
Aaron Loucks
fe95fddf5a Use vulkan nomenclature for PresentMode variants
https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPresentModeKHR.html
2020-03-06 00:48:45 -05:00
Dzmitry Malyshau
ae045edcb6 [rs] Add nannou to the friends list 2020-03-05 23:45:24 -05:00
msiglreith
3066c3b558 Fix newline handling (#11)
Support also non-LF variants
2020-03-05 22:52:24 -05:00
Dzmitry Malyshau
ee7882723a [wgsl] expect logical expressions, fix hex literals 2020-03-05 21:21:14 -05:00
Aaron Loucks
051d08424c Add PresentMode::Mailbox 2020-03-05 18:19:18 -05:00
Dzmitry Malyshau
330ce644d8 [wgsl] parse most binary expressions 2020-03-05 13:14:06 -05:00
Joshua Groves
279af921bc [wgsl] richer expression grammar 2020-03-05 11:22:50 -05:00
Dzmitry Malyshau
3bf1760d5b [ir] add SAMPLED image flag 2020-03-05 11:21:36 -05:00
bors[bot]
2388007d1a [rs] Merge #189
189: Reexport Backend and DeviceType from wgpu-core r=kvark a=aloucks

These types are exposed on the `AdaptorInfo` struct.

Co-authored-by: Aaron Loucks <aloucks@cofront.net>
2020-03-05 15:02:13 +00:00
Aaron Loucks
b2e70cc3d3 [rs] Reexport Backend and DeviceType from wgpu-core
These types are exposed on the `AdaptorInfo` struct.
2020-03-04 22:22:26 -05:00
bors[bot]
584c9d7554 Merge #509
509: Bug 1614703 - WebGPU render pipeline creation r=jgilbert,webidl,baku r=gecko a=kvark

Differential Revision: https://phabricator.services.mozilla.com/D64833

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/e01862df6ba32a18826fe6c2e38e4a57dad3e338

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2020-03-04 04:04:49 +00:00
Dzmitry Malyshau
cfe000ce23 Bug 1614703 - WebGPU render pipeline creation r=jgilbert,webidl,baku
Differential Revision: https://phabricator.services.mozilla.com/D64833

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/e01862df6ba32a18826fe6c2e38e4a57dad3e338
2020-03-03 23:00:43 -05:00
Dzmitry Malyshau
13a4c41121 Include test WGSL shaders 2020-03-03 22:57:20 -05:00