Commit Graph
236 Commits
Author SHA1 Message Date
Joshua Groves 761ce80947 Update to latest wgpu-{core,types} 2021-03-24 00:00:16 -02:30
Dan Wilhelm e836c73a7c Add overflow detection to hello-compute 2021-03-23 01:49:39 -07:00
bors[bot]andDzmitry Malyshau aabcc44744 Merge #792
792: Use implicit layout for hello-compute r=kvark a=kvark



Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-03-19 14:34:13 +00:00
Dzmitry Malyshau 5aaca1cefe Shader fixes with binary expressions 2021-03-19 01:34:19 -04: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
Dzmitry Malyshau d16c7a1e5a Update naga to gfx-16 2021-03-17 09:35:54 -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
Dzmitry Malyshau 33f1ac360e Use implicit layout for hello-compute 2021-03-15 11:21:42 -04:00
Dzmitry Malyshau 0cccf9ccee Update to naga-14 2021-03-14 00:50:35 -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
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
Dzmitry Malyshau 6d39d8f739 Update wgpu with the new vertex format 2021-02-27 22:56:47 -05:00
Patrick LaFontaine 3bb7c94b9e spelling error in skybox 2021-02-24 17:29:13 -05:00
Dzmitry Malyshau 60fe95205a Blend state API update 2021-02-19 16:16:19 -05:00
Dzmitry Malyshau e733e17e49 Update naga to gfx-11 2021-02-16 10:55:29 -05: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
Zsolt Bölöny 66b9633cf8 Convert PrimitiveState::cull_mode to Option<Face> 2021-02-11 12:59:47 +01: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
Dzmitry Malyshau 7235072f6d Update version and dependencies to gfx-9 2021-02-01 02:16:31 -05:00
Dzmitry Malyshau 74eed253d8 Convert cube, skybox, msaa-line, and mipmap, to WGSL
Validate example shaders in tests

Support WGSL on the Web via Naga

Port the shadow WGSL partially

Convert hello-compute and boids to WGSL

Conver the shadow's fragment shader to WGSL

Shader entry point refactor
2021-01-30 01:02:04 -05:00
Dzmitry Malyshau 517ce3ef8d Update wgpu to the new render pipeline descriptor API 2021-01-29 00:51:44 -05:00
Connor Fitzgerald 6d52bc5535 Add pipeline statistics and timeline queries 2021-01-16 01:05:03 -05:00
Niklas Korz 0578cda7a6 Move get_swap_chain_preferred_format from device to adapter
Squashed commit of the following:

commit 260976b10e3a54b253768d71e5e47c51b976c25c
Author: Niklas Korz <niklas@niklaskorz.de>
Date:   Mon Jan 11 20:23:31 2021 +0100

    Formatting

commit e3f837e1b6a81c8c7a9566ba6a2c6dd8adfbbde7
Author: Niklas Korz <niklas@niklaskorz.de>
Date:   Mon Jan 11 20:20:37 2021 +0100

    Update examples

commit b0774c0aa56fbdfe741dd6c0e86d55b8c6b42de3
Author: Niklas Korz <niklas@niklaskorz.de>
Date:   Mon Jan 11 19:31:29 2021 +0100

    Use adapter.get_swap_chain_preferred_format
2021-01-11 20:32:03 +01:00
Jay Oster dae801baa0 Replace futures with pollster
This PR removes all of the `futures` dependencies. `std::future` does not contain a lot of useful helpers available in futures. The obvious ones are `join_all`, `FutureExt::map`, and `block_on`.

* `join_all` is replaced with a `Vec<T>` and async blocks.
* `FuturesExt::map` in the web backend is replaced by rolling the `map` function into the `MakeSendFuture` type.
* `block_on` is provided by `pollster`.

The original code using `join_all` ignored the result type yielded by the Future from `map_async`. This code does the same, but makes dropping the result a little more obvious.

These should not be troublesome. Figured I would call them out anyway.

