Commit Graph
8897 Commits
Author SHA1 Message Date
Joshua Groves e65ef710a5 [rs] Update to latest wgpu-{core,types} 2021-03-24 00:00:16 -02:30
Gordon-F ee43776c08 [glsl-out] Add samplers to reflection info 2021-03-23 22:14:22 -04:00
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]andDzmitry Malyshau 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]andDan Wilhelm 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]andJoshua Groves 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
Dzmitry Malyshau 374f12b6ab ID generator for SPIR-V 2021-03-23 10:11:50 -04:00
Dzmitry Malyshau 8712020115 Move Layouter into ModuleInfo 2021-03-23 10:11:50 -04: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]andJoshua Groves 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]andJoshua Groves 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]andJoshua Groves 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
Dzmitry Malyshau 15a1941d6a [msl-out] adjust error/stack size expectations 2021-03-22 15:17:00 -04:00
Dzmitry Malyshau 6086f13bf0 Move the growable typifier into frontend helpers 2021-03-22 15:17:00 -04:00
Dzmitry Malyshau d4bc463d50 Stop using the old Typifier in the backends 2021-03-22 15:17:00 -04:00
Dzmitry Malyshau 970b77abaf Make type a part of ExpressionInfo 2021-03-22 15:17:00 -04:00
Dzmitry Malyshau 1d3f2bbdb1 Merge FunctionAnalysisError into FunctionError 2021-03-22 15:17:00 -04:00
bors[bot]andAndreas Reich 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
Dzmitry Malyshau 1b3e7294fd Move type validation into a sub-module 2021-03-21 22:27:32 -04:00
Dzmitry Malyshau 1ddea0fdbb Validate layouts 2021-03-21 22:27:32 -04:00
Andreas Reich 720c73fa9c Review feedback / fix validate_linear_texture_data 2021-03-21 09:01:31 +01:00
bors[bot]andHiroaki Yutani 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
Dzmitry Malyshau e3ae5904ba Move AnalysisFlags into ValidationFlags, add bits for expressions and blocks 2021-03-20 22:25:49 -04:00
Dzmitry Malyshau efcfa37634 Implement Index for Layouter 2021-03-20 22:25:49 -04:00
Dzmitry Malyshau c992e638fe Move all the validation into a separate meta-module 2021-03-20 22:25:49 -04:00
Dzmitry Malyshau caee860b70 Make uniformity analysis optional 2021-03-20 22:25:49 -04: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]andDzmitry Malyshau 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]andGordon-F 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
bors[bot]andDzmitry Malyshau 92936954d8 Merge #1274
1274: Update naga to gfx-17 r=kvark a=kvark

**Connections**
Includes https://github.com/gfx-rs/gfx/pull/3688

**Description**
Here comes the "gfx-17" naga train!

**Testing**
Tested on wgpu-rs examples

Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
2021-03-19 17:44:28 +00:00
Dzmitry Malyshau c52dad9d47 Update naga to gfx-17 2021-03-19 13:43:11 -04:00
Dzmitry Malyshau d5fbb193c3 Validate Select and Relational expressions 2021-03-19 10:39:54 -04:00
Dzmitry Malyshau c2f70aaf80 Validate binary expressions 2021-03-19 10:39:54 -04:00
Dzmitry Malyshau daab319dc0 Validate Expression::Compose 2021-03-19 10:39:54 -04:00
bors[bot]andDzmitry Malyshau a2d8e10c7d [rs] 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
bors[bot]andDzmitry Malyshau b3bc3d02e0 [rs] 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 b9c60811f8 [rs] Shader fixes with binary expressions 2021-03-19 01:34:19 -04:00
Dzmitry Malyshau d58f9bdfde Merge sample mask in/out builtins 2021-03-18 21:57:48 -04:00
Dzmitry Malyshau 67ca0e7e7f First bits of expression validation 2021-03-18 11:43:00 -04:00
Dzmitry Malyshau 72ede02888 Reduce the typifier error sizes 2021-03-18 10:26:26 -04:00
Dzmitry Malyshau 8c4598a141 [msl-out] test put_expession stack footprint in debug
Also change io::Error to fmt::Error
2021-03-18 10:26:26 -04:00
Dzmitry Malyshau 6e71366bd3 Test typifier error sizes 2021-03-18 10:26:26 -04:00