Remove transform::Glsl and replace with a Sanitize function. Cleans up
the code, reduces allocations and copies, and makes it consistent with
the other backends.
Also add a copy of src/tint/.clang-format to include/tint/ to keep files
in there formatted as per the tint standard.
Bug: tint:1495
Change-Id: I8a44ffecc6b3d244517bceb374ed93063e96f218
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86205
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro-Run: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Also opportunistically optimize out the copying of the spir-v result
vector by moving it instead.
Bug: tint:1495
Change-Id: Ia2c3b3c09e7a23822eb8a782ce57b1fa11a0b54d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86204
Reviewed-by: David Neto <dneto@google.com>
Kokoro-Run: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Wrap `napi.h` with a Dawn header that defines `NAPI_DISABLE_CPP_EXCEPTIONS`, and then includes the napi.h header.
Required now that CMake correctly disables exceptions with `-fno-exceptions`.
Change-Id: If31b28d331f2071a0119339c60cc3ab8ab801a98
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86301
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Roll CTS to dcba3ac6b819abb0920e589ca1809ae5b5f87119
Update ts_sources.txt
Regenerate expectations
Change-Id: Ifa0cae3fa1abf9da9e4fbd63acf9cefe2683f50d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85560
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
This CL enables the build/header_guard lint check. The existing headers
which failed the check were updated, missing headers added. An exclusion
file for the generator templates was added as well.
Bug: dawn:1339
Change-Id: If572e460179ad501293d5d6cf01e0ea900daa979
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86207
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Change-Id: I19324ccbf989a66c088f8886411f050820b46d5b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86306
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reduces the amount of variable duplication and copying we do.
Bug: tint:1495
Change-Id: I7999eadf09dc899361926e01dea715e9edc124c9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86203
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This CL adds the node-addon-api prefix to the napi.h includes. This
required updating the cmake files to have the dawn_third_party_dir as
part of their includes.
Bug: dawn:1339
Change-Id: I56d9f04462d040f6ed236fcef3c4cd85a9144d7f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86241
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This CL updates the one instance of an empty if body in Dawn to
remove the if. This allows enabling the empty_if_body lint check.
Change-Id: I5c05db828e8033b4f3155a34c3a6723bfd3181d6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86082
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Fixed Kokoro failures when building Tint with all readers and writers
disabled.
Change-Id: I9bd041339236488dd563bbe687da883035f2a4b7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86181
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This CL updates the SampleUtils file to use the full path to the header.
This required adding the root path into the include directories for the
sample utils project in CMake.
Bug: dawn:1339
Change-Id: If6abb18a2eefa19ee56b6f889080da67f4a953e3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86211
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Style guide has been updated to describe the style in use.
Change-Id: I3fc08e3440566106582695f4dc149fa67d8b8dc8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86303
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
This CL removes some trailing ;'s which aren't needed to enables the
readability/braces warning.
Bug: dawn:1339
Change-Id: I776267b4282b1345e6b4258d1aff3d7de9fecb8a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86210
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
This CL changes the single `sprintf` to an `snprintf` which allows the
runtime/printf lint check to be enabled.
Change-Id: Ieed654a8d5f23250e4bc8ee07001489a060f8dc5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86084
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
This CL fixes up a few include issues in the dawn folder allowing the
build/include lint rule to be enabled.
Bug: dawn:1339
Change-Id: I585c0b6a7e9c1f8bff466ea8c3765e2a1486e79c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86240
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
This CL moves the filters out of the PRESUBMIT.py file and into specific
folder CPPLINT.cfg files. This allows having all the lints enabled in
the Tint code and specifically disabling in Dawn code as needed.
Bug: dawn:1339
Change-Id: Ieb0178b0aac0ea67c52cc5547984ea5696eef5a4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86208
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This CL combines the two contributing files from the merge into a single
file in CONTRIBUTING.md.
BUG=dawn:1356
Change-Id: I863f008f2f842222900b312ce9cc6382d82a32ce
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86206
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This is obviously a non-optimal solution, but works in all cases
except compressed textures.
Change-Id: I3fd5fd89ef4978a18917b068632f25f75527c594
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84160
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephen White <senorblanco@google.com>
- Adds dependency to vulkan-tools for pNext chain helpers.
- Adds extra caching to vulkan shaders to keep the spirv in the in-memory cache as well.
- Adds pNext chain serializer infra for Vulkan.
Change-Id: Ibe73183fbff15f7310eaaeae92fbd622be1ac096
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85022
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
In our backends, we std::move this unordered_set into the Results
struct, but because we'd get a const reference to a const object,
std::move would cast this to a const r-value, which binds to const ref,
and thus would end up copying instead of moving. This change just
ensures that we get a non-const ref to a non-const unordered_set where
we do the move.
Bug: tint:1495
Change-Id: I8d1cfe66b8343bae4146fc85fc86d72bac41a1a1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86202
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This CL fixes a few tabs to be spaces which makes the whitespace/comments
lint check pass. The check is set to enabled.
Change-Id: I2a6c590aa3bfee888239adc89d1ce4c8c99f3e78
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86083
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
When splitting WGSL source lines, detect and split along CRLF, not just
LF. Before this fix, when emitting error diagnostics on Windows, we'd
emit the CR at the end. Not normally a big deal, but it made our e2e
tests fail when the source WGSL had CRLFs in it: when comparing against
expected files, even though we'd replace CRLF with LF, we'd fail the
comparison because the actual output would contain CRCRLFs.
Change-Id: I360e0d4cd0f29ff76938ff32d7cb84e45feda2b0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86201
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
The sanitizer flags need to be applied to all compilation units, and to all final link stages.
As this is whole-project (dawn + tint), these options have been promoted to DAWN_ options.
Bug: dawn:1339
Change-Id: I17beb5bd2a8f15de9d8f13d132356b5c663d71bf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86143
Kokoro-Run: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
And force shader code to always use LF endings.
Post merge, there were a number of files that crept in with CRLF endings.
Some Tint end-to-end tests take objection to CRLF endings.
CRLF endings can be detected with:
```
git grep -I --files-with-matches --perl-regexp '\r' HEAD
```
And fixed with:
```
find . -type f -exec dos2unix {} \;
```
Bug: dawn:1339
Change-Id: Iee054bafd15875de744b86e28393cd8229bd3cfa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86140
Kokoro-Run: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Dawn depends on GLFW, which in turn depends on a number of system
dependencies to be installed. These are not part of the docker image, so
need to be installed on the fly.
Also disable the Kokoro doxygen step as this is still being worked on.
Bug: dawn:1339
Bug: dawn:1358
Bug: tint:1498
Change-Id: I1a33044d11c243fc3809c2b5b4d25f0bfc943d6e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86071
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This CL updates the list of lint filters in order to allow the lint
presubmit check to pass. This allows each of the individual exclusions
to be fixed or ignored independently.
Issue: dawn:1339
Change-Id: Ia96a38c54508628996ca1e19555c01b11776c07f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86045
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Also changes enums to use the concept of "limit class" from the WebGPU
specification.
Fixed: dawn:1242
Change-Id: I328ce98c2eaaf3f4b7ff1c253ee5f3db5a2980f5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84762
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Tint's contributing documentation end up in the top-level
CONTRIBUTING.md, but should live in its project specific
documentation.
BUG=dawn:1356
Change-Id: I64d8a10d11e11922756c9d7bb02678f4bf92442b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86100
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Kokoro-Run: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
There's an implict dependency between including protobug and SPIR-V tools, as SPIR-V tools needs to know where protobuf lives.
Bug: dawn:1339
Change-Id: I22a95e44af5ae1cc39a9c3400bd319d86e434967
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86070
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>