The last big change is replacing `futures-executor` in the examples with `async-executor`. A new concrete `Spawner` type is used in the example framework instead of an implementation of `futures_task::LocalSpawn`.
2021-01-07 10:10:18 -08:00
Andreas Reich 2b2aed3a46 Fixed inconsistent framerate in examples.
Does not affect web builds.
Previously, framerate would float between 30-40 fps depending on how many events would come in. Fast mouse movements over the window lead to higher framerates since request_redraw was called every 20ms (-> 50fps) AND all events were consumed, additionally the event loop would wake up only every 10ms, so actual rate of request_redraw depended on how often we'd wake up.
Fixed this by setting the max sleep time of the event loop to the remaining time until hitting the desired time interval since the last frame.

The difference is most visible on the spinning cubes in the shadow example since the cubes currently spin with a fixed angle per frame (independent of frame timings).
2021-01-05 22:58:28 +01:00
Manuel Gil a5f44f2759 Remove wgpu-subscriber -> subscriber alias in examples 2021-01-05 19:05:52 +00:00
Manuel Gil e00ef5d584 Expose get_swap_chain_preferred_format on Device
- Update examples to make use of the new method
2021-01-03 17:35:04 +00:00
Connor Fitzgerald 1d216c590e Use only 1 and 4 samples for msaa-line example 2020-12-21 15:34:19 -05:00
Dzmitry Malyshau f3d6d242d7 Update wgpu with Naga fixes and OpenGL backend 2020-12-17 13:03:27 -05:00
Emanuele Dalla Longa bdd6edecd2 Require labels to match gfx-rs/wgpu#1088
Change-Id: I1acc45a3023dfc78b6694bd4a28a0131f07b7ba7
2020-12-16 00:15:05 +01:00
Connor Fitzgerald a4202a4ff0 Add create_texture_with_data helper 2020-12-12 01:50:49 -05:00
Dzmitry Malyshau f213d1db8f Update wgpu with Naga changes, replace hello-triangle shaders with WGSL 2020-12-07 09:45:24 -05:00
Connor Fitzgerald 7dbe4274fb Integrate ETC and ASTC textures in skybox example 2020-12-06 16:51:57 -05:00
Dzmitry Malyshau 7b06c4a3f7 Introduce ShaderModuleDescriptor 2020-12-05 18:53:37 -05:00
kejor 423c2489b8 API and examples update for index_format 2020-12-04 20:29:42 -05:00
Dzmitry Malyshau 9c529b94f5 Adopt the updated bind group entry API 2020-11-30 22:31:31 -05:00
Diggory Blake bed49ac654 Print chosen adapter when running examples 2020-11-30 18:33:51 +00:00
Devin Hill 337612a49f make TextureViewArray take a slice of refs; fix texture-arrays example to match. 2020-11-24 21:09:00 -05:00
Dzmitry Malyshau 2dc59ba2d9 Port to the updated wgpu error model 2020-11-23 17:59:21 -05:00
Joshua Groves 4fafceb30a Fix typo 2020-11-21 00:07:57 -03:30
Joshua Groves 8d5ef65dcb Temporarily use BackendBit::PRIMARY in examples
`BackendBit::all()` allows GL/surfman to be used on macOS which appears
to prevent rendering with Metal (e.g. hello-triangle displays an empty
window).

surfman will be removed in later versions of gfx, which will allow us
to switch back to `BackendBit::all()` in the examples.
2020-11-20 23:33:10 -03:30
Dzmitry Malyshau 9c638a2707 Update wgpu, work around surface validation 2020-11-18 10:05:20 -05:00
infinitesnow 2c2f778dba Fixed size in "boids" example 2020-11-17 21:26:35 +01:00
Timo de Kort ee220edce0 Remove implicit conversion hello-triangle shader.vert 2020-11-15 23:13:53 +01:00
Stygeon ef56676cfc Removed unusued Uniform struct in texture-arrays example. 2020-11-12 02:26:58 +01:00