Commit Graph

9013 Commits

Author SHA1 Message Date
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
Dzmitry Malyshau
e87f57d82c Fix expression validation check 2021-03-25 09:32:55 -04:00
Dzmitry Malyshau
4fb4133298 [spv-in] fix image array index type to be signed 2021-03-25 09:21:58 -04:00
Dzmitry Malyshau
26f629ccb4 [spv-in] fix image operand iteration, add support for constant offsets 2021-03-25 09:21:58 -04:00
Dzmitry Malyshau
c8bac4b618 [spv-in] convert the shift to unsigned 2021-03-25 09:21:58 -04: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
Dzmitry Malyshau
06d777b609 Make layout validation optional, disable the struct size check 2021-03-24 21:03:00 -04:00
Dzmitry Malyshau
a0b5717fed Validate image stores 2021-03-24 12:32:32 -04:00
Dzmitry Malyshau
69a0fbd00e Validate image sampling and value casting 2021-03-24 12:32:32 -04:00
Dzmitry Malyshau
8c73c0c5df Validate derivatives and image loads 2021-03-24 12:32:32 -04:00
Dzmitry Malyshau
7a246f6a14 Validate image queries and valid shader stages for derivatives 2021-03-24 12:32:32 -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
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]
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
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]
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
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]
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]
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]
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