Commit Graph

901 Commits

Author SHA1 Message Date
bors[bot]
c45ea6f5b1 [rs] Merge #800
800: Schedule event waits after redraw events are cleared r=kvark a=kvark

As @adamnemecek pointed out, our examples were busy waiting.
I investigated a bit and figured that our `WaitScheduled` was always interrupted by `RedrawEventsCleared`. So scheduling the wait in it works. Tested on Linux and macOS. CPU time of the cube example drops from 100% to single-digit.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-03-18 03:00:21 +00:00
Dzmitry Malyshau
070688a84d [rs] Schedule event waits after redraw events are cleared 2021-03-17 22:58:35 -04:00
bors[bot]
0542ad585a [rs] Merge #798
798: Fix all the clippy lints r=kvark a=HalfVoxel

Clippy is now happy

Co-authored-by: Aron Granberg <aron.granberg@gmail.com>
2021-03-17 14:02:03 +00:00
Aron Granberg
162fe18e7d [rs] Fix all the clippy lints and add clippy/fmt CI 2021-03-17 14:40:25 +01:00
bors[bot]
af38afd58d [rs] Merge #799
799: Update naga to gfx-16 r=kvark a=kvark

Makes WGSL constants much more ergonomic to write, and fixes the issues we had with the water example.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-03-17 13:37:45 +00:00
Dzmitry Malyshau
2fae02d8b2 [rs] Update naga to gfx-16 2021-03-17 09:35:54 -04:00
bors[bot]
f89244e3c3 [rs] Merge #797
797: Move from `tracing` to `log` + `profiling` r=kvark a=cwfitzgerald

Continuation of https://github.com/gfx-rs/wgpu/pull/1268 into wgpu-rs

