Commit Graph

782 Commits

Author SHA1 Message Date
João Capucho
4da665d3ba Address comments 2021-07-01 11:19:28 -04:00
João Capucho
7df4a52af9 [valid] Handle texture/sampler function argument 2021-07-01 11:19:28 -04:00
Gordon-F
607206f9a5 [hlsl-out] Enable operators snapshot test 2021-06-29 09:49:00 -04:00
Gordon-F
925c92d12f Add entry point to operators wgsl test 2021-06-29 09:49:00 -04:00
Gordon-F
6723c8f6ae [hlsl-out] Implement Derivative expression and enable standard snapshot test for HLSL 2021-06-29 09:49:00 -04:00
Dzmitry Malyshau
68a2efd3c5 glsl-out: make the cs adjustment to also flip Y 2021-06-29 02:18:56 -04:00
Dzmitry Malyshau
ba066c83e7 glsl-out: proper continuing block 2021-06-29 01:44:54 -04:00
Dzmitry Malyshau
e8b71b8dc5 [glsl-out] Support extended shadow sampling instructions, and the offset 2021-06-28 15:01:39 -04:00
Dzmitry Malyshau
cfbe83e384 glsl-out: adjust coordinate space 2021-06-28 15:01:39 -04:00
Dzmitry Malyshau
57b3256020 [glsl-out] binding location mapping 2021-06-27 01:09:53 -04:00
Gordon-F
19de60f6e4 [hlsl-out] Implement more expressions 2021-06-26 13:15:44 -04:00
Gordon-F
a8119f005e Add extra fragment entry point to wgsl quad snapshot 2021-06-24 10:47:17 -04:00
Gordon-F
e28344edbb [hlsl-out] Return entry points name to users 2021-06-24 10:47:17 -04:00
Gordon-F
1c5d538ab4 [glsl-out] Add entry point name to snapshot file name 2021-06-24 10:47:17 -04:00
João Capucho
4bc4c60663 [glsl-in] Implicit casts for function calls 2021-06-19 13:58:21 -04:00
Gordon-F
6cdd332cef Reorganize test snapshot folder 2021-06-19 10:19:04 -04:00
Jim Blandy
c16f2097ad [spv-out]: Ensure array subscripts are in bounds. 2021-06-18 20:44:07 -04:00
Jim Blandy
1d0b3f3a75 Functions can take pointers to unsized structs, but no other unsized types. 2021-06-18 20:44:07 -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
Gordon-F
46be75fb37 [hlsl-out] Implement all parts required by quad-spv snaphost test 2021-06-18 15:23:09 -04:00
Frizi
b89da31cc7 reorder namer assignment order to preserve names for reflection 2021-06-18 13:57:44 -04:00
Frizi
efd416d964 [glsl-in] parse all math functions 2021-06-17 16:08:34 -04:00
João Capucho
a07310536f [glsl-in] Build wgsl shaders for glsl test shaders 2021-06-17 20:57:32 +01:00
João Capucho
b490902112 [glsl-in] Add loads as needed 2021-06-17 20:57:32 +01:00
Frizi
20c6fd1862 add license headers to the bevy pbr shaders 2021-06-17 15:21:47 -04:00
Frizi
96980727cb [glsl-in] support nested swizzles and prevent l-value repeated components 2021-06-17 15:21:47 -04:00
Frizi
b261dde77f [glsl-in] revert test case change 2021-06-17 15:21:47 -04:00
Frizi
378ea9d396 add more glsl snapshot tests 2021-06-17 15:21:47 -04:00
Frizi
c7580f2743 [glsl-in] preserve entrypoint arg names for reflection 2021-06-17 15:21:47 -04:00
Frizi
e6d142f28f [glsl-in] treat const globals as constants allow them in array size exprs 2021-06-17 15:21:47 -04:00
Frizi
337014786c [wgsl-in] use AccessIndex for accesses using constant index 2021-06-17 11:34:58 -04:00
Gordon-F
96b37aff1f [hlsl-out] Reduce heap allocation 2021-06-16 14:03:50 -04:00
Gordon-F
92a11d0978 [hlsl-out] More improvements. Enable quad snapshot testing 2021-06-15 21:08:05 -04:00
Gordon-F
d1f9575ed1 [glsl-out] Write space after if keyword 2021-06-15 21:08:05 -04:00
Gordon-F
54d7d7d2a3 Improve hlsl-out 2021-06-13 11:15:42 -04:00
João Capucho
10422c6b4a Regenerate quad-glsl shader 2021-06-09 13:06:36 -04:00
João Capucho
06c8588fcd [glsl-in] Add collatz shader and test quad shader 2021-06-09 12:54:58 -04:00
João Capucho
be2231f6d9 [wgsl-out] Write global initializers 2021-06-09 10:14:46 -04:00
Dzmitry Malyshau
38f6a79917 [spv-out] fix image sampling ops, add more tests 2021-06-08 17:38:42 -04:00
Igor Shaposhnik
575304a50c [msl-out] Implement named expression generation (#957) 2021-06-08 12:09:46 -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
bfa2bbe590 Snapshot quad-glsl to WGSL, not SPIR-V and IR.
In tests/out, stop generating the uncommitted files quad-glsl.ron and
quad-glsl.spvasm, and add the snapshot quad-glsl.wgsl.
2021-06-07 17:27:09 +01: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
João Capucho
1c3baf4557 [glsl-in] Allow field selection behind pointers (#948) 2021-06-03 16:09:20 -04:00
João Capucho
87748a2fe3 [glsl-in] Add integration tests to CI (#943)
* [glsl-in] Add glsl snapshots folder

* [glsl-in] Fix incorrect angle brackets parsing

* [glsl-in] Temporarily remove wgsl snapshot output
2021-06-03 15:34:54 -04:00
Gordon-F
90c2cf6aa6 Add ability to generate named expressions 2021-06-03 10:40:59 -04:00
Frizi
2295508f0e Insert attribute glsl location qualifier for opengl ES 3.0 2021-06-02 12:36:04 -04:00
João Capucho
344acc3121 [glsl-in] Reenable snapshot tests 2021-06-01 21:11:50 -04:00
Aron Granberg
37724102a3 Improve wgsl lexer error messages.
Better errors for Unexpected, BadInteger, BadFloat, BadTexture, BadTypeCast, UnknownScalarType, UnknownStorageClass, UnknownAttribute, UnknownBuiltin, UnknownShaderStage, UnknownStorageFormat and UnknownConservativeDepth, ZeroStride, ZeroSizeOrAlign and UnknownType.

Also adds lexer::capture_span.

Also fixes some validation for texture sample types and and issue that cauld cause e.g. the type `f33` to be parsed as `f32`.
2021-05-30 11:01:00 -04:00