Commit Graph

2058 Commits

Author SHA1 Message Date
dan sinclair dd516e6b64 Doxygen cleanup
This CL suppresses some Doxygen warnings for code doxygen doesn't
process correctly and adds the missing return for GenerateEntryPoint
method.

Change-Id: If97443a7177caa51c1054de83fb0711692a7ab22
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/29461
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-10-06 15:35:37 +00:00
dan sinclair b8d90ead93 Move visibility=hidden directive.
This CL moves the visibility=hidden directive from the top level applied
flags to libtint specifically. This fixes up an issue between
SPIRV-Tools and the sample app when using std::rfind which ends up with
different visibility.

Change-Id: Ib06949b3755db66027d3656d3d6ce2504bfda81e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/29460
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-10-06 15:11:17 +00:00
dan sinclair b5e5b804c3 Reduce duplication of type format strings.
This CL makes the AST type format name match the WGSL name so the
overloaded operator<< can be used in the WGSL writer. This removes a
bunch of duplication of WGSL type format name strings.

Bug: tint:230
Change-Id: I14aaefd21ced267ceed31f21faba3bd291275f0d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/29402
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2020-10-05 19:55:56 +00:00
dan sinclair 94b7c66858 [msl-writer][hlsl-writer] Add countOneBits and reverseBits
This Cl adds countOneBits and reverseBits intrinsic support to the MSL
and HLSL backends.

Bug: tint:250
Change-Id: Idb572da32e9c10767a27326cacf58aafef44a77a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/29401
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2020-10-05 19:46:16 +00:00
dan sinclair 44b043d46a Remove unused function.
This Cl removes the unused ctx method from the inspector helper.

Change-Id: I3c35aeb18c29078d5bdb46e3d1a2c5d4d6dcce54
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/29400
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-10-05 19:29:26 +00:00
Ryan Harrison 1a9a2dd07d Add Inspector class
This class is used to examine a module and get information about its
contents. This is the getting side of shader of reflection. Future
work will add transforms that perform the setting side of reflection.

In addition to the basic class and infrastructure, this CL adds a
GetEntryPoints() function demonstrate it works. More functionality
will be added in later CLs.

BUG=tint:257

Change-Id: If41dbb6c93302e0332754c086c75729d6ffe04d0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/29320
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
2020-10-05 14:52:36 +00:00
Sarah Mashayekhi 60a272a86e [validation] Update switch error numbers
fix clang error

Bug: tint: 6
Change-Id: Ib387258387e1f5069585a7fe3af3990df6fc8ddd
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/29043
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: David Neto <dneto@google.com>
2020-09-30 20:12:50 +00:00
dan sinclair 00000b57e8 [spirv-writer] Emit spec constants for non-constructor scalars.
In WGSL you can provide a constant_id variable without a constructor. In
SPIR-V we must synthesize a constant to attach the SpecId too. This CL
adds that variable creation.

Bug: tint:254
Change-Id: I2f25fdc3cb7e2c9c0f9e2129885865bd24298416
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/29200
Commit-Queue: Sarah Mashayekhi <sarahmashay@google.com>
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
2020-09-30 18:44:40 +00:00
dan sinclair d2d7ce6e31 Fixup computeboids example.
This Cl converts the cast in computeboids to a type constructor.

Change-Id: Ie1e7183226bb2f629f25cb2d35fc917d8ca68564
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/29140
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-09-30 14:00:10 +00:00
dan sinclair 70b4c3baad [transform] Add transforms to the sample app.
This CL extends the sample app to allow running the bound array accessor
transform.

Bug: tint:206
Change-Id: I226a947a2e0a9e0945aa044b2847b4fd62b7c277
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/29122
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-09-30 00:05:23 +00:00
dan sinclair af780816ca [wgsl-writer] Emit constant_id decorations.
This CL adds constant_id decorations to the WGSL writer.

Bug: tint:152
Change-Id: I637d158c0ef4d0ace2ce70a6fb3cbe6f0b8b3b4e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/29102
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
2020-09-29 23:57:03 +00:00
dan sinclair 5bb9b75684 [transform] Add a simple transform manager.
This CL holds a simpler manager to hold and execute multiple transforms.

