Commit Graph

2761 Commits

Author SHA1 Message Date
Joshua Groves
0fbb75ea95 [rs] Expose more functions on the web backend 2020-04-18 01:04:28 -02:30
Joshua Groves
1f4b8801f5 [rs] Combine wasm_main/main and add console_log 2020-04-18 01:04:28 -02:30
Joshua Groves
c3c5d3927a [rs] Switch event loop back to ControlFlow::Poll 2020-04-18 01:04:28 -02:30
Joshua Groves
c4be28fcd9 [rs] Allow describe example to run on the web 2020-04-18 01:04:28 -02:30
Joshua Groves
095d682a5b [rs] Get shadow mostly working
Some of the implementation is still missing in Canary
2020-04-18 01:04:28 -02:30
Joshua Groves
3b8e0db62a [rs] Update to latest winit and wasm-bindgen 2020-04-18 01:04:28 -02:30
Joshua Groves
44083411d9 [rs] Only expose adapter info on native 2020-04-18 01:04:28 -02:30
Joshua Groves
654833ea56 [rs] Get capture mostly working
`File::create` isn't available on wasm, so we can't actually write the
output image anywhere unless we target something else as the file
system (e.g. local storage)
2020-04-18 01:04:28 -02:30
Joshua Groves
8f7d8cf27e [rs] Get mipmap mostly working
Subresource tracking for mip levels isn't available in Canary yet, so
we can't verify that the web example output matches native
2020-04-18 01:04:28 -02:30
Joshua Groves
c7dc1f6140 [rs] Get skybox working 2020-04-18 01:04:28 -02:30
Joshua Groves
49ef627bb0 [rs] Get cube working 2020-04-18 01:04:28 -02:30
Joshua Groves
9aedbed2eb [rs] Get boids working 2020-04-18 01:04:28 -02:30
Joshua Groves
75ec7155f1 [rs] Add web backend 2020-04-18 01:04:28 -02:30
bors[bot]
daf45362bc Merge #591
591: Warn when binding a buffer that is still mapped r=kvark a=almarklein

Fixes #510

I'd like to make more contributions wrt validation. Though I'm quite new to Rust, so let's start small :)  

From the discussion in #510 I concluded that in this case the buffer has actually been dropped, does the error message make sense like this?

Do the messages logged with `log::warn`, end up in the same logging system as the layer validation messages? So a solution to get those messages into Python (for wgpu-py) would work for both kinds of validation messages?


Co-authored-by: Almar Klein <almar.klein@gmail.com>
2020-04-17 21:15:19 +00:00
bors[bot]
f984eb1997 [rs] Merge #259
259: Remove zerocopy and replace with bytemuck. r=kvark a=StarArawn

fixes #146 

I've removed `zerocopy` from the examples and replaced it with `bytemuck`. I ran all of the examples/tests and everything ran great in vulkan on my windows box.

Co-authored-by: StarToaster <startoaster23@gmail.com>
2020-04-17 14:11:30 +00:00
StarToaster
f2d429570c [rs] Removed zerocopy and replaced it with bytemuck. 2020-04-17 10:07:24 -04:00
bors[bot]
4bf3d57bb5 Merge #595
595: Derive swapchain layout off the load operation r=kvark a=kvark

Fixes https://github.com/gfx-rs/wgpu-rs/issues/258

It's fairly simple. We expect there to be exactly one `LoadOp::Clear` for the swapchain attachment, and for it to be the first pass in a frame using it. Any other passes need to do `LoadOp::Load`.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-04-17 04:01:08 +00:00
Dzmitry Malyshau
dbb261b7f1 Remove wgpu-native and wgpu-remote 2020-04-16 22:35:59 -04:00
Dzmitry Malyshau
8eefe269c1 Derive swapchain layout off the load operation 2020-04-16 21:49:24 -04:00
Almar Klein
e7005548c0 Warn when binding a buffer that is still mapped 2020-04-16 11:35:03 +02:00
bors[bot]
6b0751f1f8 Merge #586
586: Improve drawing error messages r=kvark a=HalfVoxel



Co-authored-by: Aron Granberg <aron.granberg@gmail.com>
2020-04-15 12:59:58 +00:00
bors[bot]
2b120018f5 Merge #583
583: Improve error messages when passing buffers with the wrong usage flags r=kvark a=HalfVoxel

e.g.

```
thread 'main' panicked at 'An invalid setIndexBuffer call has been made. The buffer usage is COPY_DST | VERTEX which does not contain required usage INDEX
```

Co-authored-by: Aron Granberg <aron.granberg@gmail.com>
2020-04-15 12:30:48 +00:00
Aron Granberg
41a6425fb2 Improve drawing error messages 2020-04-15 02:29:37 +02:00
bors[bot]
6de38a7792 Merge #584
584: Fix vertex format enum to match the native header r=kvark a=kvark

This was one of the problems to get wgpu-rs examples on the web.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-04-14 21:15:30 +00:00
Dzmitry Malyshau
82a7791763 Fix vertex format enum to match the native header 2020-04-14 17:14:17 -04:00
Aron Granberg
5f6accc206 Improve error messages when passing buffers with the wrong usage flags 2020-04-14 20:18:00 +02:00
bors[bot]
729ecb1404 Merge #582
582: Track pipeline layout lifetime r=grovesNL a=kvark

