Commit Graph

2761 Commits

Author SHA1 Message Date
bors[bot]
be16c7f2f2 Merge #1294
1294: Update naga to gfx-19 r=kvark a=Gordon-F

Just a naga update. Also fix https://github.com/gfx-rs/wgpu/issues/1293.

Co-authored-by: Gordon-F <ishaposhnik@icloud.com>
2021-03-30 23:34:59 +00:00
Gordon-F
7fc70bf349 Force-enable EXPERIMENTAL_TRANSLATION flag when running without cross feature 2021-03-31 02:01:43 +03:00
Gordon-F
124d5e3a7c Update naga to gfx-19 2021-03-31 02:00:48 +03:00
bors[bot]
8d30098db8 [rs] Merge #824
824: make all labels use `wgpu::Label` r=kvark a=LU15W1R7H

This PR does a very minor change.

It replaces all occurences of `label: Option<'a str>` with `label: crate::Label`,
making the usage consistent all across the API.

This doesn't bring any benefit other than consistency.

I hope to have catched every occurance.


Co-authored-by: Luis Wirth <lwirth2000@gmail.com>
2021-03-30 18:48:24 +00:00
bors[bot]
569f87ebda Merge #1291
1291: Add color blend modes r=kvark a=cwfitzgerald

Continuation of #1289, because apparently you can't re-open an accidentally closed pull request if you force pushed...

Should be GTG.

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2021-03-30 17:39:26 +00:00
Connor Fitzgerald
0616a08c65 Add color blend modes 2021-03-30 13:37:43 -04:00
Luis Wirth
632f828eda [rs] make all labels use wgpu::Label
replace all occurences of `label: Option<'a str>` with `label: crate::Label`
2021-03-30 18:16:08 +02:00
bors[bot]
b0bf790a17 [rs] Merge #823
823: Fix crash-on-resize in skybox example r=kvark a=danwilhelm

Problem: Skybox example currently crashes on resize. 
- Solution: Now, recreates depth texture on resize event.
---
Problem: Shadow example currently duplicates texture creation code on resize. 
- Solution: Now, shadow is refactored identically to skybox & water examples -- minimizes code duplication, makes examples more similar.

Co-authored-by: Dan Wilhelm <dan@danwilhelm.com>
2021-03-30 03:55:48 +00:00
Dan Wilhelm
144bffb1a3 [rs] Refactor texture creation for shadow 2021-03-29 20:10:20 -07:00
bors[bot]
10dbb8746e [rs] Merge #819 #822
819: Boost texels alpha channel in cube example. r=kvark a=VincentFTS

Permits to have a good rendering for WebGL.

822: Update wasm-bindgen and web-sys to latest r=kvark a=grovesNL

#821 for `master`

On `master` it should be ok to update wasm-bindgen and web-sys, so we don't need to fix syn's version

Co-authored-by: VincentFTS <platforms@ftsoftware.fr>
Co-authored-by: Joshua Groves <josh@joshgroves.com>
2021-03-30 02:25:17 +00:00
Dan Wilhelm
96d9a87817 [rs] Recreate texture on resize for skybox 2021-03-29 19:24:00 -07:00
Joshua Groves
aa3792a68f [rs] Update wasm-bindgen and web-sys to latest 2021-03-29 22:24:32 -02:30
bors[bot]
456525d9c7 Merge #1290
1290: Update to latest gpu-alloc r=kvark a=Gordon-F



Co-authored-by: Igor Shaposhnik <Gordon-F@users.noreply.github.com>
2021-03-29 13:38:13 +00:00
Igor Shaposhnik
6097421647 Update to latest gpu-alloc 2021-03-29 09:33:40 +00:00
bors[bot]
ae880cbb93 [rs] Merge #815
815: Add missing re-exports r=kvark a=cwfitzgerald

Missed a couple wgt types.

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2021-03-26 20:21:13 +00:00
Connor Fitzgerald
2fd1047045 [rs] Add missing re-exports 2021-03-26 15:51:11 -04:00
VincentFTS
d81061eca8 [rs] Boost texels alpha channel in cube example.
Permits to have a good rendering for WebGL.
2021-03-26 18:43:45 +01:00
bors[bot]
e07a7cb539 [rs] Merge #814
814: Update to latest wgpu, naga, gfx. r=kvark a=Gordon-F

Update to latest wgpu, naga, gfx and enable `EXPERIMENTAL_TRANSLATION` with GL backend for `boids`, `cube` and `hello-compute`.

