dan sinclair
57dcd3601c
Fixup merge test issue
...
The while loop and let error message landed about the same time and there were
merging issues that didn't get caught by CQ.
Change-Id: I5cd606f1809cc29fa2366d3b78883fa0cfc3b394
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93961
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Dan Sinclair <dsinclair@chromium.org >
Reviewed-by: Ben Clayton <bclayton@google.com >
Auto-Submit: Dan Sinclair <dsinclair@chromium.org >
Commit-Queue: Ben Clayton <bclayton@google.com >
2022-06-16 13:44:38 +00:00
dan sinclair
49d1a2d950
Add while statement parsing.
...
This CL adds parsing for the WGSL `while` statement.
Bug: tint:1425
Change-Id: Ibce5e28568935ca4f51b5ac33e7a60af7a916b4a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93540
Reviewed-by: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Dan Sinclair <dsinclair@chromium.org >
2022-06-16 12:01:27 +00:00
Ben Clayton
2a8861d20e
tint: Rework errors around variable declarations
...
Standarize the messages, using 'let', 'override' or 'var'.
Module-scope 'let' needs to be replaced with 'const', but baby steps.
Bug: tint:1582
Change-Id: I290aede118a30ab0f4294c89ec43005371c87b45
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93446
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Dan Sinclair <dsinclair@chromium.org >
Commit-Queue: Ben Clayton <bclayton@google.com >
2022-06-16 08:36:30 +00:00
Zhaoming Jiang
418e873ad2
tint: Make sure enable directives go first in ordered_globals
...
This patch change DependencyAnalysis::SortGlobals() to make sure that
'enable' directive nodes go before any other global declarations in the
sorted global node list, and thus ensure that all extensions will be
registered by reslover before dealing with any other global declarations.
This is necessary because some transforms will add AST nodes before any
other global nodes, and these added nodes should be handled by resolver
after 'enable' nodes are handled.
Bug: tint:1472
Change-Id: Idc2253fc055b0f121cb0cafcaca5275c23ed7b0d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93760
Reviewed-by: Ben Clayton <bclayton@google.com >
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com >
Reviewed-by: Ben Clayton <bclayton@chromium.org >
Kokoro: Kokoro <noreply+kokoro@google.com >
2022-06-16 08:30:17 +00:00
James Price
33563dc7d7
tint/transform: Move State to anonymous namespace
...
Copy/pasting this transform as a starting point for new transforms
causes the `State` classes to clash, and weird things happen. This
prevents that from happening.
Change-Id: Ia1c6b2b96e4d6375309aed535d7a87372b839792
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93880
Reviewed-by: Ben Clayton <bclayton@google.com >
Auto-Submit: James Price <jrprice@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
2022-06-16 08:28:22 +00:00
James Price
3e38d7effe
tint: Remove support for smoothStep builtin
...
The new spelling `smoothstep` was introduced in M102.
Fixed: tint:1483
Change-Id: Ia5e1401f8f09450a3a767b0bb975216bd85be8db
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93360
Commit-Queue: James Price <jrprice@google.com >
Auto-Submit: James Price <jrprice@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
2022-06-15 23:32:14 +00:00
Ben Clayton
446b1a7df1
tint/clone_context.h: Template the vector allocator type
...
Currently nothing in Tint uses a different allocator type, but this
allows the CloneContext to support different allocators, the day we do.
Change-Id: I70367bd3710128d0708b3369f66b441344b789f8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93602
Reviewed-by: Dan Sinclair <dsinclair@chromium.org >
Commit-Queue: Ben Clayton <bclayton@chromium.org >
2022-06-15 21:36:27 +00:00
Ben Clayton
2032d03400
tint/transform: Remove use of StorageClass on parameter
...
Parameters don't have storage classes or access qualifiers. This was
just (ab)using the fact that a parameter uses the same AST type as a
'var'.
Also simplify the parameter disable validation logic.
Bug: tint:1582
Change-Id: Ic218078a410f991e7956e6cb23621a94a69b75a3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93603
Commit-Queue: Ben Clayton <bclayton@google.com >
Reviewed-by: Dan Sinclair <dsinclair@chromium.org >
2022-06-15 19:32:37 +00:00
David Neto
7bdeb49d64
Fix comment on constructor parameter
...
Change-Id: I29d19188f189d2c2ff7b70058782cf7a89e1dabd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93820
Commit-Queue: Ben Clayton <bclayton@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
Auto-Submit: David Neto <dneto@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
2022-06-15 16:49:37 +00:00
Ben Clayton
2ae29830db
tint: Add ast::ParameterList, use it
...
This is currently identical to ast::VariableList, but once we break
ast::Variable up, this will become a different vector type.
Bug: tint:1580
Change-Id: Ib2db5772996a63cd1989e36f1034dc1fbd3b371a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93601
Reviewed-by: Antonio Maiorano <amaiorano@google.com >
Commit-Queue: Ben Clayton <bclayton@chromium.org >
2022-06-15 10:14:27 +00:00
Ben Clayton
7164b97272
tint: Clean up Func() usage
...
Drop the vector typename from the initializer lists. These don't really
provide any significant help in understanding the arguments types, as
the list of element types can be easily inferred.
This is done to simplify the refactor ast::VariableList ->
ast::ParameterList.
Bug: tint:1580
Change-Id: Ibf8564ca9b2bafd2eaa2e4aa54c29be6bbe7a682
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93600
Reviewed-by: Antonio Maiorano <amaiorano@google.com >
Commit-Queue: Ben Clayton <bclayton@chromium.org >
2022-06-15 10:02:37 +00:00
David Neto
93928b0d19
spirv-reader: Don't hoist builtin vars.
...
Fixed: tint:1577
Change-Id: I1decc99e4a5a293b49c24aa15d1ac6dd0287462e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93680
Commit-Queue: Ben Clayton <bclayton@chromium.org >
Auto-Submit: David Neto <dneto@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@chromium.org >
2022-06-15 08:31:09 +00:00
Zhaoming Jiang
cae289da70
tint: Fix exactly representable check in lexer
...
This patch fix two implicit type conversion to make Kokoro green.
Bug: tint:1473, tint:1502
Change-Id: I7f4d1d71e45a3d8e834625a9f71acc72a8816685
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93343
Reviewed-by: Ben Clayton <bclayton@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
2022-06-11 16:00:44 +00:00
Zhaoming Jiang
0fb4e2c608
tint: f16 literal in WGSL lexer and check subnormal f32/f16 hex literal
...
This patch
1. Add F16 literal support in WGSL lexer and parser for both decimal and
hex form. Also fix the f16::Quantize method to deal with subnormal cases
correctly.
2. Fix exactly-representable check for hex f32 literal to deal with
subnormal cases.
3. Implement and fix related unitests for f16 and f32.
Bug: tint:1473, tint:1502
Change-Id: Ia4a7c9144ef9323fb23b2200a64e1ca8afb6c334
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93100
Reviewed-by: David Neto <dneto@google.com >
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com >
Commit-Queue: David Neto <dneto@google.com >
2022-06-10 18:18:35 +00:00
Antonio Maiorano
856d6af57e
tint: uniformity: detect pointers assigned to in non-uniform control flow
...
Bug: tint:1558
Change-Id: Ia92258f1fb40b008a6052ce2ea5a20ec29351ce5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93264
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
Commit-Queue: Antonio Maiorano <amaiorano@google.com >
2022-06-10 17:55:23 +00:00
dan sinclair
0fa572ff05
Emit deprecation warnings for @stage.
...
This PR enables the deprecation warnings for the @stage builtin.
Bug: tint:1503
Change-Id: I4a560f451a9ad56bc712f6a04c18eba6ae67ab64
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93121
Reviewed-by: Ben Clayton <bclayton@google.com >
Auto-Submit: Dan Sinclair <dsinclair@chromium.org >
Commit-Queue: Dan Sinclair <dsinclair@chromium.org >
2022-06-09 15:33:42 +00:00
Antonio Maiorano
bd30d9e594
tint: uniformity: control flow reconverges after short-circuiting op when behaviour is {Next}
...
Bug: tint:1561
Change-Id: I685fe970f2c36d4ed39ba5fbe519736c031fbeca
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93160
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
Commit-Queue: Antonio Maiorano <amaiorano@google.com >
2022-06-08 16:01:01 +00:00
James Price
a4666888a4
tint: Fix include layering violation
...
Headers exposing functionality from the core Tint library should be
included via include/tint/tint.h.
This fixes the google3 build.
Change-Id: I82a9d0105b3b44fb4c4c89b59e9282290dd49c61
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93120
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
Reviewed-by: Antonio Maiorano <amaiorano@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Auto-Submit: James Price <jrprice@google.com >
2022-06-08 15:04:12 +00:00
dan sinclair
b29892be09
Update src/tint unittests to new @stage format.
...
This CL updates all of the Tint unittests to the new @stage shorter
syntax. This also updates the WGSL writer to emit the new short forms
instead of using the deprecated form.
Bug: tint:1503
Change-Id: I8c49e5319a19cccb5b4b5078f3ab39c50f31a9a8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92483
Reviewed-by: Ben Clayton <bclayton@google.com >
Commit-Queue: Dan Sinclair <dsinclair@chromium.org >
Kokoro: Kokoro <noreply+kokoro@google.com >
2022-06-07 13:55:34 +00:00
Ben Clayton
33fe68ee0f
tint/resolver: Prevent ICE with invalid input
...
Attempting to return an abstract-numeric when the function had no return type would trigger an ICE, as an abstract numeric cannot materialize to a void type.
Bug: chromium:1332613
Change-Id: I635ebb8dddb2e7628939607a4f964be62b616745
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92720
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Dan Sinclair <dsinclair@chromium.org >
Commit-Queue: Ben Clayton <bclayton@google.com >
2022-06-06 15:11:04 +00:00
Antonio Maiorano
f25140fe6f
tint: fix emitting duplicate structs for atomicCompareExchangeWeak
...
Bug: tint:1574
Change-Id: Id4ae2d2de9ac4678260f4ecfb3a0f779d170f9a4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92280
Reviewed-by: James Price <jrprice@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Antonio Maiorano <amaiorano@google.com >
2022-06-03 14:47:01 +00:00
dan sinclair
f0c150b01b
Add parsing of shorter stage attributes.
...
This CL adds the ability to parse the `@compute`, `@fragment` and
`@vertex` attrbutes. The `@stage(...)` are still accepted and are not
marked as deprecated yet.
Most tests are still using `@stage(..)` except for a testing one.
Bug: tint:1503
Change-Id: I85cad5996605035e83109b021ffb13db98b1a144
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92480
Reviewed-by: Dan Sinclair <dsinclair@chromium.org >
Reviewed-by: Antonio Maiorano <amaiorano@google.com >
Auto-Submit: Dan Sinclair <dsinclair@chromium.org >
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Dan Sinclair <dsinclair@chromium.org >
Reviewed-by: Ryan Harrison <rharrison@chromium.org >
2022-06-03 02:47:40 +00:00
Ben Clayton
c0af5c5c9c
tint: Add builtin tests for arguments passed by var
...
Change-Id: I81b69d23e40675d7f525e6369afec9aa0659d043
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92321
Reviewed-by: Dan Sinclair <dsinclair@chromium.org >
Commit-Queue: Ben Clayton <bclayton@google.com >
Reviewed-by: Antonio Maiorano <amaiorano@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
2022-06-02 14:36:10 +00:00
Ben Clayton
451eee0fed
tint: Stub intrinsic @const evaluation
...
Add support for @const to builtins in intrinsics.def.
Propagate this flag through to the intrinsic table.
Handle builtins that are @const annotated in the resolver.
Currently no intrinsics are decorated with @const, so there's nothing to
test (yet).
Bug: tint:1504
Change-Id: I172483688617782bd7c58b70e3f38d0222a5d1af
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92323
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Reviewed-by: Antonio Maiorano <amaiorano@google.com >
2022-06-01 23:57:20 +00:00
Ben Clayton
e0cd855aa2
tint/writer/spirv: Tweak builtin tests to use 'var's
...
If the builtin has values passed by literal, let or const, then they may
be evaluated at shader-creation time, which makes the tests almost useless.
Bug: tint:1504
Change-Id: I004f49ec4b3430c8015e65d3fde1f5fa4fdd10f9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92322
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Reviewed-by: Dan Sinclair <dsinclair@chromium.org >
2022-06-01 22:21:40 +00:00
Ben Clayton
e3e91c0d75
tools: intrinsic-gen - [[decoration]] -> @attribute
...
More closely resembles WGSL.
Change-Id: Ia1b93bb443b4e3bf9329f8026d1924f12648cb7b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92245
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Antonio Maiorano <amaiorano@google.com >
2022-06-01 20:44:50 +00:00
Ben Clayton
0d757d2fad
tint/resolver: Enable abstract-numerics
...
Turn on resolving of abstract-integer and abstract-float types, as well
as materialization to their concrete types.
Bug: tint:1504
Bug: chromium:1330805
Fixed: tint:1572
Change-Id: I09c95406e11b64bb0267fe7b1ed08af986dbd553
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91840
Commit-Queue: Ben Clayton <bclayton@chromium.org >
Reviewed-by: David Neto <dneto@google.com >
Reviewed-by: Dan Sinclair <dsinclair@chromium.org >
2022-06-01 20:34:40 +00:00
Ben Clayton
e593585e21
tint/transform: Remove FoldConstants
...
No longer used.
Bug: tint:1504
Change-Id: I48548afc421a2658b5367125bd63c80a7f4bc87f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92084
Reviewed-by: Antonio Maiorano <amaiorano@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
2022-06-01 16:04:19 +00:00
Ben Clayton
a20ef0c0f1
tint/sem: Fix Constant constructor with initializer_list
...
This was always constructing the elements with AFloat, when it should pick between AInt / AFloat based on the type T.
Bug: tint:1504
Change-Id: I2dd4a9bcd829c47c9b0e8d730c5f58a5266d3626
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92240
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Zhaoming Jiang <zhaoming.jiang@intel.com >
Reviewed-by: Antonio Maiorano <amaiorano@google.com >
Commit-Queue: Ben Clayton <bclayton@chromium.org >
2022-06-01 15:58:27 +00:00
Ben Clayton
8e3485248e
tint/writer/spirv: Inline constant expressions
...
This is required to handle materialized values, and for constant
expressions.
Bug: tint:1504
Change-Id: If0a49e9b03566c06aa6e4e4c284fc427e1541e91
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92082
Reviewed-by: Dan Sinclair <dsinclair@chromium.org >
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Ben Clayton <bclayton@chromium.org >
2022-06-01 15:57:22 +00:00
Ben Clayton
609ce6de8d
tint/sem: Consider sign bit for Constant helpers.
...
Constant::AnyZero(), Constant::AllZero() now consider -0.0 as non-zero,
as this is different from WGSL's zero-initializer value for floating
point numbers.
Also consider FP sign for Constant::AllEqual().
Bug: tint:1504
Change-Id: I00503880ee29bd741b94cc98909a8a823e32522a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92243
Commit-Queue: Ben Clayton <bclayton@chromium.org >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
2022-06-01 15:35:50 +00:00
Ben Clayton
e9f8b09063
tint/writer/hlsl: Inline constant expressions
...
This is required to handle materialized values, and for constant
expressions.
Bug: tint:1504
Change-Id: I79ad567954de2d1cfea09dda255894e4e2aa678e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92081
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Antonio Maiorano <amaiorano@google.com >
Commit-Queue: Ben Clayton <bclayton@chromium.org >
2022-06-01 13:14:39 +00:00
Zhaoming Jiang
84b48cf30c
Tint: num_workgroups use free binding group if not specified
...
In this patch NumWorkgroupsFromUniform::Config changed to storage
std::optional<sem::BindingPoint>, and if it has no value,
NumWorkgroupsFromUniform will choose a free binding group, i.e.
binding 0 of the largest used group plus 1 is used if at least one
resource is bound, otherwise group 0 binding 0 is used. Tint CLI
is also changed to provide a --hlsl-root-constant-binding-point
option allowing user to specify the binding point for num_workgroups
uniform buffer.
Bug: tint:1566
Change-Id: I3b8c22a4276bab722d901f5b07d23a268786c417
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91980
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com >
2022-06-01 10:23:51 +00:00
Ben Clayton
cb6ddd2aa6
tint/writer/msl: Inline constant expressions
...
This is required to handle materialized values, and for constant
expressions.
Bug: tint:1504
Change-Id: Ic3ac62317241fa6f7009360128f222aeb56f62e4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92083
Reviewed-by: Corentin Wallez <cwallez@chromium.org >
Commit-Queue: Ben Clayton <bclayton@google.com >
2022-06-01 10:08:29 +00:00
Ben Clayton
25b7e98d11
tint/writer/glsl: Inline constant expressions
...
This is required to handle materialized values, and for constant
expressions.
Bug: tint:1504
Change-Id: Ie0177f148e08a0e1a3f4d7e06e283f121655804b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92080
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Antonio Maiorano <amaiorano@google.com >
2022-06-01 01:11:59 +00:00
James Price
37d92ca244
tint/spirv: Fix atomicCompareExchangeWeak
...
We were missing an `UnwrapRef` when generating the return type, and
were generating invalid SPIR-V when the value being stored was a
reference. The auto-generated builtin tests only test with literal
values.
Fixed: tint:1573
Change-Id: If42280b3cc8ad3fba7355d333e02400c6db843fa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92144
Reviewed-by: Antonio Maiorano <amaiorano@google.com >
Auto-Submit: James Price <jrprice@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: James Price <jrprice@google.com >
2022-06-01 00:03:29 +00:00
Ben Clayton
7e495d8f2e
tint/resolver: Implement candidate overload resolution
...
Once abstract-numerics are supported, we encounter our first ambiguous
overloads which need resolving. Implement this.
Bug: tint:1504
Change-Id: I79ade04ac3c7ae754b92cb0691b46f449766824a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91964
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Commit-Queue: Ben Clayton <bclayton@chromium.org >
Reviewed-by: Dan Sinclair <dsinclair@chromium.org >
2022-05-31 21:46:19 +00:00
Ben Clayton
bfb5fd794c
tint/sem: Add more helpers to Constant
...
Many backends can produce cleaner code if all the elements are zero or
the same value.
Bug: tint:1504
Change-Id: Iff3227884473b0be42395e4a637a7fe0b7a1b238
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91966
Reviewed-by: Antonio Maiorano <amaiorano@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
2022-05-31 21:23:29 +00:00
Ben Clayton
8bd5fec482
tint/writer/wgsl: Emit 'f' suffix on FloatLiteralExpressions
...
If the literal was constructed with an 'f', make sure we print it.
Bug: tint:1504
Change-Id: I6f04e31a166919c07574db56b0a2063ce5b8ca5c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91965
Reviewed-by: Antonio Maiorano <amaiorano@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
2022-05-31 20:45:59 +00:00
Ben Clayton
22bd004409
tint/resolver: Materialize RHS of non-phony assignments
...
Phony assignments do not materialize the RHS.
See: https://github.com/gpuweb/gpuweb/pull/2968
Bug: tint:1504
Change-Id: I29bb15e813d2b01876b5ec670c31b7aff3230986
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91963
Reviewed-by: Dan Sinclair <dsinclair@chromium.org >
Commit-Queue: Ben Clayton <bclayton@chromium.org >
Kokoro: Kokoro <noreply+kokoro@google.com >
2022-05-31 20:40:59 +00:00
Ben Clayton
649d3d9602
tint/resolver: Materialize array size expression
...
Bug: tint:1504
Change-Id: If67228f18b26f718689f641beae95d281baf9c0c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91962
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Dan Sinclair <dsinclair@chromium.org >
2022-05-31 18:11:34 +00:00
Ben Clayton
49a09140b9
tint/resolver: Materialize array index expression
...
Bug: tint:1504
Change-Id: Ib14f4aa8ed7ca9d4bc4cdf6f4acdfa7eec03b716
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91961
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Reviewed-by: Dan Sinclair <dsinclair@chromium.org >
2022-05-31 15:22:21 +00:00
Antonio Maiorano
08f4b557fc
Implement atomicCompareExchangeWeak returning struct instead of vec2
...
Also fixed implementation of this atomic in GLSL. It was emitting code
that would not compile because, as for HLSL, we must pass in the
variable directly to atomic funcs, not via an in/out arg to a function.
Bug: tint:1185
Change-Id: Id0e9f99d6368717511ef3a94473634c512e10cb8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91881
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
Commit-Queue: Antonio Maiorano <amaiorano@google.com >
2022-05-31 13:20:28 +00:00
Ben Clayton
61537d3f57
tint: Add Checked[Add|Mul|Madd]()
...
Test-for-overflow utilities for AInt.
Bug: tint:1504
Change-Id: I974ef829c72aaa4c2012550855227f71d4a370a0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91700
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: David Neto <dneto@google.com >
Commit-Queue: Ben Clayton <bclayton@chromium.org >
2022-05-31 13:14:29 +00:00
dan sinclair
61d76ebb5c
Update some forward declarations.
...
This CL removes some forward declarations which are no longer needed
and adds one missing declaration which was pulled in from other headers.
These were found by the clang-tidy bugprone-forward-declaration-namespace
check.
Bug: dawn:1414
Change-Id: I8906861e472f2d64a1547c8c6de348cd4151ffb5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91742
Reviewed-by: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Auto-Submit: Dan Sinclair <dsinclair@chromium.org >
Commit-Queue: Dan Sinclair <dsinclair@chromium.org >
Reviewed-by: Corentin Wallez <cwallez@chromium.org >
2022-05-30 18:00:58 +00:00
Ben Clayton
8b09bc97c0
tint: Lex abstract integers
...
Check that the parsed number fits in an abstract-integer.
Refactor the unit tests so that they're maintainable. Add missing tests.
Bug: tint:1504
Change-Id: I04b6604820d527da66e3f6fcb47391efc0c3330a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91701
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: David Neto <dneto@google.com >
2022-05-30 17:54:38 +00:00
Ben Clayton
b8ac933909
tint/resolver: Materialize arguments to @workgroup_size
...
Bug: tint:1504
Change-Id: I69b448e62a4ebd684f6832f76fd28d8a31892a1a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91847
Reviewed-by: David Neto <dneto@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
2022-05-28 10:34:06 +00:00
Ben Clayton
8c7ffbd9d5
tint/resolver: Materialize argument to bitcast
...
Bug: tint:1504
Change-Id: I4eb4f041e69154dccd9719746a30dd6963dcd252
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91846
Commit-Queue: Ben Clayton <bclayton@google.com >
Reviewed-by: David Neto <dneto@google.com >
2022-05-28 07:09:17 +00:00
Ben Clayton
3a236c6c51
tint/resolver: Add tests for implicit type materialization
...
These are tests for when there's no explicit target type for a
materialization. In this case we expect an abstract-int to
materialize to an i32 and an abstract-float to materialize to a
f32.
Fix a bug uncovered where we were creating a transposed matrix.
Bug: tint:1504
Change-Id: Ie69dd7ec47174d3d7bef20315fd3780dade3a325
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91845
Reviewed-by: David Neto <dneto@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
2022-05-28 05:28:11 +00:00
Ben Clayton
3aa0f8182b
tint/resolver: Rename test field names, update comments
...
Try and make things a little clearer.
Change-Id: I66b051e71d4fc8366afe8b2b90067c7c0708d7cc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91844
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Reviewed-by: David Neto <dneto@google.com >
2022-05-27 22:06:26 +00:00