James Price
8d33b8593c
writer/hlsl: Implement invariant attribute
...
Bug: tint:772
Change-Id: I228cd01b1e6b93ad5a5f4eacd0b495b3bcb3508f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57645
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Auto-Submit: James Price <jrprice@google.com >
2021-07-13 12:29:26 +00:00
Ben Clayton
af6fc5f5d9
resolver: Replace GetScalarConstExprValue with ConstantValueOf
...
ConstantValueOf() obtains the constant value from the logic in resolver_constants.cc. This is better tested, and is the foundation of Tint's constant folder.
Change-Id: I42036f3ff4ab684b4864cd69856de1715b38d246
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57702
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-07-13 12:18:13 +00:00
Ben Clayton
51cfe26bb7
writer/hlsl: Simplify UBO accesses for static indexing
...
Use the new semantic constant value information to significantly reduce the complex indexing logic emitted for UBO accesses.
This will dramatically reduce the number of `for` loops that are decayed to `while` loops.
Change-Id: I1b0adb5edde2b4ed39c6beafc2e28106b86e0edd
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57701
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-07-13 12:18:13 +00:00
Ben Clayton
71f619b6f1
[resolver]: Begin constant value evaluation
...
Move the bulk of the constant evaulation logic out of transform::FoldConstants and into Resolver and sem::Expression.
transform::FoldConstants now replace TypeConstructor nodes that have a constant value on the expression.
This is ground work to:
* Cleaning up the HLSL uniform buffer indexing, which is `/` and `%` arithmatic heavy
* Prepares us to handle `constexpr` when it lands in the spec
* Provide a centralized place to do constant evaluation, instead of the
having similar logic scattered around the codebase.
Change-Id: I3e2f542be692046a8d243b62a82556db519953e7
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57426
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Antonio Maiorano <amaiorano@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-07-13 12:18:13 +00:00
Vasyl Teliman
c6bcab02fd
Implement AST fuzzer
...
This change implements a new fuzzer. It mutates a WGSL shader by traversing
the AST of a program and applying various transformations that might or might not
be semantics preserving.
Change-Id: I6b144bd1067444c3f0b815ba1a646aaf6e739b52
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/52160
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Vasyl Teliman <vasniktel@gmail.com >
Reviewed-by: Alastair Donaldson <allydonaldson@googlemail.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-07-13 12:01:25 +00:00
Austin Eng
2103fa629e
Pass preserveInvariance to MSL compiler if necessary
...
Fixed: dawn:977
Change-Id: I7df2080424a4af0b7155ee24f61bb37f0674de82
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57741
Commit-Queue: Austin Eng <enga@chromium.org >
Reviewed-by: James Price <jrprice@google.com >
2021-07-13 00:07:45 +00:00
Dawn Autoroller
726d17947a
Roll Tint from f07ad6733b to 54d1ee6f11 (11 revisions)
...
https://dawn.googlesource.com/tint.git/+log/f07ad6733b6a..54d1ee6f1161
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC kainino@google.com on the revert to ensure that a human
is aware of the problem.
To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Bug: None
Tbr: kainino@google.com
Change-Id: I577a771101844a840accaa521576cba0ad99379e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57742
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com >
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com >
2021-07-12 23:09:11 +00:00
James Price
54d1ee6f11
fuzzers: Switch fuzzers to new generator API
...
Remove sanitizer transform fuzzers, as these will no longer be
publicly visible. We should fuzz the generator options instead.
Change-Id: If8f2c70f505bdaecd62a2f53a6586c3b84bd1c33
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57760
Auto-Submit: James Price <jrprice@google.com >
Reviewed-by: Ryan Harrison <rharrison@chromium.org >
Commit-Queue: Ryan Harrison <rharrison@chromium.org >
Kokoro: Kokoro <noreply+kokoro@google.com >
2021-07-12 21:07:41 +00:00
Ben Clayton
aa48b1ad8d
Revert "Validate storage class constraints"
...
This reverts commit fd5829e5ea .
Reason for revert: Temporarily reverting as this is preventing a tint->dawn roll, which is needed to fix the dawn->chrome roll.
Original change's description:
> Validate storage class constraints
>
> As defined by https://gpuweb.github.io/gpuweb/wgsl/#storage-class-layout-constraints
>
> Bug: tint:643
> Change-Id: I9c78ba69a792a80c263a17b0a6e9b4810fdb7f30
> Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56780
> Kokoro: Kokoro <noreply+kokoro@google.com >
> Commit-Queue: Antonio Maiorano <amaiorano@google.com >
> Reviewed-by: Ben Clayton <bclayton@google.com >
TBR=bclayton@google.com ,amaiorano@google.com ,noreply+kokoro@google.com ,tint-scoped@luci-project-accounts.iam.gserviceaccount.com
Change-Id: I8dbd0e46b3e3291ef08797a196d0d9abd2a78845
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: tint:643
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57704
Reviewed-by: Ben Clayton <bclayton@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Ben Clayton <bclayton@google.com >
2021-07-12 20:15:43 +00:00
Andrii Shyshkalov
66a88a2643
[realms] launch 20% of builds in realms mode.
...
R=rharrison
Bug: chromium:1216166
Change-Id: I4103a26046163a1d71ac9a1e039dfe4c06ceb100
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57425
Reviewed-by: Ryan Harrison <rharrison@chromium.org >
Commit-Queue: Ryan Harrison <rharrison@chromium.org >
Kokoro: Ryan Harrison <rharrison@chromium.org >
Kokoro: Kokoro <noreply+kokoro@google.com >
Auto-Submit: Andrii Shyshkalov <tandrii@google.com >
2021-07-12 19:49:01 +00:00
Yunchao He
b326f8c172
Remove UnsafeAPI toggle for 3D texture
...
3D texture implementation has already been done. It's time to remove
the UnsafeAPI toggle for it.
Bug: dawn:547
Change-Id: Ic9e0930d7906ee5274b9e412ebacb2574744b2b3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56480
Reviewed-by: Corentin Wallez <cwallez@chromium.org >
Reviewed-by: Austin Eng <enga@chromium.org >
Commit-Queue: Yunchao He <yunchao.he@intel.com >
2021-07-12 19:01:51 +00:00
Andrii Shyshkalov
b5d561be5a
[realms] launch 20% of builds in realms mode.
...
R=rharrison
Bug: chromium:1216166
Change-Id: I773f502b741b26a5d591a600b08b7265abceb03c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57465
Reviewed-by: Ryan Harrison <rharrison@chromium.org >
Commit-Queue: Ryan Harrison <rharrison@chromium.org >
Auto-Submit: Andrii Shyshkalov <tandrii@google.com >
2021-07-12 18:25:20 +00:00
Ben Clayton
3797ab6465
reader/wgsl: Be more aggressive at bailing
...
... once the maximum number of errors have been reached.
https://dawn-review.googlesource.com/c/tint/+/56070 introduced maybe_set_synchronized(), which only set synchronized_ when the number of errors reported was less than max_errors_, but it seems the fuzzers have found ways to generate an excessive number of errors that keep the parser synchronized.
Revert 56070, and instead check the synchronized state along with the error count for every unbounded loop in the parser.
Fixed: chromium:1226655
Fixed: chromium:1226379
Change-Id: I178d758ac1424d4d19923fe6a3d9e123879b9eae
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57427
Auto-Submit: Ben Clayton <bclayton@google.com >
Commit-Queue: James Price <jrprice@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-07-12 16:50:31 +00:00
James Price
2c2aa2a76a
writer/msl: Implement invariant attribute
...
Report whether one was generated so that Dawn knows to use the
`-fpreserve-invariance` compiler option.
Bug: tint:772
Change-Id: Ife1eb05265646727dc864f12f983781af4df3777
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57644
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
2021-07-12 16:11:41 +00:00
Antonio Maiorano
fd5829e5ea
Validate storage class constraints
...
As defined by https://gpuweb.github.io/gpuweb/wgsl/#storage-class-layout-constraints
Bug: tint:643
Change-Id: I9c78ba69a792a80c263a17b0a6e9b4810fdb7f30
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56780
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Antonio Maiorano <amaiorano@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-07-12 15:25:49 +00:00
Andrii Shyshkalov
cbef5a54a4
[realms][dawn] configure but not use realms.
...
Also:
* remove redundant luci-scheduler permission.
* make ./main.star executable on mac/linux.
R=rharrison
Bug: chromium:1216166
Change-Id: Icd5e1612f7d201b640eeafa7217342b97e0fe5aa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57464
Auto-Submit: Andrii Shyshkalov <tandrii@google.com >
Commit-Queue: Ryan Harrison <rharrison@chromium.org >
Reviewed-by: Ryan Harrison <rharrison@chromium.org >
2021-07-12 14:54:34 +00:00
James Price
88b8e2f289
writer/spirv: Implement invariant attribute
...
Bug: tint:772
Change-Id: I94f8e95f7c1206f33dbf4defba2d22d95a5cfb1e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57643
Reviewed-by: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
2021-07-12 14:48:20 +00:00
Andrii Shyshkalov
762c81b4eb
[realms][tint] configure but do not use realms.
...
Also:
* remove redundant luci-scheduler permission.
* make ./main.star executable on mac/linux.
R=rharrison
Bug: chromium:1216166
Change-Id: Iae6d915d5327218c4c1f80db273be347cf855765
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57424
Auto-Submit: Andrii Shyshkalov <tandrii@google.com >
Commit-Queue: Ryan Harrison <rharrison@chromium.org >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ryan Harrison <rharrison@chromium.org >
2021-07-12 14:40:22 +00:00
Dawn Autoroller
49cbb5e296
Roll Tint from 9569e2c790 to f07ad6733b (2 revisions)
...
https://dawn.googlesource.com/tint.git/+log/9569e2c790c5..f07ad6733b6a
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC bajones@google.com on the revert to ensure that a human
is aware of the problem.
To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Bug: None
Tbr: bajones@google.com
Change-Id: I912c04bf58a89b2619bd4f9da0ca33dd4c77e538
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57681
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com >
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com >
2021-07-12 13:58:34 +00:00
James Price
fcc0de0b86
wgsl: Implement invariant attribute
...
Make sure the other backends ICE on unrecognized attributes.
Add E2E tests, currently skipped for the other backends.
Bug: tint:772
Change-Id: I4e68d111ff79b19ebb6c574058a91debcb746011
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57642
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-07-12 12:28:52 +00:00
James Price
508d2491d0
validation: Validate invariant attribute
...
This is only valid on structure members and entry point return
types. Additionally, this can only be applied to a position builtin.
Bug: tint:772
Change-Id: Iffd774ca768ab66373678ecf0eb57c766767e92b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57641
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-07-12 12:12:32 +00:00
Ben Clayton
2e6fefb858
Revert "Generate shader corpora for fuzzers"
...
This reverts commit d09317c0b5 .
Reason for revert: Breaks chromium build. See: crbug.com/tint/970
Bug: tint:970
Original change's description:
> Generate shader corpora for fuzzers
>
> Adds scripts that generated corpora of WGSL and SPIR-V shaders for
> the tint fuzzers, from test cases in the repository.
>
> Fixed: tint:966
> Change-Id: I7e86ef5e34676d0c4f5b7e413a5c0f444fca08ff
> Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57204
> Kokoro: Kokoro <noreply+kokoro@google.com >
> Reviewed-by: Ben Clayton <bclayton@google.com >
> Reviewed-by: Ryan Harrison <rharrison@chromium.org >
> Commit-Queue: Alastair Donaldson <afdx@google.com >
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I5bdcfe33c3e4d1bc71b9e51c650c0e7318c561e1
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57428
Reviewed-by: Ben Clayton <bclayton@google.com >
Kokoro: Ben Clayton <bclayton@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
2021-07-12 11:59:21 +00:00
James Price
f07ad6733b
ast: Add InvariantDecoration
...
Bug: tint:772
Change-Id: Icd1892a1affed10af8e7b90257129fa54360815e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57640
Commit-Queue: Ben Clayton <bclayton@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
Kokoro: Ben Clayton <bclayton@google.com >
2021-07-12 11:44:51 +00:00
dan sinclair
bf1ec305db
reader/wgsl: Remove old token methods.
...
This CL removes the old token `Is<Name>()` methods which are no longer
being used in the parser or lexer. (Some of them were used in tests but
the generic `Is(<type>)` is used instead.
New `peek` methods are added which will peek if the given token comes
either next or at the given index.
Change-Id: I8d15f2a42889f981d273b6459d20c4202db1ae32
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57540
Auto-Submit: dan sinclair <dan.sinclair@gmail.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@chromium.org >
Reviewed-by: Ben Clayton <bclayton@google.com >
Commit-Queue: Ben Clayton <bclayton@chromium.org >
2021-07-12 11:21:51 +00:00
Dawn Autoroller
ea41b9d3c2
Roll Tint from e027e81bf2 to 9569e2c790 (2 revisions)
...
https://dawn.googlesource.com/tint.git/+log/e027e81bf27d..9569e2c790c5
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC bajones@google.com on the revert to ensure that a human
is aware of the problem.
To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Bug: None
Tbr: bajones@google.com
Change-Id: I6f0f7493bcc19b77b1410e3f986b8a7f656c6160
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57621
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com >
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com >
2021-07-10 01:10:49 +00:00
Brandon Jones
966b3092e8
Suppress tests failing on Linux Intel OpenGL
...
Change-Id: I735d88c3f98876852bfe8a3480efb7f64a90f747
Bug: dawn:976
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57600
Auto-Submit: Brandon Jones <bajones@chromium.org >
Reviewed-by: James Price <jrprice@google.com >
Commit-Queue: Brandon Jones <bajones@chromium.org >
2021-07-09 22:30:19 +00:00
Ben Clayton
9569e2c790
writer/msl: Emit helper functions for atomicCompareExchangeWeak
...
By generating a helper function for these, we can keep the atomic expression pre-statement-free. This can help prevent for-loops from being transformed into while loops.
Change-Id: Id034ea5ea9be601661ddb78db973015d845c420f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57463
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Auto-Submit: Ben Clayton <bclayton@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-07-09 20:21:49 +00:00
Dawn Autoroller
5a187dcbbc
Roll Tint from 1843c0b8d7 to e027e81bf2 (2 revisions)
...
https://dawn.googlesource.com/tint.git/+log/1843c0b8d7ab..e027e81bf27d
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC bajones@google.com on the revert to ensure that a human
is aware of the problem.
To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Bug: None
Tbr: bajones@google.com
Change-Id: I759e9e76a0df366a3b95904e62acacc852b720bc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57620
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com >
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com >
2021-07-09 19:50:48 +00:00
Sarah
659bcbeacf
validation: organize validate type constructor unittests
...
Bug: tint:968
Change-Id: I71d6ea78f470062208513fc81ae9830da76d697d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57580
Auto-Submit: Sarah Mashayekhi <sarahmashay@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-07-09 19:19:29 +00:00
Ben Clayton
e027e81bf2
writer/hlsl: Emit helper functions for storage class atomic intrinsics
...
By generating a helper function for these, we can keep the atomic expression pre-statement-free. This can help prevent for-loops from being transformed into while loops, which can upset FXC.
We can't do the same for workgroup storage atomics, as the InterlockedXXX() methods have the workgroup-storage expression as the first argument, and I'm not aware of any way to make a user-declared parameter be `groupshared`.
Change-Id: I8669127a58dc9cae95ce316523029064b5c9b5fa
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57462
Commit-Queue: James Price <jrprice@google.com >
Auto-Submit: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-07-09 16:50:14 +00:00
Sarah
e28591101c
validation: validate struct constructor
...
Bug: tint:864
Change-Id: I57db071bcda96d45f758bcdbc47c6ef0a4a8192d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57280
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-07-09 16:32:00 +00:00
Dawn Autoroller
36cb8b3797
Roll Tint from 3d9f0e99c2 to 1843c0b8d7 (1 revision)
...
https://dawn.googlesource.com/tint.git/+log/3d9f0e99c253..1843c0b8d7ab
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC bajones@google.com on the revert to ensure that a human
is aware of the problem.
To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Bug: None
Tbr: bajones@google.com
Change-Id: Ic1633b9fd459a11a353d9a5ae34a46f468c217f7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57560
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com >
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com >
2021-07-09 13:51:17 +00:00
Ben Clayton
1843c0b8d7
[writer/hlsl]: Fix order of atomic method arguments.
...
Change-Id: Ice1b07c748bc6502a51b29690dfc00466a684c12
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57461
Auto-Submit: Ben Clayton <bclayton@google.com >
Commit-Queue: James Price <jrprice@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-07-09 12:35:54 +00:00
Yunchao He
9749f5a9f5
Move a function to TextureFormatUtils.h|.cpp and rename these two util files
...
This change moves function ViewDimensionToTextureDimension() to
TextureFormatUtils.h|.cpp.
This change also renames TextureFormatUtils.h|.cpp to TextureUtils.h|.cpp
because the new name makes more sense now.
Bug: dawn:547
Change-Id: I183c68d26365a6cda722be55b8ba3556c1b4c82b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57482
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com >
Reviewed-by: Austin Eng <enga@chromium.org >
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com >
2021-07-09 02:47:49 +00:00
Yunchao He
3185d9ce1f
Implement 3D texture read/write via storage usage on D3D12
...
The main part of this change is to add a few end2end tests, with
some renaming stuff like arrayLayerCount to sliceCount in order to
include both 2DArray and 3D textures.
The implementation is quite simple: just set UAV descriptor on D3D12.
The new tests can pass on Vulkan and Metal, which indicates the
implementation has been done on them.
The new tests fail on OpenGL and OpenGLES. I will take a look and
submit separate patch for GL and GLES.
Bug: dawn:547
Change-Id: Ic03eab6b06654c48341c935f64f4885be544985c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57160
Commit-Queue: Yunchao He <yunchao.he@intel.com >
Reviewed-by: Austin Eng <enga@chromium.org >
2021-07-08 23:33:37 +00:00
Dawn Autoroller
c5aae6e095
Roll Tint from 5d922d02fc to 3d9f0e99c2 (7 revisions)
...
https://dawn.googlesource.com/tint.git/+log/5d922d02fc65..3d9f0e99c253
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC bajones@google.com on the revert to ensure that a human
is aware of the problem.
To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Bug: None
Tbr: bajones@google.com
Change-Id: Ifdc642100e35b1ad3861faf3488a91c0a2bf0feb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57481
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com >
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com >
2021-07-08 23:16:28 +00:00
shrekshao
6e680fc56f
MapAsync update: keep read/write handle through lifetime of mappable buffers
...
Change dawn read/write handle for buffer mapping to be created at buffer
creation time instead of at mapAsync time. Update related buffer mapping
tests and wire tests.
Bug: dawn:773
Change-Id: I7dd423c94e1bc15cfe561ea33ec9e348ddf2bfe0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51164
Reviewed-by: Austin Eng <enga@chromium.org >
Commit-Queue: Shrek Shao <shrekshao@google.com >
2021-07-08 22:48:57 +00:00
James Price
15838b98af
Switch to new Tint generator API
...
Tint now has a single-function API for code generation that
automatically runs the backend-specific sanitizer transforms. This API
allows for backend-specific configuration options such as the fixed
sample mask for MSL (and, in the future, information about which
compiler/version is being targeted), and returns any backend-specific
metadata such as whether a UBO of buffer sizes is required by the
shader.
This change prevents the post-sanitizer program from being exposed to
Dawn, which is a potential foot-gun (e.g. the Inspector is not
expected to be run after the sanitizer transforms, and Dawn is
currently doing this).
The old Generator class API will be removed from Tint shortly after
landing this change.
Bug: tint:697
Change-Id: I9b988d55514f810d3091ec6471731e6eb41dc27f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57103
Auto-Submit: James Price <jrprice@google.com >
Reviewed-by: Austin Eng <enga@chromium.org >
Commit-Queue: Austin Eng <enga@chromium.org >
2021-07-08 22:35:27 +00:00
Ryan Harrison
3d9f0e99c2
[fuzzers] Add checks that bad SPIRV isn't getting through
...
BUG=tint:963
Change-Id: I3cac636c194a36581f372ee22acad36d5e94eb07
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57500
Auto-Submit: Ryan Harrison <rharrison@chromium.org >
Commit-Queue: Ryan Harrison <rharrison@chromium.org >
Kokoro: Ryan Harrison <rharrison@chromium.org >
Reviewed-by: James Price <jrprice@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-07-08 22:11:09 +00:00
Ben Clayton
1b03f0a07a
reader/wgsl: Generate ForLoopStatements
...
Instead of LoopStatements.
Update the writers to handle these.
Fixed: tint:952
Change-Id: Ibef66e133224810efc28c224d910b5e21f71f8d6
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57203
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-07-08 21:23:33 +00:00
Ben Clayton
03c8393213
[writer/msl]: Implement modf and frexp
...
And remove the u32 overload of frexp (it's not in the spec).
Brings the number of failing tint end to end tests for MSL down to 19/1098.
The WG still haven't found consensus on reworking these two intrinsics.
It's very likely that their signature will change so that they return a structure instead of returning a value and outputing another as a pointer.
Until the WG makes a decision, let's implement these according to the current spec.
Some overloads are still failing due to MSL missing overloads of the pointer parameter being in the `threadgroup` address space.
I'm holding off fixing these until we know what's happening with these intrinsics.
See also:
https://github.com/gpuweb/gpuweb/issues/1480
https://github.com/gpuweb/gpuweb/issues/1846
Change-Id: Ib6764e6659d840db41bc65fed2b8b283d1056c3d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57421
Commit-Queue: Ben Clayton <bclayton@chromium.org >
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Ben Clayton <bclayton@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-07-08 21:21:27 +00:00
Ben Clayton
e4fd4a2ecd
test/intrinsics/gen: Use '0' for level parameters
...
The level parameter needs to be zero for a number of texture overloads.
Bodging the template to emit 0 instead of 1 for any `level : i32` parameter is the easiest fix here.
Change-Id: I69222578efcd0d4f4f267fb59fec691b52786d9c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57301
Auto-Submit: Ben Clayton <bclayton@google.com >
Reviewed-by: James Price <jrprice@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Ben Clayton <bclayton@google.com >
2021-07-08 21:04:53 +00:00
Brandon Jones
79fae01483
Remove texture_external overload for textureSample
...
Removes the unneeded texture_external overload of textureSample from
intrinsics.def.
Bug: tint:858
Change-Id: I49935bae47542af7b440c74c96418e005daf9e19
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/53940
Reviewed-by: Ben Clayton <bclayton@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Ben Clayton <bclayton@google.com >
2021-07-08 20:58:18 +00:00
Ben Clayton
54cfa0b9a1
[tools]: Add remote-compile
...
A tool for compiling shaders on a remote machine.
Helpful for combining with `test-all`, so that a single non-windows
machine can validate SPIR-V, MSL and HLSL.
Change-Id: I3a0f70e6e4edd13952eb5dc72fbbed7c495036ee
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56940
Auto-Submit: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Antonio Maiorano <amaiorano@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
2021-07-08 19:35:53 +00:00
Austin Eng
31930e7287
Enable use_tint_generator by default, disable shader_float16
...
Float16 is not standardized in WGSL or implemented in Tint,
so remove support of the extension for now.
Bug: dawn:571, dawn:426
Change-Id: Ia26f0ddb07cabf6057c0d7db9ade547494d2cc6e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56441
Reviewed-by: Austin Eng <enga@chromium.org >
Commit-Queue: Austin Eng <enga@chromium.org >
2021-07-08 18:42:37 +00:00
Alastair Donaldson
d09317c0b5
Generate shader corpora for fuzzers
...
Adds scripts that generated corpora of WGSL and SPIR-V shaders for
the tint fuzzers, from test cases in the repository.
Fixed: tint:966
Change-Id: I7e86ef5e34676d0c4f5b7e413a5c0f444fca08ff
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57204
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
Reviewed-by: Ryan Harrison <rharrison@chromium.org >
Commit-Queue: Alastair Donaldson <afdx@google.com >
2021-07-08 18:33:33 +00:00
Dawn Autoroller
48de25e52a
Roll Tint from ea1a4680d4 to 5d922d02fc (11 revisions)
...
https://dawn.googlesource.com/tint.git/+log/ea1a4680d490..5d922d02fc65
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC bajones@google.com on the revert to ensure that a human
is aware of the problem.
To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Bug: None
Tbr: bajones@google.com
Change-Id: I4f19e64e3abd096e704cfdafe4e361e725f03202
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57520
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com >
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com >
2021-07-08 18:24:27 +00:00
Ben Clayton
5d922d02fc
Revert "writer/hlsl: Special case negative zero"
...
This reverts commit 26b6edc545 .
Reason for revert: Seems to be breaking Dawn's tests. Investigation required.
Original change's description:
> writer/hlsl: Special case negative zero
>
> Fixed: tint:960
> Change-Id: I060bc6b7a9ad4d21dd5cadb4b68998c7e54ebaed
> Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57142
> Kokoro: Kokoro <noreply+kokoro@google.com >
> Commit-Queue: Ben Clayton <bclayton@google.com >
> Auto-Submit: Ben Clayton <bclayton@google.com >
> Reviewed-by: James Price <jrprice@google.com >
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Ia0b0ec996f2ed6b1599a344c970f155c12314ea9
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57460
Reviewed-by: Ben Clayton <bclayton@google.com >
Reviewed-by: James Price <jrprice@google.com >
Kokoro: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: James Price <jrprice@google.com >
2021-07-08 16:49:33 +00:00
James Price
af89c729ed
writer: Move sanitizers into the backends
...
Adds a new single-function API for the generators, which applies the
sanitizing transform and performs the generation in one step, and
returns a result object which contains the generated code and success
status/diagnostics.
The new APIs take an `Option` structure to control backend-specific
generation details (e.g. MSL fixed sample mask). The result objects
also provide backend-specific feedback (e.g. whether a UBO of buffer
lengths was generated).
HLSL needs a list of entry points to validate, and it's the HLSL
sanitizer that generates an entry point for programs that do not have
one. This change makes the HLSL generator return the list of
post-sanitize entry points so that the Tint executable can forward
them to the validation code.
Change-Id: I2d5aa27fda95d7c50c5bef41e206aee38f2fd2eb
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57101
Auto-Submit: James Price <jrprice@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: James Price <jrprice@google.com >
Reviewed-by: Ben Clayton <bclayton@chromium.org >
2021-07-08 16:00:23 +00:00
Ben Clayton
08b0ab9b92
resolver: Fix build. Enum member was renamed.
...
Change-Id: Iecbdd554ad60160df04be4bf3581387cb5639e6c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57420
Auto-Submit: Ben Clayton <bclayton@google.com >
Reviewed-by: James Price <jrprice@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Ben Clayton <bclayton@google.com >
2021-07-08 15:12:36 +00:00