Commit Graph

769 Commits

Author SHA1 Message Date
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
bors[bot]
36fde2821b [rs] Merge #710
710: Implement read_buffer r=kvark a=fintelia

I'm not sure about the exact interface that makes sense, but this PR sketches out how read_buffer (and eventually also read_texture) could be implemented. 

Resolves #694

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
Co-authored-by: Jonathan Behrens <fintelia@gmail.com>
2021-02-06 20:53:26 +00:00
Jonathan Behrens
7a02bfca78 [rs] Implement read_buffer utility function 2021-02-06 11:22:37 -05:00
bors[bot]
21f0e66074 [rs] Merge #745
745: Bump wgpu-core r=kvark a=Imberflur

For the fix of this issue https://github.com/gfx-rs/wgpu/issues/1188

Co-authored-by: Imbris <imbrisf@gmail.com>
2021-02-06 05:16:11 +00:00
Imbris
b1e535d2b7 [rs] Bump wgpu-core 2021-02-05 22:02:48 -05:00
Dzmitry Malyshau
f9eb133370 [rs] Experimental ReadBuffer structure 2021-02-05 12:59:49 -05:00
bors[bot]
75cbc46d6e [rs] Merge #738
738: Update version and dependencies to gfx-9 r=kvark a=kvark



Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-02-01 07:17:07 +00:00
Dzmitry Malyshau
9755a464ae [rs] Update version and dependencies to gfx-9 2021-02-01 02:16:31 -05:00
bors[bot]
1e3eac2352 [rs] Merge #679
679: WGSL shader conversion for the examples r=grovesNL a=kvark

Blocked on:
  - ~~https://github.com/gfx-rs/naga/issues/335~~
  - ~~https://github.com/gfx-rs/naga/issues/336~~
  - ~~https://github.com/gfx-rs/wgpu/issues/1095~~
  - ~~https://github.com/gfx-rs/naga/pull/360~~
  - https://github.com/gfx-rs/gfx/pull/3622
  - ~~GL backend doing the program link check earlier~~

Converted:
- [x] boids
- [x] cube
- [x] mipmap
- [x] msaa-line
- [x] shadow
- [x] skybox
- [ ] texture-array
- [ ] water

Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
2021-01-30 06:05:49 +00:00
Dzmitry Malyshau
41a1c0e46f [rs] 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
bors[bot]
89284e07a4 [rs] Merge #734
734: Update wgpu to the new render pipeline descriptor API r=grovesNL a=kvark

MAJOR API BREAKING CHANGE
Gets us https://github.com/gfx-rs/wgpu/pull/1176

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-01-30 02:44:01 +00:00
Dzmitry Malyshau
edb342cffe [rs] Update wgpu to the new render pipeline descriptor API 2021-01-29 00:51:44 -05:00
bors[bot]
ba3595b8ab [rs] Merge #730
730: Fix the web backend in code and CI r=grovesNL a=kvark

Fixes #729

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2021-01-27 01:58:43 +00:00
Dzmitry Malyshau
8f6804caa1 [rs] Fix the web backend in code and CI 2021-01-26 20:58:13 -05:00
bors[bot]
2f3d6bce6f [rs] Merge #717
717: Fixup WebGL Building Docs r=kvark a=cwfitzgerald

Improved the docs for building wgpu for targeting webgl. This would have prevented https://github.com/gfx-rs/gfx/issues/3594.