This also includes the naga gfx-15 train.

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2021-03-17 13:17:03 +00:00
Aron Granberg
aa45e7668b [rs] Fix excessive buffer padding (#795)
* Fix excessive buffer padding

* Prettify

* cargo fmt

* Simplify code

* Style
2021-03-17 09:09:58 -04:00
Connor Fitzgerald
3a131f5f60 [rs] Move from tracing to log + profiling 2021-03-17 01:34:38 -04:00
Wumpf
2bda1508f1 [rs] Added example for conservative rasterization (#791)
* Example for conservative rasterization

* Update to wgpu-core/types 717c2d73e7

* conservative-raster example: fix wglsl const & readme

* conservative raster example: optional lines, no more interaction
2021-03-15 22:33:44 -04:00
Dzmitry Malyshau
e80723aa12 [rs] Use implicit layout for hello-compute 2021-03-15 11:21:42 -04:00
bors[bot]
23c5e83167 [rs] Merge #790
790: Update to naga-14 r=kvark a=kvark

Depends on https://github.com/gfx-rs/wgpu/pull/1262
Makes our shaders nicer, and the uniformity analysis less cranky :)

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-03-14 05:51:10 +00:00
Dzmitry Malyshau
d1d941229c [rs] Update to naga-14 2021-03-14 00:50:35 -05:00
bors[bot]
db923b038e [rs] Merge #786
786: Update to naga-13 r=kvark a=kvark



Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-03-10 05:41:35 +00:00
Dzmitry Malyshau
d754964b08 [rs] Update to naga-13 2021-03-10 00:41:04 -05:00
bors[bot]
f525302ad5 [rs] Merge #781
781: Mark BufferMappedRange Send/Sync on native r=kvark a=cwfitzgerald

This fixes an issue reported on the matrix where this was causing things to unnecessarily be !Send. There's no reason I can see that this couldn't be Send/Sync as we only use it like one would a slice. We might also consider backporting this to 0.7.

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2021-03-04 05:11:32 +00:00
Connor Fitzgerald
9be3031cad [rs] Mark BufferMappedRange Send/Sync on native 2021-03-04 00:04:51 -05:00
bors[bot]
b53a00e730 [rs] Merge #778
778: Return None from get_swap_chain_preferred_format if the adapter does not support the surface r=kvark a=OlegOAndreev

Fixes #777 

Almost every other method in wgpu panics on failure, so I decided to make the return value an `Option<TextureFormat>`, not a `Result<Option<TextureFormat>>`

Co-authored-by: Oleg Andreev <ooandreev@yandex-team.ru>
2021-03-02 04:36:08 +00:00
bors[bot]
f94d2f9616 [rs] Merge #779
779: Update wgpu depth_or_array_layers r=kvark a=kvark

Based on https://github.com/gfx-rs/wgpu/pull/1241

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-03-02 04:26:42 +00:00
Dzmitry Malyshau
67655976e6 [rs] Update wgpu depth_or_array_layers 2021-03-01 23:26:08 -05:00
Oleg Andreev
5adaa23de9 [rs] Return None from get_swap_chain_preferred_format if the adapter does not support the surface. 2021-03-01 18:15:01 +03:00
bors[bot]
60fcb236b9 [rs] Merge #776
776: Update wgpu with the new vertex format r=kvark a=kvark

Based on https://github.com/gfx-rs/wgpu/pull/1235

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-02-28 03:57:40 +00:00
Dzmitry Malyshau
43423f922c [rs] Update wgpu with the new vertex format 2021-02-27 22:56:47 -05:00
bors[bot]
143d964f90 [rs] Merge #773
773: Panic on empty buffer slices r=kvark a=Wumpf

Fixes #735 
Can't really pass through zero sizes, so panic it is.

I'm really just here to update to latest wgpu version to get my recent fix there in a more convenient manner, but doing a PR with just that felt a bit boring ;-). Now I'm of course guilty of conflating things 🤔 

Co-authored-by: Andreas Reich <r_andreas2@web.de>
2021-02-25 15:59:36 +00:00
Andreas Reich
2bc930d905 [rs] panic on empty buffer slice
Fixes #735
2021-02-25 09:59:17 +01:00
bors[bot]
137d92c6b1 [rs] Merge #772
772: spelling error in skybox r=kvark a=Pat-Lafon



Co-authored-by: Patrick LaFontaine <32135464+Pat-Lafon@users.noreply.github.com>
2021-02-25 02:30:55 +00:00
Andreas Reich
efc4c6dbea [rs] Upgrade to latest wgpu 2021-02-25 00:24:49 +01:00
Patrick LaFontaine
190bd37e22 [rs] spelling error in skybox 2021-02-24 17:29:13 -05:00
Ashley
0476822863 [rs] Fix create_texture_with_data for 3d textures (#771)
* Fix create_texture_with_data for 3d textures

* Remove depth_per_iteration variable
2021-02-22 12:19:57 -05:00
bors[bot]
e913cefcc6 [rs] Merge #768
768: Update naga to gfx-12 r=kvark a=kvark

See https://github.com/gfx-rs/wgpu/pull/1226

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-02-21 17:07:53 +00:00
Dzmitry Malyshau
cb58bc214d [rs] Update naga to gfx-12 2021-02-21 12:07:26 -05:00
bors[bot]
c0b217a273 [rs] Merge #766
766: Blend state API update r=kvark a=kvark

Based on https://github.com/gfx-rs/wgpu/pull/1224

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-02-19 21:16:58 +00:00
Dzmitry Malyshau
5c680a1629 [rs] Blend state API update 2021-02-19 16:16:19 -05:00
bors[bot]
b75f6118bb [rs] Merge #765
765: Update naga to gfx-11 r=cwfitzgerald a=kvark

Gets us https://github.com/gfx-rs/wgpu/pull/1220

Note that "cross" feature is not optional here. We could lift it up and add to `default = []` but that would make the Web backend to always unconditionally depend on `wgpu-core` (since enabling a feature on it automatically enables it). So we ideally need a way for Cargo to allow platform-specific default features...

About the shadow example - the experimental translation works on the main pipeline, but fails on the baking pipeline because of https://github.com/gfx-rs/naga/issues/483. Fortunately, it falls back to SPIRV-Cross gracefully here.

The new validation detected a flaw in our shader (comparison sampler mismatch), yay!

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-02-19 05:03:27 +00:00
Dzmitry Malyshau
06b04a49e9 [rs] Update naga to gfx-11 2021-02-16 10:55:29 -05:00
bors[bot]
0368bca1dd [rs] Merge #744
744: Demonstrate obj loading in the skybox example r=kvark a=kvark

I wanted to see which example is best suited for `typed-arena` demo... and here I am, implementing a completely different unrelated feature. But I think it's useful, still ;)
Model loading is something everybody needs, and for us depending on `obj` in dev-dependencies cost nothing, especially since I'm basically maintaining it.

<img width="395" alt="screenshot" src="https://user-images.githubusercontent.com/107301/106993149-186c7780-6748-11eb-94ca-7988ef9ee52d.png">


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-02-13 03:34:39 +00:00
Dzmitry Malyshau
1a9bd4d14b [rs] Stop using vertex attributes in the mipmap example 2021-02-12 22:33:17 -05:00
Dzmitry Malyshau
710901b1aa [rs] Demonstrate obj loading in the skybox example 2021-02-12 22:33:17 -05:00
bors[bot]
218556c953 [rs] Merge #759
759: Correct FragmentState targets comment r=grovesNL a=Systemcluster

Previously the comment was copied verbatim from the `VertexState` `buffers` field. 

Co-authored-by: Chris <me@systemcluster.me>
2021-02-12 03:41:04 +00:00
Chris
795db84f38 [rs] Correct FragmentState targets comment 2021-02-12 04:29:06 +01:00
bors[bot]
7a9b622182 [rs] Merge #755
755: Add Instance::poll_all r=kvark a=lachlansneff

`Instance::poll_all` polls all devices. This will be useful for integrating into the winit event loop from a third-party crate.


Co-authored-by: Lachlan Sneff <lachlan.sneff@gmail.com>
2021-02-11 15:52:26 +00:00
bors[bot]
0542da88c9 [rs] Merge #756
756: Convert `PrimitiveState::cull_mode` to `Option<Face>` r=kvark a=yzsolt

Depends on https://github.com/gfx-rs/wgpu/pull/1206

Co-authored-by: Zsolt Bölöny <bolony.zsolt@gmail.com>
2021-02-11 15:29:30 +00:00
Zsolt Bölöny
7a31e4e333 [rs] Convert PrimitiveState::cull_mode to Option<Face> 2021-02-11 12:59:47 +01:00
Lachlan Sneff
5c209e8cfd [rs] Add Instance::poll_all 2021-02-10 02:15:18 -05:00
bors[bot]
f719dc0752 [rs] Merge #754
754: Update naga to gfx-10 r=kvark a=kvark

See https://github.com/gfx-rs/wgpu/pull/1205

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-02-09 15:22:59 +00:00
Dzmitry Malyshau
8ff65dce8d [rs] Update naga to gfx-10 2021-02-09 10:21:56 -05:00
bors[bot]
2dafc7c321 [rs] Merge #753
753: Use max function to ensure that the swapchain size is not less than 1. r=kvark a=Tnze

ATT

Co-authored-by: Tnze <cjd001113@outlook.com>
2021-02-09 15:12:44 +00:00
Tnze
e9d68a332d [rs] Use the "max" function to ensure that the swapchain size is not less than 1. For better readability. 2021-02-09 14:20:22 +08:00
bors[bot]
f72ff5e1ee [rs] Merge #752
752: Expose missing constants from wgpu-types r=cwfitzgerald a=Imberflur



Co-authored-by: Imbris <imbrisf@gmail.com>
2021-02-07 20:11:22 +00:00
Imbris
5a9801d86c [rs] Expose missing constants from wgpu-types 2021-02-07 15:08:17 -05:00