Co-authored-by: Gordon-F <ishaposhnik@icloud.com>
2021-03-25 23:54:46 +00:00
Gordon-F
6485e81f4b [rs] Enable EXPERIMENTAL_TRANSLATION with GL backend for some examples 2021-03-25 22:11:51 +03:00
Gordon-F
6d62cc5bc3 [rs] Update to latest wgpu, naga, gfx. 2021-03-25 21:46:35 +03:00
bors[bot]
b7ba481a91 Merge #1282
1282: Update naga to gfx-18 r=kvark a=Gordon-F

Same as https://github.com/gfx-rs/gfx/pull/3695. Just waiting for new naga relese.

Co-authored-by: Gordon-F <ishaposhnik@icloud.com>
2021-03-25 14:01:12 +00:00
Gordon-F
c1f8203f3c Update naga to gfx-18 2021-03-25 16:59:16 +03:00
bors[bot]
d8cbb8615a [rs] Merge #813
813: Fix dropping for command encoders r=grovesNL a=kvark

We weren't dropping them properly, and since the ID is just an obfuscated `Box<RealStuff>` that made the contents leak.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-03-25 03:29:02 +00:00
Dzmitry Malyshau
17e95abfe0 [rs] Fix dropping for command encoders 2021-03-24 22:34:00 -04:00
bors[bot]
e5dfafb3cc Merge #1281
1281: Rename `level_count` to `mip_level_count` r=kvark a=grovesNL

**Description**
This PR renames `level_count` to `mip_level_count` on `TextureViewDescriptor`. This follows the naming in the specification, located at https://gpuweb.github.io/gpuweb/#texture-view-creation

**Testing**
`cargo build` and `cargo test` only, naming changes will be made downstream in wgpu-rs too.

Co-authored-by: Joshua Groves <josh@joshgroves.com>
2021-03-24 14:56:00 +00:00
Joshua Groves
9885bdf320 Rename level_count to mip_level_count
This follows the naming in the specification, located at
https://gpuweb.github.io/gpuweb/#texture-view-creation
2021-03-24 09:14:30 -02:30
bors[bot]
95aa26dc60 [rs] Merge #811
811: Update to latest wgpu-{core,types} r=kvark a=grovesNL



Co-authored-by: Joshua Groves <josh@joshgroves.com>
2021-03-24 02:43:47 +00:00
Joshua Groves
e65ef710a5 [rs] Update to latest wgpu-{core,types} 2021-03-24 00:00:16 -02:30
Pâris DOUADY
39e1835f72 [rs] Passthrough cross feature to wgpu-core (#810)
* Passthrough cross feature to wgpu-core

Hopefully it can even be removed when `naga` is more mature. :-)

* remove unconditional cross for wgc
2021-03-23 13:01:01 -04:00
bors[bot]
9c98ebc48c Merge #1276
1276: Align create_swap_chain function signature r=cwfitzgerald a=kvark

**Connections**
Follow-up to #1034

**Description**
Swapchains are a bit special. Browsers don't use wgpu-core's swapchains, so we never bothered to convert them into the error model. But we still need this for Deno and webgpu-headers.

**Testing**
Untested, but also harmless

Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
2021-03-23 14:39:57 +00:00
Dzmitry Malyshau
f953266bbe Align create_swap_chain function signature 2021-03-23 10:39:13 -04:00
bors[bot]
56465df92b [rs] Merge #809
809: Add overflow detection to hello-compute r=kvark a=danwilhelm

Description
The `hello-compute` example sometimes gives incorrect results if an intermediate Collatz value overflows. 

Proposed Solution
We can detect overflows before they occur, since the `3n+1` step is the only possible overflow. (WGSL only supports u32.)

Example
`cargo run --example hello-compute 77031 837799 8400511 63728127` 
> Incorrect Current Output: `[350, 524, 312, 346]`
> Correct Output: `[350, 524, 685, 949]`
> Proposed Solution: `[350, 524, OVERFLOW, OVERFLOW]`