Bug: tint:206
Change-Id: I45f6b55134f871167704f3549c4e4c72ef806c3a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/29121
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2020-09-29 23:54:03 +00:00
dan sinclair 58f2e9cf6a [spirv-writer] Emit specialization constants.
This CL adds OpSpec constants to the SPIRV-Writer.

Bug: tint:151
Change-Id: I309013ca0b4cb514edd92fab3dab2e4faa15969a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/29101
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-09-29 21:11:43 +00:00
dan sinclair 97b729de10 [transform] Add Transformer base class
This CL adds a Transformer base class from which the transformers will
inherit.

Bug: tint:206
Change-Id: I542eacb05d9a92af46d172a5803c245472c0e22c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/29120
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-09-29 20:28:21 +00:00
dan sinclair 9caffa4491 [ast] Add constant id helper.
This CL adds constant id helper methods to the decorated variable class.

Bug: tint:150
Change-Id: Icfdc516f37d4f2680d2b990879bff722085cf732
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/29082
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2020-09-29 20:00:00 +00:00
dan sinclair b403cb50ab [transform] Add BufferArrayAccessors transform
This CL adds a buffer array accessor clamping transform to
the available transforms in Tint.

Bug: tint:101
Change-Id: If9d5b0fb2c3adba723ce2185870b0e10981103a6
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28980
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-09-29 18:40:40 +00:00
dan sinclair 9e7f9dc96c [ast] Add constant_id decoration
This CL adds AST support for the constant_id decoration.

Bug: tint:150
Change-Id: Ifde5a5325f770567ea24129e786953d89f3f514b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/29100
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-09-29 18:07:50 +00:00
Sarah Mashayekhi 095f5f71b5 fix clang error
Change-Id: I7e68da53821b143d7ec55ef323822982b8f0b336
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/29042
Commit-Queue: Sarah Mashayekhi <sarahmashay@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-09-26 02:00:53 +00:00
dan sinclair 816764dbd4 [ast] Remove IsCast
This was missed in the general removal, cleanup.

Change-Id: I7912bb86e73cd9e38d497fab5995f7740a9dfbc6
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/29000
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: David Neto <dneto@google.com>
2020-09-25 18:41:02 +00:00
dan sinclair 571bce6b8d [spirv-writer] Add struct constructor test.
This CL adds a test for struct constructors in the SPIR-V backend.

Change-Id: I9ae82ce86cde159b87cce2ee95d0b16910aadc7f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28901
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-09-24 18:18:05 +00:00
dan sinclair 8a220a6f40 [spirv-writer] Add array constructors.
This CL emits array type constructors in the SPIR-V backend.

Change-Id: I796e81964df1af39ad1aacdd4ab8181852f661fa
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28900
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-09-24 16:48:35 +00:00
dan sinclair d6e063d13e [spirv-writer] Add matrix constructors.
This CL adds the matrix constructors to the SPIR-V output.

