Commit Graph

21 Commits

Author SHA1 Message Date
Ben Clayton 77a90cb796 test/tint/builtins/gen: Use returned value
It appears that FXC and DXC do some validation post dead-code-elimination.
These tests have been updated so that the return value is assigned to a storage buffer, ensuring that all validation is performed.

Many DXC tests are affected by https://github.com/microsoft/DirectXShaderCompiler/issues/5082, which have been SKIP'ed.

Fixed: tint:1859
Change-Id: I0001a9a9821846cd0855c3d8ce2bec79ab8e64ef
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122662
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: James Price <jrprice@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
2023-03-06 18:25:08 +00:00
dan sinclair d9b68eb691 Fix generation of f16 values.
The generator script was not using the test values for `f16`, they
always got a zero initialization. This CL fixes the script to generate
`f16` values.

Change-Id: I95e8f2c7007251a646de05b4f7fe0aad14e740f8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/109342
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-11-10 00:32:12 +00:00
Ben Clayton 4b60615eae test/tint: Fix e2e test generation for vec / mat
Where the intrinsic uses the fixed-dimension form of the types.

Change-Id: I1709382f762fe7394bbd88f428f09b15a1a8a643
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/108642
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
2022-11-04 17:06:03 +00:00
Ben Clayton be35dec1c6 test/tint: Fix e2e test generation for abstract
Abstract int and abstract float were around the wrong way.

Credit goes to amaiorano@ for finding this!

Change-Id: Ifaeeca86b0d15ead295b714e0c178fa6d0bfb68b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/108641
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-11-04 16:54:02 +00:00
Ben Clayton 95dd428c75 tint/intrinsics.def: Add @test_value() annotation
Specifies the value to use for argument values when generating end-to-end tests.

Use this to provide a legal value for atanh().

Change-Id: I008050c856f9d687ab918c68e90678c4e74f3a1d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106887
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2022-10-25 13:08:45 +00:00
Ben Clayton c3adc78cbc test/tint/builtins: Remove hack for 'level' parameter value
I'm sure this was needed at one point, but I can't seem to find the
requirement in either the spec or implementation. *shrug*

Change-Id: I8c139747c2a6864867ecda0b82a5f7991ad9d3ef
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106886
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2022-10-25 13:08:45 +00:00
Ben Clayton 6c33dce75a tint/test/builtins/gen: Fix i32 argument values
These were incorrectly abstract-int, instead of i32. Oops.

Change-Id: Iafac4883ee431b04fb473392f545ae26436f8343
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106885
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2022-10-25 13:08:45 +00:00
Ben Clayton 559a248233 tint/resolver: Allow texture 'offset' to be const-expr
This allows the value to be declared in a `const` expression, and to use arithmetic.

Fixed: tint:1636
Change-Id: Ie641a9d4183429c79c91605cd4df78f569be3579
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/105623
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-10-13 17:06:29 +00:00
Ben Clayton 933eb5159e tint: Add _tint_materialize internal builtin
Returns a materialization of the given argument.

Bug: tint:1697
Change-Id: Id25f7e10baa884047af21f89245884c551560f7b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/104822
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-10-06 19:54:07 +00:00
dan sinclair 1dbda6f254 Update variables in address space template.
This CL updates the address space template to remove some usages of
`stoarge`.

Bug: tint:1404
Change-Id: I4c10f62886d2be4b03bce85dac9d58e3547ca60b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/104423
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-10-04 19:44:48 +00:00
dan sinclair ff7cf21021 Rename StorageClass to AddressSpace.
This CL updates the internals to use AddressSpace instead of the old
StorageClass name.

Bug: tint:1404
Change-Id: Iecc208e839453437f4d630f65e0152206a52db7e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/104420
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
2022-10-03 14:05:23 +00:00
Zhaoming Jiang 9443cebd53 tint: End-to-end tests for f16 built-in
This patch add Tint end-to-end tests for built-ins using f16 types.

Bug: tint:1473, tint:1502
Change-Id: I09db6e0b7e90541fb246e11d475e27be96a6d07e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/97340
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
2022-08-05 15:15:17 +00:00
Zhaoming Jiang 6fe1f515d4 tint: Add f16 support for parts of float built-in, part 1
This patch add f16 support for a major part of numeric built-in, and
implement corresponding unittests for resolver and backends. This patch
also enable f16 constant evaluation for unary minus operator, `atan2`
and `clamp`.

The following numeric built-ins are not supported yet:
* frexp
* modf

The end-to-end tests for f16 built-in are not added yet.

Bug: tint:1473, tint:1502
Change-Id: If807185617b21c510a1a9c371179a60800c4f875
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/96722
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
2022-07-29 11:41:51 +00:00
Ben Clayton a253a5f7e7 tools: Expand / clean-up the template WGSL type helpers
Fix `IsAbstract()` so that it doesn't consider most-nested element types.
Add `ElementType()` and `DeepestElementType()` helpers.
Add `OverloadUsesF16` as a helper for https://dawn-review.googlesource.com/c/dawn/+/96722.

Simplifies template code.

Change-Id: Iff5a9a7258caea06e00ee37c29e5298d9c35b799
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/97361
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2022-07-27 19:36:49 +00:00
Zhaoming Jiang f8fb94d9e8 tint: Emitting enable directive for DP4A End-to-End test
This patch modify the test/tint/builtins/gen/gen.wgsl.tmpl to emit
enable directive for dot4I8Packed and dot4U8Packed built-in function.
The expectaion files are added.

Bug: tint:1497
Change-Id: I53331695fe2e6609858e94bc261383ba3028d77c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/96640
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
2022-07-27 13:27:56 +00:00
Ben Clayton cde5009be3 tools: Shuffle 'intrinsic-gen' tooling
Rename to 'gen', so that more templating can be added without having a confusing name.

Can now be run with './tools/run gen'

Move the bulk of the intrinsic-gen logic to `tools/src/tint/intrinsic`

Change-Id: I750989a5aa86272c10c2ad37adffe7def11c61f2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/97141
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2022-07-26 15:46:44 +00:00
Ben Clayton ee36e39296 test/tint/builtins: Generate abstract numeric tests
Change-Id: I2da181af0694f73ec4be07ed40e4e70d49b53583
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/97140
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
2022-07-26 14:27:25 +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
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 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 eb29f81883 tint: Shuffle builtin test directories
mv test/tint/builtins/gen -> test/tint/builtins/gen/literal

We're going to add another set of these for builtins that use 'var' for
each argument.

Change-Id: I1b4ad1495ddccd48232603db2205bf50af9e36b6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92320
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2022-06-01 19:49:50 +00:00