Notes
- The `hello-compute` example appears to be [borrowed from naga](https://github.com/gfx-rs/naga/blob/master/tests/in/collatz.wgsl), so this would cause the implementations to differ.
- Hexadecimal literals are not yet implemented in naga for WGSL shaders, so the shader literals are not as pretty as they could be.
- Revised terminology `times` -> `steps` to be consistent with [Wikipedia](https://en.wikipedia.org/wiki/Collatz_conjecture).


Co-authored-by: Dan Wilhelm <dan@danwilhelm.com>
2021-03-23 14:32:47 +00:00
bors[bot]
2bc5526fbe Merge #1280
1280: Rename color/depth attachments to match spec r=kvark a=grovesNL

**Description**
- Rename `ColorAttachmentDescriptor` to `RenderPassColorAttachment` (https://gpuweb.github.io/gpuweb/#color-attachments)
- Rename `DepthStencilAttachmentDescriptor` to `RenderPassDepthStencilAttachment` (https://gpuweb.github.io/gpuweb/#depth-stencil-attachments)
- Rename `attachment` fields on both attachments to `view`

**Testing**
None (just `cargo build`) because the renaming downstream should be trivial.

Co-authored-by: Joshua Groves <josh@joshgroves.com>
2021-03-23 14:27:52 +00:00
Joshua Groves
a5693ab2a3 Rename color/depth attachments to match spec
- Rename `ColorAttachmentDescriptor` to `RenderPassColorAttachment`
- Rename `DepthStencilAttachmentDescriptor` to `RenderPassDepthStencilAttachment`
- Rename `attachment` fields on both attachments to `view`
2021-03-23 09:31:59 -02:30
Dan Wilhelm
985c1feb4e [rs] Add overflow detection to hello-compute 2021-03-23 01:49:39 -07:00
bors[bot]
fb0288a377 Merge #1279
1279: Fix some typos r=kvark a=grovesNL

**Description**
Fix a few small typos in doc comments

**Testing**
None

Co-authored-by: Joshua Groves <josh@joshgroves.com>
2021-03-23 06:44:11 +00:00
bors[bot]
b90199bec3 Merge #1278
1278: Rename copy views and layout to match spec r=kvark a=grovesNL

**Description**
Match the specification naming changes from https://github.com/gpuweb/gpuweb/pull/1375

**Testing**
None because the changes downstream to wgpu-rs and wgpu-native should be trivial (renaming only)

Co-authored-by: Joshua Groves <josh@joshgroves.com>
2021-03-23 03:41:46 +00:00
Joshua Groves
306eaf3969 Fix some typos 2021-03-23 01:01:32 -02:30
Joshua Groves
9058f3ba62 Rename copy views and layout to match spec 2021-03-23 00:48:42 -02:30
bors[bot]
d18cc67131 [rs] Merge #785
785: Update to latest web-sys bindings r=kvark a=grovesNL

We can wait for https://github.com/rustwasm/wasm-bindgen/pull/2482 first

Co-authored-by: Joshua Groves <josh@joshgroves.com>
2021-03-23 02:56:58 +00:00
Joshua Groves
76f260c7c6 [rs] Update to latest web-sys bindings 2021-03-23 00:22:30 -02:30
bors[bot]
8dd9bd8af9 Merge #1275
1275: rows_per_image & rows_per_image are now optional r=kvark a=Wumpf

Fixes #988
Was surprisingly hard, hope it's correct; testing could be more extensive...
Ideas for more elegant handling very welcome.

**Testing**
Tested against wgpu-rs samples


Co-authored-by: Andreas Reich <r_andreas2@web.de>
2021-03-22 02:36:36 +00:00
Andreas Reich
720c73fa9c Review feedback / fix validate_linear_texture_data 2021-03-21 09:01:31 +01:00
bors[bot]
f11765de4d [rs] Merge #806
806: Remove "how to compile the shaders" section on README r=kvark a=yutannihilation

I believe all the examples now use WGSL, so this section is no longer needed.

Co-authored-by: Hiroaki Yutani <yutani.ini@gmail.com>
2021-03-21 02:29:25 +00:00
Hiroaki Yutani
20a903726a [rs] Remove "how to compile the shaders" section on README
I believe all the examples now use WGSL, so this section is no longer needed.
2021-03-20 23:58:30 +09:00
Andreas Reich
50043875e5 rows_per_image & rows_per_image are now optional
Fixes #988
2021-03-20 12:33:28 +01:00
bors[bot]
3add458e99 [rs] Merge #805
805: Update naga to gfx-17 r=kvark a=kvark

Gets Naga validation, MSL fixes, GLSL varying fixes, and better pipeline creation errors.

Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
2021-03-19 20:37:42 +00:00
Dzmitry Malyshau
332de311e0 [rs] Update naga to gfx-17 2021-03-19 16:36:30 -04:00
bors[bot]
c831c5512a Merge #1273
1273: Properly return native shader module errors to users r=kvark a=Gordon-F

**Testing**
Disable `cross` feature, break `naga` and see what happens 😄 

```log
wgpu error: Validation Error

Caused by:
    In Device::create_render_pipeline
    Internal error in stage VERTEX: Error compiling the shader "\"Compilation failed: \\n\\nprogram_source:1:1: error: unknown type name \\\'sadgasdgasdgasdg\\\'\\nsadgasdgasdgasdg aasdgadsgb>\\n^\\nprogram_source:1:28: error: expected \\\';\\\' after top level declarator\\nsadgasdgasdgasdg aasdgadsgb>\\n   
```



Co-authored-by: Gordon-F <ishaposhnik@icloud.com>
2021-03-19 18:13:28 +00:00
Gordon-F
d20c0199d7 Properly return native shader module errors to users 2021-03-19 21:09:54 +03:00