Commit Graph

6359 Commits

Author SHA1 Message Date
James Price aacad7c65e tint: Update FirstIndexOffsetTest expected results
The change in https://dawn-review.googlesource.com/c/dawn/+/84240
modified the code generated by this transform, but didn't update the
Tint unit tests (which are not yet being run on Dawn's CQ).

Change-Id: I32d097d052f01628c3f8f5520c900b83422707e3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87605
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-04-21 20:52:36 +00:00
dan sinclair a2e94a5ac3 Fix readability/todo issues.
This CL adds names to the TODOs which did not have them and enables
the readability/todo lint. The names are based on the git blame for
the TODO lines.

Bug: dawn:1339
Change-Id: I25a2920bc8fa9606f5dda67a629fdef1c10f8948
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87600
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-21 20:48:11 +00:00
dan sinclair b0acbd436d Fix build/namespaces issues
This CL fixes up various build/namespaces lint errors and enables
the lint check.

Bug: dawn:1339
Change-Id: Ib2edd0019cb010e2c6226abce6cfee50a0b4b763
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87482
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-21 16:46:56 +00:00
Brandon Jones 6cb57a9847 Change External Texture YUV-to-RGB Conversion to Use Matrix
Changes Dawn and Tint to use a 3x3 matrix for external texture
YUV-to-RGB conversions. This will allow us to use standard matrices
as they exist in SkYuvMath.

Bugs: dawn::1082
Change-Id: I8e0c7c3dc1c085d8f336da956aea9496913b70fa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86847
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
2022-04-21 16:02:36 +00:00
dan sinclair f05575bb21 [tint] Move validation code into a Validator class.
This CL moves the Validate methods from the Resolver into a specific
Validator class used by the Resolver.

Bug: tint:1313
Change-Id: Ida21a0cc65f2679739c8499de7065ff8b58c4efc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87150
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-21 13:40:16 +00:00
Loko Kung 4091e0fa9c Factor out common cache testing code.
- To be used for pipeline cache testing.
- Plumbs overriding the platform to the adapters for testing.
- Restructures build a little bit so that the test infrastructure can have full access to dawn native internals. Also differentiates end2end and white_box a bit more to make it clear that end2end should not have access to dawn native internals.

Bug: dawn:549, dawn:1374
Change-Id: Ibcc6c44a116c7967ee2317c74409f613e896eb0a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86841
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-04-21 03:14:37 +00:00
Enrico Galli 45ec7c3528 D3D12: Duplicate first/baseVertex on Draw[Indexed]Indirect
Adds support for non-zero first/baseVertex on Draw[Indexed]Indirect by
duplicating the first/baseVertex indirect parameter onto a root
constant in the indirect buffer.

Change-Id: I280149065179806d3e57b07f1a396f9e2e4e8fcb
Bug: dawn:548
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84240
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Enrico Galli <enrico.galli@intel.com>
Auto-Submit: Enrico Galli <enrico.galli@intel.com>
2022-04-21 02:25:35 +00:00
Loko Kung cf078766c2 Adds typing to cache keys to avoid clashes.
Bug: dawn:549
Change-Id: Ic3c737e62ae3bfcd1b20d923373a66f380d96149
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86401
Reviewed-by: Shrek Shao <shrekshao@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-04-21 02:04:57 +00:00
Loko Kung 6d9b322958 Adds new BlobCache "re-declaration" of PersistentCache.
- Note: goal is to merge the two into the same class, but to avoid breaking/fixing the current D3D12 shader caching, introducing a new one, and will merge the old one later on.
- Adds instance of BlobCache to the Instance, and passthrough for the Device to get to it. (We want the cache to be at the Instance so that eventually different devices can still use the cache (assuming same isolation key)).

Bug: dawn:549
Change-Id: Ib7c82a439f32b306f0cccd3db424fb0e427a90a1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86400
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-04-20 23:56:25 +00:00
Austin Eng 775fee6b6a Check GLFW window creation before discovering GL adapters
GLFW window creation can fail. If so, we should not attempt to
make the context current and create adapters on it.

Bug: dawn:1375
Change-Id: Ie1a94a42d1f56514b41a715add7a2b4eebb763f0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87460
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-04-20 20:56:15 +00:00
dan sinclair 4c9b72b4fa Fixup readability/casting lint issues
This CL fixes a few readability/casting issues and enables the lint
check.

Bug: dawn:1339
Change-Id: Ib0d127c3e01fad9b5ac074d8ca09f3a1956ad4fc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87020
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-20 19:02:29 +00:00
dan sinclair 3e0547df6c Ignore remaining explicit warnings.
This CL ignores the remaining explicit warnings and enables the lint
flag.

Bug: dawn:1339
Change-Id: Idabc062c3d1a7ec563115dbfd600e80a908c856d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86873
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-20 18:24:15 +00:00
dan sinclair e22487f18c Ignore BindingLayoutEntryInitializationHelper for runtime/explicit.
This CL ignores runtime/explicit on BindingLayoutEntryInitializationHelper.

Bug: dawn:1339
Change-Id: I3b4554387138ea77648be7a1e4f714f269996acc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86643
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
2022-04-20 16:27:35 +00:00
Yunchao He 803f033392 D3D12: work around buffer size insufficient issue for copy
D3D12 requires more buffer storage than it should. If the buffer used
for B2T/T2B copy is big enough according to WebGPU spec but it doesn't
meet D3D12's requirement, we need to workaround it via split the copy
into two copies, in order to make B2T/T2B copy being done correctly on
D3D12.

Bug: dawn:1289, dawn:1278

Change-Id: Id88c580dce00553845817677a2d356690ef4acfe
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86860
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
2022-04-20 16:18:05 +00:00
Jiawei Shao 93a2bed032 Only allow creating 2D textures with RenderAttachment usage
BUG=dawn:1364
TEST=dawn_unittests

Change-Id: I49cdeeac8b951c3715211fc3b3b71934a19a6e64
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86622
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2022-04-20 04:01:39 +00:00
dan sinclair 09ce76b0d5 Fix runtime/int issues.
This CL fixes up various runtime/int types to be more specific.

Bug: dawn:1339
Change-Id: I61c8ecc89abd0373173b95bfb594c75d05a5d505
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86865
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
2022-04-20 02:05:24 +00:00
dan sinclair 36af06343c Fixup readability/namespace issues.
This CL fixes a few readability/namespace issues and suppresses one
which is in conflict with the current formatting rules.

Bug: dawn:1339
Change-Id: Ifb688b05d50ebc3e698a77700178f87c93b14a46
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86867
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
2022-04-20 01:54:25 +00:00
James Price b6f4c59845 tint: Fix Matrix::FriendlyName() for inferred type
The type field may be nullptr when a matrix constructor is used with
an inferred element type.

Change-Id: Ic11ba6a8efbed2a641c8a5ad3bbf0d074e4ca973
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87280
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
Auto-Submit: James Price <jrprice@google.com>
2022-04-20 01:30:25 +00:00
dan sinclair 13e9699b1c Fix build/include_what_you_use
This CL adds the needed headers to pass the include what you use lint
check.

Bug: dawn:1339
Change-Id: Ib8df68e51b2c3711169b400e84768d4804568580
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86941
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
2022-04-20 00:58:34 +00:00
dan sinclair 4d6dfd5597 Convert LogMessage to explicit.
This CL adds explicit and fixes up the various call sites for the
LogMessage class.

Bug: dawn:1339
Change-Id: Id244d0e31929d31346af48e116a40e7079a50372
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86872
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-20 00:36:54 +00:00
dan sinclair 649687497f Convert SerialStorage::Iterator over to being explicit.
This CL adds the attribute and fixes up the call sites to work with the
constructors being explicit.

Bug: dawn:1339
Change-Id: Ic584477c064411e42143dfc6179bbddb0d6a69c4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86871
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-19 23:15:14 +00:00
dan sinclair fb5a492787 Fix inclusive language presubmit
The current presubmit has the filter inverted so it would only attempt
to match the filtered files. The file name also has to be converted to
`LocalPath` otherwise it's attempting to compare a python object to a
string and always fails to match.

Bug: dawn:1339
Change-Id: Ie7712dee60f6b9df2cb78c9feab11769f7ea1f02
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87080
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
2022-04-19 22:25:45 +00:00
Yunchao He 8f28d21176 Add more tests to RequiredBufferSizeInCopyTests
The new tests reveal that this incorrect calculation of buffer size
requirement on D3D12 exist only when:
  - the texture dimension is 3D, and
  - there are rowsPerImage paddings (imageLayout.rowsPerImage >
  copySize.height), and
  - it's copying multiple depth images (copySize.depthOrArrayLayers > 1).

The new tests can guide and narrow down the workaround for this issue.

Bug: dawn:1289
Change-Id: I4136d6e3aa3680a65739bfdd402dc0d46debfd8d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87162
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
2022-04-19 21:57:45 +00:00
dan sinclair b3741f5036 Add missing doc comment.
This CL should fix the doxygen error on kokoro.

Change-Id: I820e6e6674edbc1af2b51ceb3cf87d724d7c0962
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87300
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-19 21:40:05 +00:00
Austin Eng 89d6a1f376 Add D3D12 UAV barriers between multiple storage texture usages
Fixed: dawn:1370
Change-Id: I395b3e6e2506608ca4aefdbcef18443b90ca75ea
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87302
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-04-19 20:51:40 +00:00
dan sinclair b02535557e Fixup build/include_order issues in src/dawn.
This Cl moves the cpp includes to above the project includes fixing up
the build/include_order issues and enabling the lint check.

A couple includes are marked as NOLINT as the c header has to come after
the project header due to setting defines.

Bug: dawn:1339
Change-Id: Ia47499c94fff99106397b83f6c5c7fe100c44a0e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86513
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-19 20:38:44 +00:00
dan sinclair ebdb70b81d Make RingBufferAllocator explicit.
This CL makes RingBufferAllocator explicit and fixes up the two call
sites.

Bug: dawn:1339
Change-Id: I8e6fe4f41a2031fafaaa281255ee242331c24306
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86870
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
2022-04-19 20:26:34 +00:00
Austin Eng 37200bd0be Revert "Speculatively suppress RequiredBufferSizeInCopyTests on Win Intel x86"
This reverts commit 3199179167.

Reason for revert: Suppressing these tests didn't help flakes at all.

Original change's description:
> Speculatively suppress RequiredBufferSizeInCopyTests on Win Intel x86
>
> Bug: dawn:1375
> Change-Id: Ieb218fc90e93734f2ccaacaf9a0dd22c57d93163
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86866
> Reviewed-by: Loko Kung <lokokung@google.com>
> Commit-Queue: Austin Eng <enga@chromium.org>
> Kokoro: Kokoro <noreply+kokoro@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: dawn:1375
Change-Id: I3b725340516e25b0c8bffb8b817c86278645aba8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87320
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-04-19 17:06:54 +00:00
dan sinclair bb62ef0d2c [tint] Split sem methods to a helper.
This CL moves the various sem methods in the resolver to a helper class.

Bug: tint:1313
Change-Id: I1f5e77a7864935d44d327b2b8462f931d46977ca
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87149
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-19 15:00:44 +00:00
dan sinclair d58820a330 Convert node bindings over to use explicit.
This CL adds explicit annotations to the single argument constructors in
the node binding code.

Bug: dawn:1339
Change-Id: I428c8e485bc3d6230c3cf7d61c2146d5ec977abf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86644
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
2022-04-19 14:57:54 +00:00
dan sinclair f0469eb65a Update tools/format
This Cl updates tools/format to match the various Dawn extensions and to
use the `clang_format.py` file from depot_tools instead of the one from
clang. This fixes up some formatting differences so `tools/format` will
now match `git cl format`.

Bug: dawn:1339
Change-Id: I32a2cdbd2d7e950794268616fae38b5bf54ab370
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86874
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-19 14:44:14 +00:00
dan sinclair f80a759897 Suppress one threadsafe_fn error and enable lint.
This CL suppresses the threadsafe_fn lint in the sample code and enables
the lint check.

Bug: dawn:1339
Change-Id: I51f6808b894ba1fcb7f3cdbbc274b35cd393dae8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86864
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
2022-04-19 14:27:15 +00:00
dan sinclair d0fb4a36ac Convert all dawn includes to use non-system include syntax.
This CL changes several includes which were using the system include
syntax to the local syntax. This causes GN check to verify that the
headers are specified correctly in the dependencies.

Two missing dependencies are added to the BUILD.gn file for the
Dawn tests.

Bug: dawn:1373
Change-Id: I7afd5ab48f4f2e2ddaf1839058c6bbeec2b97fd0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86940
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
2022-04-19 14:24:04 +00:00
dan sinclair 9aa4b11281 Add explicit to D3D12 specific files.
This CL updates the d3d12 files to add explicit to single parameter
constructors.

Bug: dawn:1339
Change-Id: I7896fa37a5eed90fb4184951bd4d823f96d8e88b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86642
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
2022-04-19 14:02:15 +00:00
dan sinclair a1f13f8bad [tint] Make most Validate methods const.
This CL makes all the validation methods const except for
ValidateSwitch.

Bug: tint:1313
Change-Id: I19ce7beae5ab4591d525dad4dca45f03dd4733b3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87148
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-19 13:53:36 +00:00
dan sinclair b92f31bf53 Fixup whitespace lint issues.
This CL fixes a few blank_line, todo, and comment whitespace errors.

Bug: dawn:1339
Change-Id: Iba524396c2fb6750503cbf18e830dac3257beada
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86960
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-04-19 09:04:44 +00:00
dan sinclair d1b9d5cc4f Fixup runtime/arrays issue.
This CL converts a variable-length array into a std::array and enables
the runtime/arrays lint check.

Bug: dawn:1339
Change-Id: Ib71828dab84c1651655494108d9fd11922b84e81
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86868
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-04-19 08:44:05 +00:00
dan sinclair 3878a30828 Fix runtime/printf lint
This Cl changes a hardcoded 4 to sizeof(buf) and re-enables the
runtime/printf lint.

Bug: dawn:1339
Change-Id: Iaeeab2bc0d500c1aa8085352e7b26febb810bd4e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86863
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-04-19 08:42:58 +00:00
dan sinclair cccadddcb0 Add explicit to test files.
This CL updates the test files to have explicit added for single
parameter constructors and removed from zero parameter constructors.

Bug: dawn:1339
Change-Id: I21339148bba5e7e89debc38ec426ba15e0d734e2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87021
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-04-19 08:28:34 +00:00
dan sinclair 92bef59295 Fixup readability/check issues.
This CL fixes a few readability/check issues and enables the lint.

Bug: dawn:1339
Change-Id: I09950e8c3822d77a4ddaea6629b35b8fed4232cc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86869
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-04-19 07:32:44 +00:00
dan sinclair 0c3e5a0813 [tint] Pass the valid layout storage into ValidateStorageClassLayouts
This CL changes ValidateStorageClassLayouts to take the
valid_type_storage_layouts_ as a parameter instead of accessing
directly.

Bug: tint:1313
Change-Id: I2eade6abd9b0acf3d8937c08b0453682be8864fa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87147
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-19 04:26:24 +00:00
dan sinclair d431eb9d94 [tint] Move potential type creation out of ValidateReturn.
This CL moves the possible call to create the return type out of the
ValidateReturn and into the call. The type is then passed into the
ValidateReturn method.

Bug: tint:1313
Change-Id: I5d2e78b945fc47a14072f503d0478a7da051137d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87146
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-19 03:38:26 +00:00
dan sinclair 5d4cac1da1 [tint] Remove current_function from ValidateReturn.
The current_function was used to retrieve the functions return type.
Pass it in directly instead of using current_function.

Bug: tint:1313
Change-Id: Ie29407aecc51e8453460f46437b5c011088c3749
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87145
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-19 03:26:34 +00:00
dan sinclair 8c67fec731 [tint] Remove current_function from ValidateFunction.
The ValidateFunction method just required the current pipeline stage.
Provide the stage directly instead of using current_function.

Bug: tint:1313
Change-Id: I0c12bef4b28b9cecfbd2b9d7d336a8ff3f8c3a77
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87144
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-19 03:24:24 +00:00
dan sinclair d382e20b00 [tint] Remove current_function from ValidateStructure.
The ValidateStructure method only required the current pipeline stage.
Pass that in directly instead of depending on current_function_.

Bug: tint:1313
Change-Id: I13a429aa9d77c8c43fb82d2aa02b25e05b0e3a6c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87143
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-19 02:32:55 +00:00
dan sinclair 3dbeb8b7a5 [tint] Remove current_function from ValidateEntryPoint.
The ValidateEntryPoint only needs the current functions pipeline stage.
Pass that in instead of using current_function_.

Bug: tint:1313
Change-Id: I7b08997f6c4940a614a75fc905ba923c0686bfc4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87142
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-19 01:59:54 +00:00
dan sinclair 98b19374b4 [tint] Remove current_function_ from ValidateBuiltinAttribute.
The ValidateBuiltinAttribute function just needs the current functions
pipeline stage, pass that in intead of using current_function_.

Bug: tint:1313
Change-Id: Ie58b46e6115ee46bb0b86e53786cf17861cf7d4e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87141
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-19 01:54:44 +00:00
dan sinclair 94c2c2d44c [tint] Remove current_function_ usage from ValidateLocationAttribute.
The ValidateLocationAttribute function needs to know the stage of the
current function so, pass that in instead of accessing current_function_
directly.

Bug: tint:1313
Change-Id: Ifa0ac912f5e78f14b6512fd74ae951545abd9b22
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87140
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-19 00:31:17 +00:00
Shaobo e4c799071b Add Debug Tracing in Dawn
Add more trace event in Dawn to better understand workflow in Dawn.
These trace events focus on tick() and MapAsync() related in flight
task.

Bug: dawn:1335
Change-Id: Iac35959f315c221c8539137efbf35039458a6f77
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86620
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
2022-04-19 00:25:34 +00:00
Aleksi Sapon baeed1f72c Fix integer truncation bug
On Apple M1, maxStorageBufferBindingSize has all 0 in the lower 32 bits,
which was resulting in a value of 0 and causing an internal error.

Bug: dawn:1367
Change-Id: I00719051738f1ad87989dae0ddd96f1ddf325dab
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87180
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-04-18 22:18:05 +00:00
Brandon Jones c6be53e172 Revert "Enable gn check for all build targets."
This reverts commit 61bc38fd52.

Reason for revert: Appears to have broken the Dawn->Chromium autoroller, which is now seeing Abseil linking issues on Mac and Linux.

Example failing roll: https://chromium-review.googlesource.com/c/chromium/src/+/3590451/

Example error log: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket/8816532799903001889/+/u/compile__with_patch_/stdout

Log Excerpt:
[802/31819] LINK ./dawn_unittests
FAILED: dawn_unittests 
TOOL_VERSION=1650247560 ../../build/toolchain/apple/linker_driver.py -Wcrl,strippath,../../build/mac_files/xcode_binaries/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -Wcrl,installnametoolpath,../../build/mac_files/xcode_binaries/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool ../../third_party/llvm-build/Release+Asserts/bin/clang++  -Werror -fuse-ld=lld -Wl,-fatal_warnings -Wl,--color-diagnostics -arch x86_64 -no-canonical-prefixes -Wl,-dead_strip -nostdlib++ -isysroot ../../build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -mmacosx-version-min=10.11.0 -fprofile-instr-generate -Wl,-ObjC -rpath @executable_path/ -o "./dawn_unittests" "@./dawn_unittests.rsp"
ld64.lld: error: duplicate symbol: __ZN4absl15AsciiStrToLowerEPNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE
>>> defined in obj/third_party/dawn/third_party/gn/abseil-cpp/strings/ascii.o
>>> defined in obj/third_party/abseil-cpp/absl/strings/strings/ascii.o

ld64.lld: error: duplicate symbol: __ZN4absl15AsciiStrToUpperEPNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE
>>> defined in obj/third_party/dawn/third_party/gn/abseil-cpp/strings/ascii.o
>>> defined in obj/third_party/abseil-cpp/absl/strings/strings/ascii.o

ld64.lld: error: duplicate symbol: __ZN4absl26RemoveExtraAsciiWhitespaceEPNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE
>>> defined in obj/third_party/dawn/third_party/gn/abseil-cpp/strings/ascii.o
>>> defined in obj/third_party/abseil-cpp/absl/strings/strings/ascii.o

Original change's description:
> Enable gn check for all build targets.
>
> This CL removes the `check_targets` entry from the .gn file which
> will enable checking all targets. Two of the GN targets have had
> missing dependencies added.
>
> The `gn/abseil-cpp/BUILD.gn` was referenced against the Chromium
> BUILD.gn for abseil to make sure the `public_deps` and `deps`
> match in the two versions. The paths are re-written to match
> the Dawn paths.
>
> Bug: dawn:1372
> Change-Id: I371e17ec9647e6627429be5c81eb7985da3cc5b3
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86861
> Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
> Kokoro: Kokoro <noreply+kokoro@google.com>
> Reviewed-by: Brandon Jones <bajones@chromium.org>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Commit-Queue: Corentin Wallez <cwallez@chromium.org>

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: dawn:1372
Change-Id: I1ce6d62138cd99aa3a75c74eea0ac04ce5048b6b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87161
Reviewed-by: Brandon Jones <bajones@chromium.org>
Auto-Submit: Brandon Jones <bajones@chromium.org>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-04-18 17:35:53 +00:00
Austin Eng 3199179167 Speculatively suppress RequiredBufferSizeInCopyTests on Win Intel x86
Bug: dawn:1375
Change-Id: Ieb218fc90e93734f2ccaacaf9a0dd22c57d93163
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86866
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-04-15 22:19:51 +00:00
dan sinclair 61bc38fd52 Enable gn check for all build targets.
This CL removes the `check_targets` entry from the .gn file which
will enable checking all targets. Two of the GN targets have had
missing dependencies added.

The `gn/abseil-cpp/BUILD.gn` was referenced against the Chromium
BUILD.gn for abseil to make sure the `public_deps` and `deps`
match in the two versions. The paths are re-written to match
the Dawn paths.

Bug: dawn:1372
Change-Id: I371e17ec9647e6627429be5c81eb7985da3cc5b3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86861
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-04-15 08:01:01 +00:00
James Price 0384932f1a tint: Replace smoothStep with smoothstep in tests
There were some tests that were still using the deprecated name, as
was the SPIR-V reader.

Bug: tint:1483
Change-Id: Ie919596712e05340110fbd872470a1b4c9a625c7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86745
Auto-Submit: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
2022-04-14 19:49:10 +00:00
dan sinclair df5b5daecf Convert test dep to use dawn_angle_dir
This CL updates the dep in the dawn test to use the `${dawn_angle_dir}`
instead of `//third_party/angle` to match other gn files.

Bug: dawn:1372
Change-Id: I5ac5b39e3ca98e8061eb5ae3cd757841c8711bbd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86862
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Stephen White <senorblanco@google.com>
Commit-Queue: Stephen White <senorblanco@google.com>
2022-04-14 18:36:40 +00:00
Yunchao He 3dc4a34385 Add data verification for e2e tests in RequiredBufferSizeInCopyTests.cpp
When we try to work around the bug exposed by tests in this file,
it is necessary to make D3D12 runtime happy and no validatin error
is reported. It is also essential to verify the correctness of
buffer/texture data after T2B/B2T copy whether workaround is applied
or not.

Bug: dawn:1289
Change-Id: I0d86375c513ffd579fdebc786d00e9eccb60cc10
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86511
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
2022-04-14 14:44:40 +00:00
Shaobo 3ed8b4e31d Skip Unneccessary GetPendingCommandContext() Call To Save An Extra Fence
GetPendingCommandContext() call might create a new commandList. Dawn handles
it in Tick() by executing this commandList and signal a fence even it is empty.
Skip the unnecessary GetPendingCommandContext() call saves an extra fence and might
resolve the callback for MapAsync earlier.

Bug: dawn:1335
Change-Id: I07f82388edb6978473eeaa2ed0834edbb5e1f497
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86621
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
2022-04-14 01:42:20 +00:00
Loko Kung 573abae522 Reland "Add render pipeline cache key generation for Vulkan."
- Fixes stack-buffer-overflow issue caused due to memcpy due to typing in recording fundamental array types.

This is a reland of commit ca11c03824

Original change's description:
> Add render pipeline cache key generation for Vulkan.
>
> Bug: dawn:549
> Change-Id: I0c0607984193ddcc2add05594517638e5370484d
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85863
> Reviewed-by: Austin Eng <enga@chromium.org>
> Commit-Queue: Loko Kung <lokokung@google.com>

Bug: dawn:549, dawn:1368
Change-Id: I6a62fa6e64873f2c487e9926190515cb5cc27bcf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86743
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-04-14 00:09:36 +00:00
Ryan Harrison 6e7e92c4c8 Fix path for stamp file in fuzzer corpuse generation
BUG=chromium:1314527

Change-Id: I05adbe671c4f30fe3e59829cd370a59347c8ed51
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86760
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
2022-04-13 19:34:06 +00:00
Loko Kung 83a5d52ed1 Changes dependency on vulkan-tools typemap header.
- Changed path to include only vulkan-tools directory to allow for easier configuration in Skia which cannot use vulkan-deps at the moment.

Bug: dawn:1365
Change-Id: Icbd0d3503b4af9d89b23f89c87f18fde814062f6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86582
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-04-13 19:14:46 +00:00
Austin Eng 7fdef49333 Revert "Add render pipeline cache key generation for Vulkan."
This reverts commit ca11c03824.

Reason for revert: crbug.com/dawn/1368

Original change's description:
> Add render pipeline cache key generation for Vulkan.
>
> Bug: dawn:549
> Change-Id: I0c0607984193ddcc2add05594517638e5370484d
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85863
> Reviewed-by: Austin Eng <enga@chromium.org>
> Commit-Queue: Loko Kung <lokokung@google.com>

TBR=cwallez@chromium.org,enga@chromium.org,noreply+kokoro@google.com,dawn-scoped@luci-project-accounts.iam.gserviceaccount.com,lokokung@google.com

Change-Id: Ifa8d8de8bdbc3bda19030254c56c9fa904481a04
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: dawn:549
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86742
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-04-13 17:36:26 +00:00
dan sinclair 2a3d994cc2 Fixup CQ and Kokoro lint mismatches.
The kokoro bots are running at a different level of verbosity than
the presubmit check. This CL ups the verbosity level for presubmit
to match kokoro and suppresses any new lint warnings which are
produced by the change.

The set of always removed filter options used by PRESUBMIT are
copied into the CPPLINT.cfg main file in order for kokoro to
match the errors presented by the CQ.

Bug: dawn:1339
Change-Id: I875a06bc2ed929d5dbaaa933282e3afa2559a7af
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86627
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-13 16:14:26 +00:00
Corentin Wallez 147da21856 Change Dawn samples to use surface-based swapchains.
This helps people looking at samples on how to use Dawn from getting
confused when implementation-based swapchains break (because they were
just made to be good enough N years ago).

Fixed: dawn:1361
Change-Id: Ia989fca4d0455fb8e0ff754056a3d60eb2958b04
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86531
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-04-13 15:33:06 +00:00
dan sinclair 2517d99f35 Fixup kokoro lint issue
This CL fixes the build/c++11 found by the kokoro bots.

Change-Id: Ic6ebc4ddf0f7bd25b20e4059d9f6c1c024fd71aa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86625
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-04-13 14:17:06 +00:00
Brandon Jones 76ce8c3007 Refactored how debug labels are set with Vulkan
Use templated functions to make calling SetDebugLabel safer, with
less opportunities to screw up the casting and automatic lookup
of the VkObjectType for most handles.

Change-Id: I0938ad6fd7d5fe81569bdee5bc7ec7e396db7bcd
Bug: dawn:1323
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86580
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon Jones <bajones@google.com>
2022-04-13 14:00:16 +00:00
dan sinclair 031e529714 Remove redundant virtual.
This CL removes a redundant virtual and enables the
readability/inheritance lint in src/dawn

Bug: dawn:1339
Change-Id: I3dcc84894b8d308461219a5ea206ca31300de297
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86504
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-04-13 08:53:36 +00:00
Loko Kung ca11c03824 Add render pipeline cache key generation for Vulkan.
Bug: dawn:549
Change-Id: I0c0607984193ddcc2add05594517638e5370484d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85863
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-04-13 02:48:41 +00:00
Loko Kung c083d65a0c Adds device-side cache key generation.
- Note that the device-side cache key will be prepended to object cache keys to prevent incompatible adapter/device cache clashes.
- Adds a new template file to auto=generate these cache serializers based on arguments.

Bug: dawn:549
Change-Id: I24b9d11eb38c579acfcc173a5dced9e1b649cf2c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86081
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-04-12 23:50:56 +00:00
dan sinclair 4d5723b5e5 Remove fuzzer CPPLINT file.
The tint regex fuzzer is disabling the c++11 lints, but nothing fails
when the file is removed.

Change-Id: I2d9f780694fb6bd340bd0cbbf4addf15858d28ee
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86440
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-04-12 17:46:51 +00:00
dan sinclair d53cb2ae67 Fixup explicit on some constructors.
This CL adds explicit to various single argument constructors. The
explicit is removed from zero argument constructors. None of these
changes required call sites to change.

Bug: dawn:1339
Change-Id: I7dfcf1b393e7dd379e29cd9bc613cb0626a9a967
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86365
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-12 17:44:41 +00:00
dan sinclair 012098a86b Add explicit in include/dawn
This CL adds some explicit notations to single argument constructors in
the include/dawn folder.

Bug: dawn:1339
Change-Id: Ie4e31bf68f920acfcfb27828a465e45fe0977af6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86443
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-12 17:43:21 +00:00
Corentin Wallez b2fdd6402d Rework dawn/native/ProcTable.cpp's template to better handle functions.
This is a small rework to try to make the template better handle
functions that aren't associated with an object, when during an
unrelated patch I got confused that APICreateInstance didn't appear in
dawn::native.

Change-Id: If5a2aa3f9e348d1847e48fec4e90e5966ddd489d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86530
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-04-12 16:46:01 +00:00
Fumitoshi Ukai a5f5f5a1aa use stamp file for tint_generate_wgsl_corpus
using directory for actions output causes issue like
crbug.com/1315457

 ninja explain: output obj/third_party/dawn/src/tint/fuzzers/tint_generate_wgsl_corpus.stamp older than most recent input gen/third_party/dawn/src/tint/fuzzers/fuzzer_corpus_wgsl (1649712735 vs
1649712999)

Use stamp file instead of directory.

Bug: chromium:1315457, chromium:1314527
Change-Id: Ifdf0493e23dbab000513e8f2c0ae4aa8cd76444f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86482
Auto-Submit: Fumitoshi Ukai <ukai@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-04-12 16:18:01 +00:00
Ben Clayton c85f8d828e tint: Fix doxygen failure
Bug: tint:1495
Change-Id: I4e9d0d58e0f49c80ea7709d5baecf0eca80e297a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86529
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2022-04-12 12:42:00 +00:00
Corentin Wallez 48585f3c15 dawn.node: Make run-cts --print-stdout print the run's stdout/err
Add a new muxWriter and use this for stdout writing to ensure
that stdout printing does not tear.

Bug: dawn:1123

Change-Id: Iec1ba16e5524c11bfc00ba38b3e4de3c06627fb1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85366
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-04-12 12:17:23 +00:00
dan sinclair c9a1f6a595 Fix copyright issues in src/include forwarding headers.
This CL adds the missing copyrights in the forwarding headers.

Bug: tint:1339
Change-Id: I9806d7ef8124a8e0e9a1fbc3452e1946f75d3fb7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86363
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-04-12 06:59:11 +00:00
dan sinclair eff8e00d97 Fix missing copyrights in src/dawn.
This CL adds the two missing copyright headers to files under src/dawn
and enables the lint flag by default.

Bug: dawn:1339
Change-Id: I3c3ec47b7f93dabadd0934fb93042f695e7e96fc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86360
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-04-12 06:58:24 +00:00
Yuly Novikov 736b33f059 Revert "Ignore VUID-vkCmdDraw-None-06538 VVL message"
This reverts commit 1e988b417c.

Reason for revert: Vulkan validation layers fixed in
https://github.com/KhronosGroup/Vulkan-ValidationLayers/pull/3938

Original change's description:
> Ignore VUID-vkCmdDraw-None-06538 VVL message
>
> To get vulkan-deps roll going
>
> Bug: chromium:1310052
> Change-Id: Ia47aa9a486256a9b3c96b90a66cd39bd2ec7c155
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84724
> Reviewed-by: Austin Eng <enga@chromium.org>
> Commit-Queue: Austin Eng <enga@chromium.org>

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: chromium:1310052
Change-Id: Icf676fca331ee8cde1b192d474745a3aac20c330
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86460
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-04-12 05:33:20 +00:00
Stephen White cedd55a9bf GLES: revert part of the view format reinterpretation on GLES.
View format reinterpretation doesn't work, but its implementation was causing failures on other content.

This patch came from: https://dawn-review.googlesource.com/c/dawn/+/84704/comments/339d5a75_5dce5ce3

Bug: dawn:1360
Change-Id: I76adc264d6f185f840d975b46b6e92a0e5a7b4a8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86362
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2022-04-12 03:31:16 +00:00
Brandon Jones 8085367233 Enable Queue, Device labels to be set. (Take 2)
Queue labels can be set by the defaultQueue.label member of the device
descriptor or the setQueue method.

Device labels can be set label member of the device
descriptor or the setQueue method.

D3D12 and VK backend label support included.

Bug: dawn:1323
Change-Id: Ic44f1fac268c20d5338220eaf959d949a5f66536
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85843
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2022-04-12 03:28:40 +00:00
Ben Clayton 7170b727c9 dawn/node: Fix GCC warning
About comparisons of different datatypes

Bug: dawn:1123
Change-Id: Iefdb8195041b824f63344a0b367fd5bebbe3ca85
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86308
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-04-11 21:50:40 +00:00
Antonio Maiorano f625a6d57e tint: Make GLSL backend consistent with the others
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>
2022-04-11 21:13:10 +00:00
Antonio Maiorano b5c46c30ec tint: spirv writer: add a GeneralImpl to be consistent with HLSL and MSL backends
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>
2022-04-11 21:10:20 +00:00
Ben Clayton 3f4b260264 dawn/node: Define NAPI_DISABLE_CPP_EXCEPTIONS
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>
2022-04-11 20:10:10 +00:00
Ben Clayton 262a4c4824 tint: More doxygen fixes
Change-Id: I46d73d760e3f78fb374cffe003668f29f4bcbe1e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86380
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-04-11 19:54:48 +00:00
dan sinclair 479dc6b7eb Enable build/header_guard
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>
2022-04-11 18:30:50 +00:00
Ben Clayton 05caf3a20f tint: Fix doxygen errors
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>
2022-04-11 17:47:10 +00:00
Corentin Wallez be352ea5b9 CMake: Add support with Swiftshader with DAWN_ENABLE_SWIFTSHADER
Change-Id: I2b3d906bac760a22f33104231a6341415cbff3b5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85365
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-04-11 16:48:43 +00:00
Corentin Wallez 6efd54e2ae Move samples/ under src/dawn/samples/
Bug: dawn:1339
Change-Id: I897df9889da62e4505ea98a780bd481e7855ec73
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86307
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2022-04-11 16:40:00 +00:00
Antonio Maiorano 7eaab38574 tint: Simplify backend Sanitize functions by passing in Options
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>
2022-04-11 16:33:30 +00:00
dan sinclair 396b75cd29 Fixup include directory errors in src/dawn.
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>
2022-04-11 16:29:30 +00:00
dan sinclair 566d7f25b8 Enable empty_if_body lint.
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>
2022-04-11 15:50:50 +00:00
Antonio Maiorano e0bee791cb Add ifdefs for Tint API usage that may not be available
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>
2022-04-11 15:21:41 +00:00
Ben Clayton a7230f06ff tint: Standardize the way we forward-declare
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>
2022-04-11 14:37:21 +00:00
dan sinclair fd64b10b0d Fixup readability/braces lint warning.
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>
2022-04-11 14:25:11 +00:00
dan sinclair 69347de37b Enable runtime/printf
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>
2022-04-11 14:10:40 +00:00
dan sinclair 13d88a6438 Fixup build/include issues in src/dawn
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>
2022-04-11 14:01:50 +00:00
dan sinclair fcf56791c1 Create more targeted CPPLINT.cfg files.
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>
2022-04-11 13:05:40 +00:00
Stephen White ca4a8cf02a OpenGLES: simulate glTextureView() with texture-to-texture copies.
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>
2022-04-09 18:27:50 +00:00
Loko Kung 23d09c6114 Add compute pipeline cache key generation for Vulkan.
- 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>
2022-04-09 00:10:08 +00:00