Fixes #580
This one is interesting: it's not instantly destroyed when dropped, like bind group layouts. And it's not tracked for GPU usage like the resources. It's somewhat in-between. We have the following classes of tracking now:
  1. no tracking, destroyed on drop. Applies to: bind group layouts, adapters
  2. only CPU-side tracking. They go to "suspected" list on drop of self or anything that can point to them. Applies to: pipeline layouts
  3. full GPU tracking. They go to "suspected" list on drop, then get associated with active submission before destruction. Applies to: buffers, textures, views, bind groups, pipelines

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-04-14 13:08:29 +00:00
bors[bot]
32cf9d22e7 [rs] Merge #256
256: Update wgpu for texture descriptor changes r=grovesNL a=kvark

Updates for https://github.com/gfx-rs/wgpu/pull/577
Detaches us from crates-io dependency (again).

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-04-14 11:30:02 +00:00
bors[bot]
96a4a34b83 Merge #581
581: Fix buffer unmap warning r=kvark a=kvark

It's more consistent if neither map_buffer or unmap_buffer care about the status.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-04-14 11:24:19 +00:00
Dzmitry Malyshau
4537304571 [rs] Update wgpu for texture descriptor changes 2020-04-14 01:13:47 -04:00
Dzmitry Malyshau
3cc4fa51bc Track pipeline layout lifetime 2020-04-14 00:58:30 -04:00
Dzmitry Malyshau
a0701b41cb Fix buffer unmap warning 2020-04-14 00:08:04 -04:00
bors[bot]
49dbe08f37 Merge #578
578: Comment fixes, header update r=kvark a=kvark

Matches review fixes in https://phabricator.services.mozilla.com/D70707

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-04-13 22:49:11 +00:00
Dzmitry Malyshau
379ea37982 Comment fixes, header update 2020-04-13 18:48:08 -04:00
bors[bot]
8d1185f3e9 Merge #577
577: Remove array layer count from texture descriptor r=grovesNL a=kvark

Matches https://github.com/gpuweb/gpuweb/pull/613

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-04-13 18:16:06 +00:00
Dzmitry Malyshau
d9609ec269 Remove array layer count from texture descriptor 2020-04-13 11:44:10 -04:00
bors[bot]
f50dd7a299 Merge #570
570: Improve error message when bind group and bind group layout have different number of entries r=kvark a=HalfVoxel



Co-authored-by: Aron Granberg <aron.granberg@gmail.com>
2020-04-13 00:17:43 +00:00
bors[bot]
18a80e735f [rs] Merge #254
254: Specify expected structure for draw_indirect and draw_indexed_indirect r=kvark a=lachlansneff

~~Based on https://www.khronos.org/opengl/wiki/Vertex_Rendering#Indirect_rendering.~~ Turns out the opengl docs are wrong. Based on https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDrawIndirectCommand.html.

Co-authored-by: Lachlan Sneff <lachlan.sneff@gmail.com>
2020-04-12 16:14:15 +00:00
Lachlan Sneff
3d7bc8c528 [rs] Fix documentation based on vulkan docs 2020-04-12 10:56:15 -04:00
bors[bot]
c3ebf3b9a3 [rs] Merge #251
251: cargo fmt the code and tweak format rules r=kvark a=chao-mu

Ran cargo fmt after removing rules per @kvark, two of which were because they needed nightly to run.

Co-authored-by: Hackpoetic <chao-mu@hackpoetic.com>
2020-04-12 12:24:30 +00:00
Lachlan Sneff
5f8ab36938 [rs] Specified expected structure for draw_indirect and draw_indexed_indirect 2020-04-11 23:33:31 -04:00
bors[bot]
312fa3da62 Merge #573
573: Fix read-only flags r=kvark a=kvark



Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-04-12 00:51:26 +00:00
Dzmitry Malyshau
357ee9a447 Fix read-only flags 2020-04-11 20:50:20 -04:00
bors[bot]
77aee875b3 [rs] Merge #252
252: Typo r=grovesNL a=maghoff

Remove extra word

Co-authored-by: Magnus Hoff <maghoff@gmail.com>
2020-04-11 12:59:28 +00:00
Magnus Hoff
61159e6831 [rs] Typo
Remove extra word
2020-04-11 13:09:45 +02:00
Aron Granberg
3db1e6c10d Improve error message when bind group and bind group layout have different number of entries 2020-04-11 11:22:40 +02:00
Hackpoetic
fb87e4fa84 [rs] add missing rust format config 2020-04-11 00:05:18 -04:00
Hackpoetic
1927fe6586 [rs] cargo fmt the code and tweak format rules 2020-04-10 22:56:24 -04:00
Igor Shaposhnik
877e0016eb [rs] Migrate CI to GitHub Actions 2020-04-10 10:59:21 -04:00
bors[bot]
6b627451bc Merge #565
565: Usage tracking fixes for swapchain and command buffers r=kvark a=kvark

Fixes #561 
see description in commit messages

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-04-10 04:40:15 +00:00