I also think (but haven't changed yet) that all the examples should use `wgpu::BackendBit::all()` as that is really what people should be defaulting to.

(Rendered: https://github.com/cwfitzgerald/wgpu-rs/blob/webgl-docs/README.md#run-examples-on-the-web-wasm32-unknown-unknown)

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2021-01-23 23:53:30 +00:00
Connor Fitzgerald
316bd4f959 [rs] Fixup webgl docs 2021-01-23 18:20:41 -05:00
bors[bot]
7ea65e8f9f [rs] Merge #726
726: Bump wgpu-core and update texture_view_drop call r=kvark a=mkeeter

This PR updates to the latest `wgpu-core` commit ([wgpu #1163](https://github.com/gfx-rs/wgpu/pull/1163)), and is the counterpart to [wgpu-native #66](https://github.com/gfx-rs/wgpu-native/pull/66).

I'm using `wait = false` in the `texture_view_drop` call to match `buffer_drop` and `texture_drop` elsewhere `backend/direct.rs`, though I don't quite understand the implications 😅

Co-authored-by: Matt Keeter <matt.j.keeter@gmail.com>
2021-01-23 21:40:06 +00:00
Matt Keeter
3ca0b0cf9c [rs] Bump wgpu-core and update texture_view_drop call 2021-01-23 12:12:42 -05:00
bors[bot]
fe0644b040 [rs] Merge #720
720: Remove typed-arena dependency r=cwfitzgerald a=kvark

Also bumps the wgpu dependency to include https://github.com/gfx-rs/wgpu/pull/1160

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-01-20 06:03:01 +00:00
Dzmitry Malyshau
ea16651793 [rs] Remove typed-arena dependency 2021-01-19 22:01:54 -05:00
bors[bot]
f8bb6482ac [rs] Merge #716
716: Update Wgpu-Core r=trivial a=cwfitzgerald

This rollup fixes a pretty bad segfault that always occurs.

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2021-01-16 07:59:22 +00:00
Connor Fitzgerald
eb2d591d59 [rs] Update wgpu-core etc 2021-01-16 02:58:07 -05:00
bors[bot]
e71cb4c964 [rs] Merge #715
715: Add pipeline statistics and timeline queries r=kvark a=cwfitzgerald

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

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2021-01-16 06:06:18 +00:00
Connor Fitzgerald
af61d9c917 [rs] Add pipeline statistics and timeline queries 2021-01-16 01:05:03 -05:00
bors[bot]
cb2f9e45df [rs] Merge #713
713: Expose texture format feature query (and update to latest wgpu) r=kvark a=Wumpf

Exposes texture format feature query from https://github.com/gfx-rs/wgpu/pull/1112
Updating wgpu-core led to breaking change of moving get_swap_chain_preferred_format from device to adapter.

Co-authored-by: Andreas Reich <r_andreas2@web.de>
2021-01-13 23:51:48 +00:00
Andreas Reich
1974b2a344 [rs] Exposed get_texture_format_features on adapter 2021-01-13 23:23:44 +01:00
bors[bot]
5c9b6704c0 [rs] Merge #698
698: Format PassErrorScope pipelines r=kvark a=scoopr

Pairing for gfx-rs/wgpu#1132, formats the pipeline ids

Co-authored-by: Mikko Lehtonen <scoopr@iki.fi>
2021-01-12 21:34:35 +00:00
Mikko Lehtonen
9ab5cdbd1f [rs] Format PassErrorScope pipelines 2021-01-12 23:32:10 +02:00
bors[bot]
76bfba0969 [rs] Merge #709
709: Move get_swap_chain_preferred_format from device to adapter r=kvark a=niklaskorz

See https://github.com/gfx-rs/wgpu/pull/1142. This PR applies the necessary changes for the move of `get_swap_chain_preferred_format` from device to adapter.

Co-authored-by: Niklas Korz <niklas@niklaskorz.de>
2021-01-11 21:43:51 +00:00
Niklas Korz
4d2bec6cab [rs] 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
bors[bot]
1e3a93a632 [rs] Merge #707
707: Fix compilation on aarch64-apple-darwin r=kvark a=andykilroy

wgpu-rs couldn't compile on the Apple M1 (arm64) macs due to a compilation
problem in winit.  winit 0.24.0 has the fix so upgrade the dependency.

Link to the fix's pull request in winit:
   https://github.com/rust-windowing/winit/pull/1752

Co-authored-by: Andrew Kilroy <7545475+andykilroy@users.noreply.github.com>
2021-01-10 16:11:43 +00:00
Andrew Kilroy
08fd37b429 [rs] Fix compilation on aarch64-apple-darwin
wgpu-rs couldn't compile on the Apple M1 (arm64) macs due to a compilation
problem in winit.  winit 0.24.0 has the fix so upgrade the dependency.

Link to the fix's pull request in winit:
   https://github.com/rust-windowing/winit/pull/1752
2021-01-10 11:16:04 +00:00
bors[bot]
ee0d0cb2c5 [rs] Merge #706
706: Update to latest wgpu r=grovesNL a=ElArtista



Co-authored-by: TheArtist <agorglouk@gmail.com>
2021-01-10 10:43:20 +00:00