Commit Graph
93 Commits
Author SHA1 Message Date
Gordon-F d1f9575ed1 [glsl-out] Write space after if keyword 2021-06-15 21:08:05 -04:00
Igor Shaposhnik 4af035edb7 [glsl-out] Simplify code for writing named expression 2021-06-08 17:38:14 -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
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
Dzmitry Malyshau 1366546645 [glsl-out] improve array types 2021-05-28 22:18:51 -04:00
Gordon-F 6b3db1f487 [glsl-out] Write vector access as a swizzle 2021-05-19 00:09:12 -04:00
Dzmitry Malyshau 96ec0b61e7 Snapshot for built-ins 2021-05-18 10:01:14 -04:00
Dzmitry Malyshau 8b60171403 [glsl-out] emit sample variables extension 2021-05-18 10:01:14 -04:00
Dzmitry Malyshau b191c982ec Remove alignment from struct IR 2021-05-17 09:32:52 -04:00
Dzmitry Malyshau ba422f10f8 [msl] fix splat namespace 2021-05-08 22:07:13 -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
Gordon-F 3a0f014411 [glsl-out] Add clip distance feature 2021-05-05 15:16:42 -04:00
Dzmitry Malyshau 9fe75ed7f1 Barriers 2021-05-04 22:16:24 -04:00
Gordon-F dbfc11a196 [glsl-out] Fix writing identifiers starting with gl_ 2021-05-03 21:47:16 -04:00
Dzmitry Malyshau bb7ebed23a [spv-in] null initialization for matrices 2021-05-03 00:55:47 -04:00
Gordon-F 3537bffad3 [glsl-out] Fix scalar arrays writing 2021-05-02 23:51:49 -04:00
Ashley Ruglys 33003d8ea2 Add MathFunction::Refract 2021-04-26 14:14:30 -04:00
Gordon-F 4f5b6c5270 Share some functions between backends 2021-04-25 11:18:31 -04:00
Dzmitry Malyshau 24eaad10fc Follow up on the swizzle PR review notes (#750) 2021-04-22 11:17:44 -04:00
Dzmitry Malyshau 5d1746b0b4 Swizzle expression (#734) 2021-04-20 22:03:54 -04:00
Gordon-F c37ae5e2a0 [glsl-out] Use fmt::Writer instead of io::Writer 2021-04-20 09:09:35 -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
Dzmitry Malyshau daf4c82376 Allow stepping on floats in the validator (#724) 2021-04-16 16:16:15 -04:00
Jim Blandy 2eb3e81e19 [wgsl-in] Add basic test for interpolate attribute. 2021-04-15 17:19:20 -04:00
Jim Blandy 7fda34c4fd [glsl-out] Add version checks for qualifiers.
Use `back::glsl::features::FeaturesManager` to detect which qualifiers the given
module actually uses, and check them against the requested GLSL version.

The `linear` and `sample` qualifiers for fragment shader inputs are not
supported in all versions of GLSL that Naga can generate.
2021-04-15 17:19: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 d3b39d9e58 Splat expression in the IR 2021-04-14 19:26:20 -04:00
Dzmitry Malyshau 604e10e19b Rewrite IR to have member offsets, full structure span and alignment 2021-04-08 23:15:03 -04:00
Gordon-F 80a8243953 Fix Uint/Sint type conversion 2021-03-30 18:13:57 -04:00
Gordon-F ee43776c08 [glsl-out] Add samplers to reflection info 2021-03-23 22:14:22 -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 c992e638fe Move all the validation into a separate meta-module 2021-03-20 22:25:49 -04:00
Dzmitry Malyshau d58f9bdfde Merge sample mask in/out builtins 2021-03-18 21:57:48 -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 32a11752af Rename FragCoord builtin into Position 2021-03-13 23:26:19 -05:00
Dzmitry Malyshau ebcd815250 Update IR to have entry points with inputs/outputs 2021-03-13 23:26:19 -05:00
Dzmitry Malyshau 58a4e330dc [glsl-out] fix cached expressions 2021-03-13 11:52:23 -05:00
Dzmitry Malyshau 9e5cc4c9e4 Prevent matching on a reference once and for all 2021-03-12 11:35:09 -05:00
Gordon-F 74d1fdbf2a [glsl-out] Return reflection info to users 2021-03-10 17:10:58 -05:00
Igor Shaposhnik 25fe522423 [glsl-out] Properly write array type 2021-03-10 15:17:07 -05:00
Igor Shaposhnik f586d3e240 [glsl-out] Workaround lod array shadow as textureGrad 2021-03-09 15:08:08 -05:00
Dzmitry Malyshau 13d7a353e0 Switch entry points from map to a vec 2021-03-07 12:11:49 -05:00