Change-Id: I7471700c262b499f843ffa4e3c49bcac0b0c7565
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28881
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-09-24 16:38:35 +00:00
dan sinclair b2a0c8aee7 [msl-writer][hlsl-writer] Remove space between builtin and (.
The builting CL accidentally inserted indenting between the name of the
builtin and the opening paren. This CL removes the extraneous spacing.

Change-Id: If684ec6f2fb4bf13b559c16b246f57f7975d019d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28944
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-09-24 15:12:55 +00:00
dan sinclair 3c02592718 Remove cast operator.
This CL removes the cast operator and converts the tests over to using
type constructors.

Bug: tint:241
Change-Id: I2526acb61f5624b2e1c068612a2ddcc748c92aed
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28860
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-09-24 14:38:44 +00:00
dan sinclair f367eadeef [msl-writer] Emit zero values for private, function and output vars.
This CL updates the MSL writer to emit the needed zero initializers for
Private, Function and Output variables.

Bug: tint:172
Change-Id: I73b1c3bb4c87a8ec7b1fb9d17a35e907c9a42095
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28943
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-09-24 14:33:24 +00:00
dan sinclair 93801bebd1 [transform] Rename generated variables.
This Cl prefixes the generated variable names from the vertex pulling
transform to prefix a '_' as you can not have an identifier in WGSL with
a leading '_'

Change-Id: Ic9ad873ac5f3ac25f96013f96e6d9a4c17964f22
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28942
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-09-24 14:32:48 +00:00
dan sinclair 5c948e4f8f [transform] Move the transform folder
This CL moves the transform folder from src/ast to src/. The transforms
operate on the AST, but they aren't part of the AST so I think the top
level folder makes more sense.

This will possibly cause issues when rolling if the transform is being
used.

Change-Id: Ibd7c94474168a7a4bdf38321f4e12ad111c80323
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28941
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-09-24 14:30:34 +00:00
dan sinclair 45292213bd [spirv-writer] Emit ShiftRightArithmetic.
This CL updates the SPIR-V writer to emit the arithmetic right shift if
the LHS of the expression is a signed scalar or vector.

Bug: tint:84
Change-Id: I4ca33a31783e1954515db5f12b2cf1d364aedee4
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28940
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-09-24 14:29:29 +00:00
dan sinclair effd888d2f Convert computeboids to for().
This CL updates computeboids to use the `for()` sugar instead of the
loop/continuing block.

Change-Id: I13f416624821a87fbfa40b15669980bedc794ed4
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28842
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-09-23 14:51:03 +00:00
dan sinclair 596fcdcec6 [spirv-writer] Fix ! to emit logical not.
The ! operator should emit an OpLogicalNot instead of an OpNot.

Bug: tint:248
Change-Id: I6e404c3286db7819e0692603e3cf9a87a1b37ed9
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28841
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-09-23 14:45:24 +00:00
dan sinclair d7abd76dea Update computeboids typing.
This Cl updates some of the literals and types in computeboids to be
stricter.

Bug: tint:248
Change-Id: I3bc42b8da7913677675d6e417b7f4ce19366eeb9
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28840
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-09-23 14:40:54 +00:00
dan sinclair a7d498e060 Rename 'as' to 'bitcast'
This CL updates Tint to use 'bitcast' instead of 'as' for the OpBitcast
conversions.

Bug: tint:241
Change-Id: I53a80de10421b2d9cc009527eebe5ff07e1285c2
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28801
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: David Neto <dneto@google.com>
2020-09-22 22:07:13 +00:00
dan sinclair b4fee2f824 Update builtin methods.
This CL removes the import mechanism, the identifier paths and updates
all of the standard library methods to be builtins.

Bug: tint:242
Change-Id: If09b98a155ae49ced3986ba2c9b517a060693006
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28720
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-09-22 19:42:13 +00:00
dan sinclair 5f8126271d Remove EntryPoint.
This CL removes the EntryPoint node and transitions everything to the
stage decoration.

Change-Id: Ib2840155905c8fa60ff35870f0c4b6705efb73ff
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28705
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
2020-09-22 14:53:03 +00:00
dan sinclair de2a019a7f [spirv-reader] Emit StageDecoration when building the functions
This CL adds the emission of StageDecoration to entry point functions.
EntryPoint nodes are still emitted. We duplicate the function emission
if there are multiple entry points pointing to the same function.

Change-Id: Icb48a063f5c6a30948bbe2c37c7fce7431af5864
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28665
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2020-09-22 14:22:12 +00:00
dan sinclair f91b9664e7 [hlsl-writer] Emit function decoration stage
This CL updates the hlsl writer to emit stage decorations.

Change-Id: Ic9ae9fbd47537f141949e27c876d37e6d4dcd97d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28704
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2020-09-22 13:47:32 +00:00
dan sinclair b5bb2d91af [msl-writer] Update to emit based on pipeline stage.
This CL updates the MSL writer to emit data base on the pipeline stage.

Change-Id: I9fb2e146f0c898d9703d69a6a92f535757106bba
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28703
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
2020-09-21 18:58:01 +00:00
dan sinclair a8274b2fef [spirv-writer] Emit entrypoint from function decoration.
This CL updates the SPIRV-Writer to emit entry point information based
on the function stage as well as EntryPoint nodes.

Change-Id: I1fa937cbb2159b31516b0189216d679e03f0384d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28702
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2020-09-21 18:49:01 +00:00
dan sinclair 48d08d2147 [wgsl-writer] Emit stage decorations.
This CL updates the wgsl writer to emit the stage decorations.

Change-Id: I0501088e074aa5d027f83fd0a2ac45ba3f36332f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28701
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
2020-09-21 17:59:51 +00:00
dan sinclair 51ac24ab10 [validate] Update to validate pipeline stages.
This CL converts the validator to work against the pipeline stages
attached to functions instead of entry point nodes.

Change-Id: Ia6274423e49426766c527d1123880ef6e0140959
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28700
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
2020-09-21 17:56:41 +00:00
dan sinclair 0592643782 [type-determiner] Update to work with entry point and function stages.
This Cl updates the type determiner to work with both styles of entry
point definition.

Change-Id: Ic48f1a5f0a5820821f9a74380896426a97483049
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28666
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
2020-09-21 17:51:31 +00:00
dan sinclair 767ea855ab [wgsl-reader] Parse stage decoration
This CL adds parsing of the stage decoration to the WGSL parser. The
decoration is not hooked up yet so it's effectively ignored.

Change-Id: I8d86c55cee189f993c10b6da31a9c388ba452021
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28664
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
2020-09-21 17:42:10 +00:00
dan sinclair b6841789bd Simple architecture document
This CL adds the start of an architecture document which can be expanded
as needed. The document is mostly an architecture diagram of how the
various pieces fit together.

Change-Id: I49b6509b9178928d100aece3c284199060969b6c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28660
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2020-09-21 16:00:11 +00:00
dan sinclair cb907b5bc2 [wgsl-reader] Fix issue with missing open brace for functions.
This Cl fixes the function parsing so the opening brace is required.
This will return an error now. The statement::body_stmt is changed to
make the open paren optional.

Bug: tint:236
Change-Id: I3faee1fd5add19aebcdb86943d6f4190c03d0f7a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28520
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: David Neto <dneto@google.com>
2020-09-21 15:55:32 +00:00
dan sinclair 43d17780ca [spirv-writer] Add multisampled textureLoad test.
This CL adds a test for multisampled textureLoad and fixes up a few type
determiner issues for multisampled textures.

Bug: tint:237
Change-Id: I5c33797b197b6f092842b22aa93d2076b0779766
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28582
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2020-09-21 15:52:10 +00:00
dan sinclair 64f9cdec68 [spirv-writer] Simplify the texture intrinsic tests
This CL removes the complete coverage of the possible input formats
infavor of simpler testing of a few of the inputs. This should be
sufficient coverage and makes the tests easier to read.

The incorrect OpConstantNull for the samplers and textures has also been
removed.

Change-Id: I9cd7d6299f0454bb8e2019968e0422221e4ec183
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28581
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2020-09-21 15:46:00 +00:00
dan sinclair 4dc0d7d311 Simplify SPIR-V builder texture type tests.
This CL removes the instantiated test suites, instead it tests each of
the required formats with one texture type and then uses the rest of the
tests to verify the texture type generated is correct.

This makes the tests a lot easier to read as the string generation for
results is removed.

Change-Id: I2c54471a2afc8bf2602ec8e4b50b27ad078dc4ee
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28580
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2020-09-21 15:38:10 +00:00
dan sinclair 2dbe9aa784 [hlsl-writer][msl-writer] Enable generate tests.
This CL fixes and enables the generic generate tests for both the MSL
and HLSL writers.

Bug: tint:7 tint:8
Change-Id: I7a3e76196a7c50bd30dcd55940686dc8269786f1
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28441
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-09-21 15:16:20 +00:00
dan sinclair d05f93fd8e [wgsl-reader] Add workgroup_size parsing
This CL adds parsing of the `workgroup_size` function decoration.

Change-Id: Ia90efc2c014ac0e1614429280cc903d30cf8171d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28663
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
2020-09-21 00:37:08 +00:00
dan sinclair 643827967e [ast][spirv-writer][hlsl-writer][wgsl-writer] Add workgroup_size decoration
This CL adds the workgroup_size decoration to functions and emits as
needed from the various backends.

Change-Id: Ifffde239e68047f6419c6980eca70c4efa9822c0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28662
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2020-09-21 00:28:58 +00:00