Commit Graph
9013 Commits
Author SHA1 Message Date
Lachlan Sneff 960551f952 Add support for arrayLength to the wgsl frontend (#805)
* Add support for arrayLength to the wgsl frontend

* Fix clippy warning
2021-04-30 00:20:09 -04:00
Lachlan Sneff 37a6ff7bfe Add several additional ops to the spirv frontend. (#803)
* Add support for int8, int16, and int64 as well as null constant structs

* Add support for OpArrayLength to the spirv frontend

* Add hacky OpCopyMemory support to spirv frontend

* Add OpInBoundsAccessChain to spirv frontend

* Add OpLogical(Not)Equal to spirv frontend

* Fix several of the issues raised in the pr

* Fix the Op::ArrayLength match

* Validate accessing structs through pointers

* Remove extraneous type check
2021-04-29 19:45:49 -04:00
bors[bot]andDzmitry Malyshau e83e4ff501 [rs] Merge #880
880: Remove profiling dependency, bump version to 0.8 r=kvark a=kvark

Picks up https://github.com/gfx-rs/wgpu/pull/1355 and removes profiling markers from wgpu-rs. They don't show anything extra on top of wgpu-core markers, see https://github.com/gfx-rs/wgpu-rs/discussions/879

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-29 16:37:01 +00:00
Dzmitry Malyshau b73887f17e [rs] Version bump to 0.8 2021-04-29 12:30:29 -04:00
Dzmitry Malyshau 3467c3a676 [rs] Remove profiling dependency 2021-04-29 12:30:29 -04:00
bors[bot]andChandler Newman 85a1480959 [rs] Merge #850
850: Add uniform and storage buffer arrays r=kvark a=csnewman

**Connections**
https://github.com/gfx-rs/wgpu/pull/1315

**Description**
Adds uniform and storage buffer arrays

Usage:
```
wgpu::BindGroupEntry {
    binding: 0,
    resource: BindingResource::BufferArray(&[
        buffer1.as_entire_buffer_binding(),
        buffer2.as_entire_buffer_binding(),
    ]),
}
```



Co-authored-by: Chandler Newman <chandler2newman@hotmail.co.uk>
2021-04-29 16:18:52 +00:00
Chandler Newman a267d0785d [rs] Add uniform and storage buffer arrays 2021-04-29 12:17:37 -04:00
Dzmitry Malyshau e5ddb94be0 Version bump to 0.8 2021-04-29 11:57:22 -04:00
bors[bot]andDzmitry Malyshau faf3cbc2e9 Merge #1357
1357: Changelog for 0.8 r=kvark a=kvark

Fixes #1265
Closes #1312
Related to https://github.com/gfx-rs/naga/pull/796 and https://github.com/gfx-rs/gfx/pull/3739

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-29 15:43:35 +00:00
Dzmitry Malyshau ffd47fbc0e Remove Vulkan Portability support 2021-04-29 11:42:26 -04:00
Dzmitry Malyshau 6f9c254061 Changelog for 0.8 2021-04-29 11:33:17 -04:00
Dzmitry Malyshau ea188634c6 Bump version to 0.4.0 d3d12-v0.4.0 2021-04-29 10:50:08 -04:00
Ashley 881c8a7abc [spv-in] Impl GLOp::Radians and GLOp::Degrees (#797)
* Implement GLOp::Radians and GLOp::Degrees

* Simplify and inline

* Change comment

* Generate constant on demand

* Fix 180/pi/180
2021-04-29 10:19:30 -04:00
bors[bot]andDzmitry Malyshau c539c1f4ab Merge #1358
1358: Big refactor of the profiling usage r=kvark a=kvark

**Connections**

**Description**
Improves the profiling markers in many ways:
  1. remove unnecessary leftovers from the `tracing` era, such as querying device/adapter features. These are one-time and light-weight. It's unlikely we are going to be interested in them.
  2. add markers to where it really matters, such as `maintain` pieces, `submit` phases, render pass preparation, etc.
  3. shorten the markers to be strictly the function names, passing the class name as a tag

**Testing**
Tested on vange-rs

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-29 06:08:14 +00:00
Dzmitry Malyshau 6ff618aafb Big refactor of the profiling usage 2021-04-29 02:06:58 -04:00
Dzmitry Malyshau 93e57ffcf2 Another CHANGELOG update for v0.4 (#796) naga-v0.4.0 2021-04-29 00:52:43 -04:00
bors[bot]andChandler Newman acd21eeeb1 Merge #1315
1315: Add buffer arrays r=kvark a=csnewman

**Connections**
https://github.com/gfx-rs/wgpu-rs/pull/850

**Description**
Adds buffer array bindings

**Testing**
TODO
<!--
Non-trivial functional changes would need to be tested through:
  - [wgpu-rs](https://github.com/gfx-rs/wgpu-rs) - test the examples.
  - [wgpu-native](https://github.com/gfx-rs/wgpu-native/) - check the generated C header for sanity.

Ideally, a PR needs to link to the draft PRs in these projects with relevant modifications.
See https://github.com/gfx-rs/wgpu/pull/666 for an example.
If you can add a unit/integration test here in `wgpu`, that would be best.
-->


Co-authored-by: Chandler Newman <chandler2newman@hotmail.co.uk>
2021-04-29 04:40:54 +00:00
Chandler Newman 904ec7a5ee Add uniform and storage buffer arrays 2021-04-29 00:38:04 -04:00
Dzmitry Malyshau fd561da44c [msl] derive access qualifier based on the global variable flags (#798) 2021-04-28 20:37:42 -04:00
Ashley d21dded649 [msl-out] wrap arrays in structs so that they can be returned by functions (#764)
* [msl-out] wrap arrays in structs so that they can be returned by functions

* Fix clippy problems

* use a raw array for output fields

* Fix clippy problems

* Apply suggestions

* Remove put_initialization_component

* Check if the array is a constant size

* Don't use the pointer class
2021-04-28 10:26:17 -04:00
bors[bot]andDzmitry Malyshau c727b1a7f5 Merge #1355
1355: Add shader compile markers r=kvark a=kvark

**Connections**
Picks up https://github.com/gfx-rs/gfx/pull/3736 and prior PRs

**Description**
Allows clearly seeing the times spent in shader translation code.

**Testing**
Tested on vange-rs

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-27 16:24:37 +00:00
Dzmitry Malyshau 087bd07f55 Add shader compile markers 2021-04-27 12:23:28 -04:00
Dzmitry Malyshau d9171dbc61 [wgsl-in] fix composition of a single element 2021-04-27 11:11:28 -04:00
Dzmitry Malyshau 120fc22e9f Support unary not in WGSL 2021-04-27 01:24:21 -04:00
Ashley Ruglys 33003d8ea2 Add MathFunction::Refract 2021-04-26 14:14:30 -04:00
bors[bot]andDzmitry Malyshau e1a56042c0 [rs] Merge #878
878: Update naga to gfx-23 r=kvark a=kvark

Picks up https://github.com/gfx-rs/wgpu/pull/1353 and https://github.com/gfx-rs/wgpu/pull/1354

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-26 16:17:09 +00:00
Dzmitry Malyshau 07a876c8d5 [rs] Update naga to gfx-23 2021-04-26 12:16:01 -04:00
bors[bot]andDzmitry Malyshau 13015c8621 Merge #1354
1354: Update profiling to 1.0 r=kvark a=kvark

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

**Description**
Some crates like to release 1.0

**Testing**
Should work

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-26 16:00:46 +00:00
Dzmitry Malyshau 6c7f2b917f Update profiling to 1.0 2021-04-26 11:59:15 -04:00
bors[bot]andDzmitry Malyshau ba1b2c5f19 Merge #1353
1353: Update naga to gfx-23 r=kvark a=kvark

**Connections**
Picks up https://github.com/gfx-rs/gfx/pull/3733

**Description**
Just a bunch of Naga fixes

**Testing**
To be tested in wgpu-rs

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-26 15:21:41 +00:00
Dzmitry Malyshau 03c4e0969e Update naga to gfx-23 2021-04-26 11:10:22 -04:00
Dzmitry Malyshau 4a5ff9a053 Validate that used expressions are emitted 2021-04-26 09:59:54 -04:00
Igor Shaposhnik 452db33947 [glsl-out] Enable boids snapshot test 2021-04-26 09:59:05 -04:00
Dzmitry Malyshau bb29f8e142 [spv-in] emit the cast expression for builtin signness 2021-04-26 00:44:16 -04:00
Gordon-F dd1d9fe290 [wgsl-out] More improvements. Enable quad snapshot testing for wgsl backend 2021-04-26 00:20:01 -04:00
Dzmitry Malyshau 117d729ff8 [spv-in] allow non-strict check for capabilities 2021-04-25 18:32:34 -04:00
Dzmitry Malyshau 3049e3a4ac [spv-out] allow capabilities to be derived 2021-04-25 13:34:16 -04:00
Dzmitry Malyshau f77abdb156 [spv-out] generate LogicalNot for bools 2021-04-25 12:57:59 -04:00
Dzmitry Malyshau e8c5242cc7 Fix relational expression type width 2021-04-25 12:57:59 -04:00
Dzmitry Malyshau 4ab9150411 [spv-out] fix image operands 2021-04-25 12:57:59 -04:00
Dzmitry Malyshau 76685fba69 [spv-out] issue DepthReplacing execution mode 2021-04-25 12:57:59 -04:00
Dzmitry Malyshau e8f6d55356 [spv-out] implement some of the relational functions 2021-04-25 12:57:59 -04:00
Dzmitry Malyshau 0548437ab9 [spv-out] don't cache pointer function arguments 2021-04-25 12:57:59 -04:00
Gordon-F 4f5b6c5270 Share some functions between backends 2021-04-25 11:18:31 -04:00
Gordon-F 0459470986 [wgsl-out] Implement writing for more value types 2021-04-25 11:18:31 -04:00
Gordon-F 41e91739ac [wgsl-out] Return Err instead of panic for unimplemented cases 2021-04-25 11:18:31 -04:00
Dzmitry Malyshau ecffe37456 Enforce sampled types to be Float 2021-04-25 02:24:17 -04:00
Dzmitry Malyshau 28cba79452 [spv-out] deduplicate sampler types 2021-04-25 01:07:59 -04:00
Dzmitry Malyshau 7ec90512a8 [spv-out] deduplicate image types 2021-04-25 01:07:59 -04:00
Dzmitry Malyshau 1cc770a7d8 [spv-out] return Null by default 2021-04-25 01:07:59 -04:00