Commit Graph
802 Commits
Author SHA1 Message Date
bors[bot]andDzmitry Malyshau f7db718542 Merge #803
803: Shader fixes with binary expressions r=kvark a=kvark

Goes along with https://github.com/gfx-rs/naga/pull/599

Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
2021-03-19 05:36:54 +00:00
Dzmitry Malyshau 5aaca1cefe Shader fixes with binary expressions 2021-03-19 01:34:19 -04:00
bors[bot]andDzmitry Malyshau 0f1b290af9 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 eeb6a698ae Schedule event waits after redraw events are cleared 2021-03-17 22:58:35 -04:00
bors[bot]andAron Granberg 5c249c4375 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 f78ccfe09e Fix all the clippy lints and add clippy/fmt CI 2021-03-17 14:40:25 +01:00
bors[bot]andDzmitry Malyshau 66b900bf8d 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 d16c7a1e5a Update naga to gfx-16 2021-03-17 09:35:54 -04:00
bors[bot]andConnor Fitzgerald a7e03546c1 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 50fdd1e599 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 0b010163cc Move from tracing to log + profiling 2021-03-17 01:34:38 -04:00
Wumpf ea14d4067d 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
bors[bot]andDzmitry Malyshau 96ca1e41dd 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 0cccf9ccee Update to naga-14 2021-03-14 00:50:35 -05:00
bors[bot]andDzmitry Malyshau b3efd07b20 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 ebd1f8d32e Update to naga-13 2021-03-10 00:41:04 -05:00
bors[bot]andConnor Fitzgerald cadc2df8a1 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 bfeab73eeb Mark BufferMappedRange Send/Sync on native 2021-03-04 00:04:51 -05:00
bors[bot]andOleg Andreev ae7b47784b 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]andDzmitry Malyshau 70d7850795 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 d4ec1157f0 Update wgpu depth_or_array_layers 2021-03-01 23:26:08 -05:00
Oleg Andreev c9a7fe75d4 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]andDzmitry Malyshau fd4a992533 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 6d39d8f739 Update wgpu with the new vertex format 2021-02-27 22:56:47 -05:00
bors[bot]andAndreas Reich 1509128f6d 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 b4859d3ecf panic on empty buffer slice
Fixes #735
2021-02-25 09:59:17 +01:00
bors[bot]andPatrick LaFontaine 3ec521c866 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 1ebd9e2778 Upgrade to latest wgpu 2021-02-25 00:24:49 +01:00
Patrick LaFontaine 3bb7c94b9e spelling error in skybox 2021-02-24 17:29:13 -05:00
Ashley a86612e4ef 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]andDzmitry Malyshau 75e77d1872 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 7fc75c4ec7 Update naga to gfx-12 2021-02-21 12:07:26 -05:00
bors[bot]andDzmitry Malyshau 5879936e23 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 60fe95205a Blend state API update 2021-02-19 16:16:19 -05:00
bors[bot]andDzmitry Malyshau 243dbf21a4 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 e733e17e49 Update naga to gfx-11 2021-02-16 10:55:29 -05:00
bors[bot]andDzmitry Malyshau 2aa7705444 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 657ee0ba61 Stop using vertex attributes in the mipmap example 2021-02-12 22:33:17 -05:00
Dzmitry Malyshau de8182f152 Demonstrate obj loading in the skybox example 2021-02-12 22:33:17 -05:00
bors[bot]andChris 6864c0be84 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 aeec413452 Correct FragmentState targets comment 2021-02-12 04:29:06 +01:00
bors[bot]andLachlan Sneff 229dbb3491 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]andZsolt Bölöny f608bafff8 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 66b9633cf8 Convert PrimitiveState::cull_mode to Option<Face> 2021-02-11 12:59:47 +01:00
Lachlan Sneff c233c33cd0 Add Instance::poll_all 2021-02-10 02:15:18 -05:00
bors[bot]andDzmitry Malyshau 0234f2723a 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 35fa7c184e Update naga to gfx-10 2021-02-09 10:21:56 -05:00
bors[bot]andTnze b8ba5c243a 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 6e6816e938 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]andImbris b029ddeda3 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