Commit Graph

459 Commits

Author SHA1 Message Date
Jim Blandy
337e40a2be
Enable logging in WGSL and SPIR-V tests. (#1098)
Use env_logger::try_init to avoid complaints about repeated initialization. This
function is thread-safe.
2021-07-16 23:09:48 -04:00
Dzmitry Malyshau
e76824aba3
glsl-out: fix emission of location/binding attributes (#1100) 2021-07-16 23:04:55 -04:00
initial-algebra
602368d9f0
Support builtin(primitive_index) (#1097)
* Hack in support for PrimitiveID on Vulkan

* Rename to PrimitiveIndex and add preliminary support for GLSL, HLSL and MSL

* Implement as an extra WGSL built-in

* Update extra.wgsl outputs

* Run rustfmt; fix WGSL writer

* Add rustfmt changes I forgot

* Update extra.wgsl test output for WGSL fix

* Bump macOS version to 10.15 in validate-msl to support primitive_index
2021-07-16 22:18:20 -04:00
Dzmitry Malyshau
8eef784416 WGSL: Flip true/false arguments of select() 2021-07-16 11:42:12 -04:00
Gordon-F
4ef754bb9d [hlsl-out] Enable image snapshot 2021-07-16 10:31:01 -04:00
Gordon-F
2716d368a1 [hlsl-out] Implement barrier statement 2021-07-16 10:31:01 -04:00
Jasper St. Pierre
0995c7161e [glsl-in] Keep around extra linkage variables
WGSL will require this. Note that this still might
cause some issues with multi-entry-point GLSL
that I didn't know how to handle. That is, we will
handle unused builtin inputs but not unused
builtin outputs correctly right now. This is an existing
issue though, not a regression.

This is also provided as an option, but I feel like
the more correct approach is to never strip linkage
variables. We'll see though.
2021-07-14 17:48:54 -04:00
Jasper St. Pierre
0b69aa8b8a Init env_logger in snapshots tests
For debugging. Maybe there's a way to do it for all tests,
not sure...
2021-07-14 17:48:54 -04:00
pyrotechnick
1d1aea243f
Improve WGSL interpolation attributes (#1083)
* [wgsl-in] Map interpolate(..., center) to Sampling::Center

* [wgsl-out] Improve interpolation attributes

* [wgsl] Fix tests/in/interpolate.wgsl typo/format

* [wgsl] Snapshot WGSL artefacts

* [wgsl-out] Stack-only writing of interpolation
2021-07-13 21:57:52 -04:00
Gordon-F
ccf3fe9707 Fix type info of texture dimensions function with texture cube parameter 2021-07-13 17:28:09 -04:00
Dzmitry Malyshau
458db0b522 [hlsl-out] expose profile string conversions 2021-07-11 23:14:07 -04:00
João Capucho
105a2ae5e1 [glsl-in] Check type dimensions in function calls 2021-07-07 12:59:20 -04:00
Gordon-F
9e61390626 [hlsl-out] Zero initialize variables. Write interpolation and sampling qualifier 2021-07-07 10:57:28 -04:00
João Capucho
ee1004d443 [glsl-in] Use cast for implicit conversion
Previously this was a bitcast
2021-07-06 11:24:05 -04:00
João Capucho
2b475ecc96 [spv-out] Support object-wise select 2021-07-06 10:12:24 -04:00
Dzmitry Malyshau
c69736210a Snapshot test local variable inference 2021-07-06 01:26:03 -04:00
Dzmitry Malyshau
beabd62d96 wgsl: type inference for local variables 2021-07-06 01:26:03 -04:00
Gordon-F
65fbbf1101 [hlsl-out] Return only real names on entry point in ReflectionInfo 2021-07-05 18:54:42 -04:00
Gordon-F
d5776879de [hlsl-out] Enable interface snapshot testing 2021-07-05 18:54:42 -04:00
Joshua Groves
9192f7b882 wgsl-in: add more error tests 2021-07-05 02:24:18 -04:00
João Capucho
2f002a0594 [spv-out] Load texture arguments ahead of time 2021-07-05 02:23:00 -04:00
João Capucho
c7b98f5ab9 [spv-out] accept texture trough function argument 2021-07-05 02:23:00 -04:00
Joshua Groves
c5805a9e10 wgsl-in: add more error tests 2021-07-04 01:00:21 -04:00
Jasper St. Pierre
78e1304d42 [glsl-in] Convert bool -> scalar cast to Select 2021-07-02 01:34:34 -04:00
Jasper St. Pierre
cb8e9f2cad [glsl-in] Implicitly splat the inputs of clamp() 2021-07-01 18:32:33 +01:00
João Capucho
a1749ab9c5 [glsl-out] Fix argument skipping 2021-07-01 11:19:28 -04:00
João Capucho
2bb15eb0a8 [glsl-in] Add support for texture arguments 2021-07-01 11:19:28 -04:00
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
Dzmitry Malyshau
4b5ab528ac Comparison sampling tests 2021-05-28 22:43:39 -04:00
Dzmitry Malyshau
d3fbb30d46 [wgsl-out] Improve texture sampling call 2021-05-28 22:43:39 -04:00
Dzmitry Malyshau
8a1d883ba5 [wgsl-in] support textureSampleCompareLevel 2021-05-28 22:43:39 -04:00
Dzmitry Malyshau
1366546645 [glsl-out] improve array types 2021-05-28 22:18:51 -04:00
Dzmitry Malyshau
d1e2ac57fe New snapshot test for global variables 2021-05-28 22:18:51 -04:00
Jim Blandy
48363fcef1 Don't accept unsized types as function arguments. 2021-05-26 12:27:29 -04:00
Jim Blandy
50de6ae9ac Improve error messages for missing I/O bindings.
The `apply_common_default_interpolation` helper function would panic if bindings
were missing, but missing bindings should be something that front ends can count
on validation to detect, so the helper should just return silently.

The validator returned `InvalidType` errors for missing bindings, apparently
because variables without bindings must be structs that do have bindings. But
this is unhelpful when you've just forgotten to label an argument. So this patch
adds a new, more specific, `VaryingError` variant.
2021-05-21 23:04:27 -04:00
João Capucho
ff8f15e034 [glsl-in] Start writting a parser without pomelo 2021-05-19 16:24:26 -04:00
Gordon-F
12e6dc5917 [wgsl-out] Implement all statements and expressions. Enable all wgsl-in tests 2021-05-19 14:11:05 -04:00
Dzmitry Malyshau
6c1832c8ee [spv-out] be smarter about deriving capabilities, auto derive them for tests 2021-05-19 02:01:25 -04:00
Gordon-F
6b3db1f487 [glsl-out] Write vector access as a swizzle 2021-05-19 00:09:12 -04:00
Jim Blandy
5753f6e107 [wgsl-in] Improve error message for UnknownIdent. 2021-05-19 00:07:39 -04:00
Gordon-F
b4aa966575 [wgsl-out] Create baking expression for texture function 2021-05-18 13:33:25 -04:00
Dzmitry Malyshau
96ec0b61e7 Snapshot for built-ins 2021-05-18 10:01:14 -04:00
Jim Blandy
0985727710 [wgsl-in] Include span information in 'unknown identifier' errors. 2021-05-17 19:46:37 -04:00
Dzmitry Malyshau
b191c982ec Remove alignment from struct IR 2021-05-17 09:32:52 -04:00
Gordon-F
6efe347e90 [wgsl-out] Implement all math functions. Rename entry point function based on stage. Rename entry point output struct. 2021-05-14 18:14:23 -04:00
Gordon-F
5958f98489 [wgsl-out] Enable snapshot testing for wgsl-in image test 2021-05-14 18:12:02 -04:00
Dzmitry Malyshau
418e71281e Derivative tests 2021-05-14 09:53:24 -04:00
Jim Blandy
057d03ad86 [wgsl-in]: Add tests for array and struct validation. 2021-05-13 22:09:22 -04:00
Jim Blandy
f45d812266 [wgsl-in]: Move WGSL front end integration tests into a WGSL-specific file.
This lets us reduce noise by removing a bunch of `#[cfg]` attributes. In the
future, if we have tests for other front ends, we can create an `errors`
subdirectory, but for now, we only have the WGSL tests, so we should keep things
flat.
2021-05-13 22:09:22 -04:00
Dzmitry Malyshau
a8df6a2b34 [msl] make sizes buffer local to each function 2021-05-13 22:02:37 -04:00
Igor Shaposhnik
6a42e4a0f8 [wgsl-out] Enable snapshot testing for spv-in quad shader 2021-05-12 15:15:50 -04:00
Dzmitry Malyshau
ba422f10f8 [msl] fix splat namespace 2021-05-08 22:07:13 -04:00
Dzmitry Malyshau
350ceb383d WGSL support for f64, snapshot test for it 2021-05-08 21:20:23 -04:00
Dzmitry Malyshau
59d1dcab5b Support width changes in As expression 2021-05-08 21:20:23 -04:00
Gordon-F
53fe7a329f [glsl-out] Handle uninitialized global variables 2021-05-08 21:09:11 -04:00
Gordon-F
73b20ffa70 Add CullDistance BuiltIn 2021-05-08 09:51:14 -04:00
Dzmitry Malyshau
09032695b0 Barrier follow-up fixes 2021-05-06 14:48:55 -04:00
Dzmitry Malyshau
63afb9a215 Add Capabilities bitset for validation 2021-05-05 21:39:41 -04:00
Dzmitry Malyshau
990fd2d3a3 Allow matrix indexing behind a pointer 2021-05-05 09:34:12 -04:00
Dzmitry Malyshau
be00a05fa5 [spv-in] default output builtins 2021-05-04 22:54:33 -04:00
Dzmitry Malyshau
9fe75ed7f1 Barriers 2021-05-04 22:16:24 -04:00
Igor Shaposhnik
1476ef84ff [spv-in] Fix empty gl_PerVertex name 2021-05-04 10:45:39 -04:00
Gordon-F
9fbe681316 [spv-in] Give entry point function the same name as entry point itself 2021-05-04 10:45:39 -04:00
Lachlan Sneff
f6da21f8dd
Unify back::msl push constants map and sizes buffer (#825)
* Unify back::msl push constants map and sizes buffer

* Fix clippy warning

* Actually remove PushConstantsMap

* Update snapshots
2021-05-03 21:51:44 -04:00
Dzmitry Malyshau
b8649b3848 Fix struct layouts for WGSL and SPIRV 2021-05-03 17:27:12 -04:00
Dzmitry Malyshau
46a244fff0 [wgsl-in] remove lifetime from ParseError 2021-05-02 23:49:34 -04:00
Timo de Kort
05d3608737
HLSL CI (#788)
* Add validation-windows yml for HLSL

Add workgroup size to hlsl-out

* Update Readme with Make target information

* Change runs on to windows-latest

* Remove snapshot file
2021-05-02 11:29:35 -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
992bdd83ce
Report per-entry point translation errors in the MSL output snapshots (#808) 2021-04-30 13:38:20 -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
Dzmitry Malyshau
120fc22e9f Support unary not in WGSL 2021-04-27 01:24:21 -04:00
Igor Shaposhnik
452db33947 [glsl-out] Enable boids snapshot test 2021-04-26 09:59:05 -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
1cc770a7d8 [spv-out] return Null by default 2021-04-25 01:07:59 -04:00
Gordon-F
3accf4dc15 Improve wgsl-out 2021-04-23 16:36:49 -04:00
Dzmitry Malyshau
02105db045
[spv-out] image queries (#749) 2021-04-23 12:31:33 -04:00
Dzmitry Malyshau
a2e5284f82
WGSL trailing commas (#743)
* [wgsl-in] typedef Span

* [wgsl-in] trailing comma for case list

* [wgsl-in] trailing comma for constructors

* Review fixes
2021-04-21 22:38:26 -04:00
Dzmitry Malyshau
bc344579e8
[spv-in] fix signed/unsigned casting for builtins (#746) 2021-04-21 11:04:53 -04:00
Ashley
4664cd301a
[Metal] Wrap a packed_float3 with float3 when loading from struct (#740)
* Implement the wrapping in Expression::Load instead

* Add changes to stack size

* stable and nightly can't seem to agree on a stack size

* Apply suggestions

* Add a comment about unexpected path

* Update skybox snapshot

* should_pack_struct_member returns an Option<ScalarKind>

* Remove accidental file
2021-04-21 09:16:11 -04:00
Dzmitry Malyshau
5d1746b0b4
Swizzle expression (#734) 2021-04-20 22:03:54 -04:00
Ashley
b08dfe5146
[Metal] Impl Expression::Splat (#738)
* [Metal] Impl `Expression::Splat`

* Add changes to the snapshots

* Apply suggestions
2021-04-20 11:41:13 -04:00
Ashley Ruglys
a4ac7b38b2 Don't use an interpolation on fake bindings 2021-04-20 10:51:45 -04:00
Gordon-F
c37ae5e2a0 [glsl-out] Use fmt::Writer instead of io::Writer 2021-04-20 09:09:35 -04:00
Jim Blandy
9cd6fd9c20 [msl-out]: Generate interpolation qualifiers. 2021-04-19 09:42:00 -04:00
Jim Blandy
4f442ff8cc Require binding interpolation to be resolved by the front end.
When validating IR, verify that all `Binding`s for vertex shader outputs and
fragment shader inputs, whether directly in the argument or result, or applied
to a struct member, has specified an interpolation and sampling, not `None`.
This ensures that front ends explicitly state their policies, rather than
coasting through on back ends' default behavior.

In practice, all our front ends have very similar defaults, so provide a utility
function on `Module` to apply these rules. Use this utility function in the
SPIR-V and WGSL front ends; GLSL seems to already fill in interpolation as
required.
2021-04-19 09:42:00 -04:00
Jim Blandy
0910af2718 [wgsl-in] Implement WGSL interpolate syntax from gpuweb PR #1605.
Fixes: #670
2021-04-19 09:42:00 -04:00
Jim Blandy
99a9e1e78e Change Binding::Location to a struct-style enum variant.
This commit makes no other changes. This is in preparation for adding a third
field, at which point tuple variants start to get obscure.
2021-04-19 09:42:00 -04:00
Igor Shaposhnik
ce0720ac61
Add wgsl-out into test infrastructure (#730) 2021-04-19 09:19:03 -04:00
Dzmitry Malyshau
62c2cf7332
Validate composite constants (#729) 2021-04-18 23:19:09 -04:00
Lachlan Sneff
4cbef59dd6
Add struct instantiation support to wgsl-in (#507)
* Add struct instantiation support to wgsl-in

* Readd type matching and move struct test

* rebase onto master and update tests

* Update tests to upstream

* Fix merge errors

* Rebase onto master

* [wgsl-in] delay composite type creation

* Use the new WGSL construction syntax in the tests

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-17 01:14:07 -04:00
Dzmitry Malyshau
bb716f9c10
[spv-out] implement array value indexing (#723) 2021-04-16 17:11:18 -04:00
Dzmitry Malyshau
daf4c82376
Allow stepping on floats in the validator (#724) 2021-04-16 16:16:15 -04:00
Ashley
285a855e19
Impl Hash for msl::Options (#716)
* Impl `Hash` for `msl::Options`

* Remove ordered float

* [msl] derive everything on Options manually

* [msl] switch from Arena to Vec for the options

* Fix the clippy error by allowing derive_hash_xor_eq

* Fix skybox test

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-16 14:11:26 -04:00
Jim Blandy
2eb3e81e19 [wgsl-in] Add basic test for interpolate attribute. 2021-04-15 17:19:20 -04:00
Jim Blandy
3f958f618b [glsl-out] Let snapshot tests request a specific GLSL desktop version.
Add a Option<u16> to the snapshot `Params` to let snapshots request specific
Desktop GLSL versions. The default is GLSL ES 3.10.

It would be more general to let the params select any GLSL version, but that
would entail making glsl::Version implement Deserialize and all that, which
seems like overkill.
2021-04-15 17:19:20 -04:00
Dzmitry Malyshau
2eae37f7e5 [spv-out] rename temp_chain to temp_list, run a cargo fmt pass 2021-04-14 19:26:20 -04:00
Dzmitry Malyshau
96f9cb4ce1 [wgsl] Add support for simplified vector construction, add a snapshot test 2021-04-14 19:26:20 -04:00
Dzmitry Malyshau
c8d26a1f47 Splat support for WGSL and SPV in/out, updated snapshots 2021-04-14 19:26:20 -04:00
Dzmitry Malyshau
c2c93e4ecd Remove cargo-insta 2021-04-14 16:10:31 -04:00
Dzmitry Malyshau
3f57e4db5a Enable texture-array snapshot on Metal 2021-04-13 01:31:57 -04:00
Dzmitry Malyshau
270feb3c0f [msl] map push constants to buffers 2021-04-13 01:31:57 -04:00
Ashley
640bfb1f26
[Metal] Make constant composites non-constexpr (#707)
* Make constant composites non-constexpr

* Update shadow test
2021-04-11 14:21:47 -04:00
Timo de Kort
5d487941b2
Start hlsl-out (#408)
* Add hlsl-out feature

* Integrate hlsl-out with snapshots

* Add snapshot
2021-04-11 11:36:26 -04:00
Mehmet Oguz Derin
142038c85b WGSL: const to let 2021-04-11 01:24:19 -04:00
Dzmitry Malyshau
f3ba6e91c2 [msl-out] shorten the expression name 2021-04-09 00:48:18 -04:00
Dzmitry Malyshau
604e10e19b Rewrite IR to have member offsets, full structure span and alignment 2021-04-08 23:15:03 -04:00
Dzmitry Malyshau
7326ba6ddb New struct layout IR 2021-04-08 23:15:03 -04:00
Dzmitry Malyshau
6166b95b6a [msl] inline some of the constants 2021-04-08 12:36:43 -04:00
Dzmitry Malyshau
2774dcb403 [msl] inline some of the types 2021-04-08 11:10:52 -04:00
Dzmitry Malyshau
e06451777e [msl] address review comments, rename SubOptions to PipelineOptions, add more inlined states 2021-04-07 22:49:13 -04:00
Dzmitry Malyshau
499f2e3cbe [msl] add a snapshot test for inline sampler 2021-04-07 22:49:13 -04:00
Dzmitry Malyshau
7c11759041 Re-use the MSL types in snapshot code 2021-04-07 22:49:13 -04:00
Dzmitry Malyshau
dcbedd17d0 [msl] basic infrastructure for inline samplers
Also move out "allow_point_size" into SubOptions to allow
main Options to not be cloned.
2021-04-07 22:49:13 -04:00
Dzmitry Malyshau
a9bde26785 [spv-out] fix incorrect dummy result 2021-04-04 10:25:46 -04:00
Dzmitry Malyshau
410c242daf [spv-out] add a flag to adjust the coordinate space 2021-04-03 11:27:21 -04:00
Dzmitry Malyshau
ead052b773 [spv-in] add a flag to adjust the coordinate space 2021-04-03 11:27:21 -04:00
Dzmitry Malyshau
100c2f42ed [spv-out] cache access index constants 2021-04-03 11:27:21 -04:00
Dzmitry Malyshau
5673603bab [spv-out] flip position Y 2021-04-03 11:27:21 -04:00
Dzmitry Malyshau
ab54f683be [spv-in] flip Y axis 2021-04-03 11:27:21 -04:00
Dzmitry Malyshau
4389a86787 Fix layout roundup 2021-04-03 00:41:32 -04:00
Dzmitry Malyshau
d4d9d7814f [msl-out] option to omit point size output 2021-04-02 00:19:52 -04:00
Dzmitry Malyshau
8ff27187d1 Fix matrix multiplication types 2021-04-01 15:49:37 -04:00
Dzmitry Malyshau
db455af04b Add a snapshot for image load/store ops 2021-04-01 10:47:28 -04:00
Dzmitry Malyshau
427d8dc1eb [spv-in] pre-emit constant expressions 2021-03-31 23:17:19 -04:00
Dzmitry Malyshau
7a17da195c [msl] use uint behind metal namespace only 2021-03-31 23:01:19 -04:00
Dzmitry Malyshau
7be524592a [msl] fix mutability of function parameters 2021-03-30 15:43:53 -04:00
Dzmitry Malyshau
baccfc68f5 [msl] fix constant array initialization 2021-03-30 00:38:00 -04:00
Dzmitry Malyshau
f06583ca7d [spv-in] change const indexes to signed int 2021-03-29 11:07:33 -04:00
Dzmitry Malyshau
f2155d49d1 [msl] fix initialization of arrayed members, enable METAL snapshot of quad-vert 2021-03-27 10:58:01 -04:00
Dzmitry Malyshau
e47ff2dc26 [spv-in] support output interface block 2021-03-27 10:52:00 -04:00
Dzmitry Malyshau
a090afa3f5 [msl] write scalar constants before the types 2021-03-26 09:56:29 -04:00
Dzmitry Malyshau
bf193bb535 [msl] don't put expressions in double scopes 2021-03-26 09:56:29 -04:00
Dzmitry Malyshau
7d042337e2 Align the block decoration with SPIR-V, require storage buffers 2021-03-25 12:34:25 -04: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
06d777b609 Make layout validation optional, disable the struct size check 2021-03-24 21:03:00 -04:00
Dzmitry Malyshau
7a246f6a14 Validate image queries and valid shader stages for derivatives 2021-03-24 12:32:32 -04:00
Dzmitry Malyshau
8712020115 Move Layouter into ModuleInfo 2021-03-23 10:11:50 -04:00
Dzmitry Malyshau
970b77abaf Make type a part of ExpressionInfo 2021-03-22 15:17:00 -04:00
Dzmitry Malyshau
e3ae5904ba Move AnalysisFlags into ValidationFlags, add bits for expressions and blocks 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
Dzmitry Malyshau
c2f70aaf80 Validate binary expressions 2021-03-19 10:39:54 -04:00
Dzmitry Malyshau
dd2cd92331 [msl-out] fix varying input structures 2021-03-17 16:59:23 -04:00
Dzmitry Malyshau
9390aa472d [glsl-out] make varying names to match 2021-03-17 10:37:10 -04:00
Gordon-F
6736bcefa6 [glsl-out] Explicitly set location bindings 2021-03-17 09:40:06 -04:00
Dzmitry Malyshau
665ac49a01 Show expression uniformity in the Dot backend 2021-03-17 01:03:00 -04:00
Dzmitry Malyshau
08eaad89db Implement default layout in the IR and WGSL 2021-03-15 22:27:35 -04:00
Dzmitry Malyshau
20979b4800 [wgsl] type inference for constants 2021-03-15 01:31:57 -04:00