Commit Graph

13 Commits

Author SHA1 Message Date
Dzmitry Malyshau
88c1c9037d Add atomic exchange function 2021-08-10 21:48:02 -04:00
Dzmitry Malyshau
8c371e8063 Atomic expressions, support in backends except HLSL and the validator. 2021-08-10 21:48:02 -04:00
pyrotechnick
2f516c0932
[wgsl] Storage buffer/texture access (#1142)
* Resurrect texture_storage_* tests
* Test parsing of `var<storage,write>`
* Default storage textures to READ
* Restore default features
* Fix glsl/hlsl/msl/spv front and back ends
* Add missing test outputs
* All-around fixes for the storage access

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-07-28 01:47:18 -04:00
Dzmitry Malyshau
284cfcce47 hlsl: storage writes 2021-07-26 01:29:42 -04:00
Dzmitry Malyshau
4b6846d5da hlsl: storage reads support, array length 2021-07-26 01:29:42 -04:00
Dzmitry Malyshau
c69736210a Snapshot test local variable inference 2021-07-06 01:26:03 -04:00
Jim Blandy
fd3b2a93d4 access.wgsl: Make array mutable, and assign to an element. 2021-06-18 20:44:07 -04:00
Jim Blandy
b8724eb1fd Tweak access.wgsl to avoid #913 and make SPIR-V more distinctive. 2021-06-18 20:44:07 -04:00
Igor Shaposhnik
be6a4172c5
Fix Expression::Load generating (#925)
* [glsl-out] Fix writing named expressions with array types

* [wgsl-out] Remove unsupported builtin from baked expression

* [glsl-out] Add a newline between globals for readability

* Set bake_ref_count to 1 for Expression::Load

* Update snapshot data
2021-06-08 10:15:26 -04:00
Jim Blandy
a2a35f2eb3
Permit dynamic indexing of arrays and matrices only behind a pointer. (#949)
This makes Naga IR validation impose the restrictions added to WGSL in
gpuweb/gpuweb#1801.

Remove code in the SPIR-V writer to spill arrays to temporary variables in order
to index them dynamically. If such IR is encountered, treat it as a failure of
validation.
2021-06-04 12:57:20 -04:00
Dzmitry Malyshau
990fd2d3a3 Allow matrix indexing behind a pointer 2021-05-05 09:34:12 -04:00
Lachlan Sneff
232fd65ec7
Add support for retrieving array length in msl backend (#806)
* Add support for arrayLength to the wgsl frontend

* Fix clippy warning

* Add draft support for array length to the msl backend

* Finalize support for array length in msl

* Convert buffer size to array length in msl backend

* Fix clippy warning

* Fix misleading documentation

* Changes based on review of PR

* Use a fake binding for sizes buffer in msl backend if necessary

* Only generate the msl buffer size structure if globals are present that have unsized arrays

* Make sure to generate separators

* Replace uses_unsized_buffers with !self.runtime_sized_buffers.is_empty()

* Clear self.runtime_sized_buffers

* Run snapshot of shadow.msl

* Add Expression::ArrayLength support to the spirv backend

* Remove wgsl target from the access snapshot test

* Update access.msl snapshot

* Update stack size for msl backend

* Update stack size again for msl backend
2021-04-30 22:40:32 -04:00
Dzmitry Malyshau
bb716f9c10
[spv-out] implement array value indexing (#723) 2021-04-16 17:11:18 -04:00