Virtual methods are expensive to call, and hashes are frequently tested.
The hash must be immutable, so just calculate it once in the constructor and store it as an immutable field.
Change-Id: I9d29fb3fc074e57e7af91367768a47193baa40f1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114780
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
The generator_lib.py processing of file renders would check that the
output directory doesn't exist and if needed, would create it. However
by default makedirs errors if the path already exists. This caused
issues when multiple generator_lib.py generators with the same output
dir would run in parallel in builds, because there can be a race where:
- GeneratorA: Check os.path.exists -> returns False
- GeneratorB: Check os.path.exists -> returns False
- GeneratorB: os.makedirs -> Ok
- GeneratorA: os.makedirs -> Exception, fails the build.
Instead use os.makedirs(exist_ok=True) inconditionally to remove this
racy behavior.
Bug: None
Change-Id: I5cb401a1df11a3640faeea94c15cb54236edc05a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114521
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This immediate rejection has been implemented in Native but
hasn't been yet in Wire. This commit adds the implementation
to Wire.
Also the commit changes the MapAsync callback firing timing
if pending map buffer is unmapped or destroyed. With this
commit the callback will be fired immediately Unmap or
Destroy is called to match the WebGPU spec. Currently the
callback is fired when the client receives a response from
server but it mismatches the spec.
Change-Id: Ia48d62be31912fd0384e23271e9de516f9d71d6c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/113607
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Takahiro <hogehoge@gachapin.jp>
Reviewed-by: Austin Eng <enga@chromium.org>
The code that was ifdef'd out no longer compiled.
Change-Id: I6243cc6a3584c555505c4bee68ec02bbb96801c3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/113430
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
The resolver now wraps sem::Expression objects with a sem::Load object
anywhere that the load rule is invoked. sem::Expression provides an
`UnwrapLoad()` method that returns the inner expression (or
passthrough, if no load is present), which is analaguous to
Type::UnwrapRef().
The logic for alias analysis in `RegisterLoadIfNeeded` has been folded
into the new `Resolver::Load` method.
Fixed up many transforms and tests. The only difference in output is
for a single SPIR-V backend test, where some IDs have changed due to
slight re-ordering of when expressions are generated.
There may be further clean-ups possible (e.g. removing unnecessary
calls to `UnwrapRef`, and simplifying places in the SPIR-V writer or
transforms that deal with memory accesses), but these can be addressed
in future patches.
Fixed: tint:1654
Change-Id: I69adecfe9251faae46546b64d0cdc29eea26cd4e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/99706
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2D array texture may corrupt on some Intel devices, making out-of-bound
texture access and memory information leak. It's a critical security
issue. Intel driver team suggested the 24K extra memory approach in
order to mitigate the security issue before.
However, the texture corruption issue (and even the correctness issue)
can be worked around via allocating a few extra layers. And patches
have already been merged in Dawn, with a lot tests for verification. The
24K extra memory for each texture is actually incorrect and unnecessary.
So this patch removes relevant code in Dawn.
This patch mainly reverts some code of this patch below:
https://dawn-review.googlesource.com/c/dawn/+/96220
Bug: dawn:1507
Change-Id: Ic3239115ad4c74bdee928577ccbb20f1e35d13c3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114641
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Don't use dynamic casting in hashing and equality. These should be fast, and dynamic casting is expensive.
Add type::UniqueNode for things that need de-duplicating and bin the types on construction.
Replace some use of SFINAE with constexpr.
Also fixes a build failure for x86.
Bug: oss-fuzz:54184
Change-Id: Ic1b0708394f9f5703fc179a2c31ce18bd07e196c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114760
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Without this, the next update will rebuild these expectations, without the Skip.
They appear to be flakey, preventing rolls from landing.
Change-Id: I09eacf9596fd4d984e2c6ac600076dbaeafe5347
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114700
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This CL moves the CreateComposite helper into the ProgramBuilder.
Bug: tint:1718
Change-Id: I4aca7dc3d7192a7aa8b300f00529670aa9c09a27
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114202
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
This CL updaets the ir::Constant to store a constant::Value instead of the specific numbers
themselves.
Bug: tint:1718
Change-Id: I66b0a9643893b6079399daf61ee39ac5811e1eaf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114362
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Change-Id: I3e2d0f4e00e10ea221c1a760775550f4a0374b3b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114420
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
This CL renames constant::Constant to constant::Value as it reads a bit
nicer.
Bug: tint:1718
Change-Id: I3489a271ebe229dabf98e7668bdaef4fec375534
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114361
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2D array textures with non-color formats like depth/stencil formats
are always fine. Workaround is not needed.
Multisample textures are treated as array textures from the
perspective of texture memory layout on Intel Gen12 and each sample
acts like a layer. However, multisample textures are fine.
Workaround is not needed.
Bug: dawn:1507
Change-Id: I1e5cd6a4e46503f67e4c1ffe2133e2e8fb121016
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/113740
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Makes it clear that the index being reported by these messages is the
group index and not the binding number. This was a point of confusion
in on the bug.
Additionally, adds more information to the error message regarding
buffer sizes being too small for the current pipeline. Now includes the
pipeline name and buffer size as well as the minimum required size. Also
includes a note explaining that uniform buffer bindings must be a
multiple of 16. (This recently changed and cause several existing
samples to break for non-obvious reasons.)
The error message still does not contain the buffer or binding number,
which would be helpful. This is because we currently lack a way to look
up the binding index from the packed index that this error is generated
with.
Bug: dawn:1604
Change-Id: Ibb2b44bc9e1583ddef34d703e83bcf64ed7a3aa2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/113602
Commit-Queue: Brandon Jones <bajones@chromium.org>
Auto-Submit: Brandon Jones <bajones@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Moves hashcode bloom-filter type logic to helpers instead of inlining
this stuff. Minor code cleanup.
Change-Id: Id6816dd18445d1d1200a9d49f05cb803095b3d89
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114341
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
The tooling does not expect, nor can handel a type matcher to be used as a parameter or a direct template parameter to another type. Make this an error.
Change-Id: I28c04c00c7fa1cb5130c53215a90a59d660d6fa3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114380
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This CL updates Constant::As to be Constant::ValueAs. Now that Constant
inherits from CastableBase, there is already an As method on
CastableBase. This makes the override inside Constant confusing and
potentially incorrect.
Bug: tint:1718
Change-Id: I4f73971801e95225a99a5a993124c04194d0d7d6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114360
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Dan Sinclair <dsinclair@chromium.org>
Tint used to use 80-character columns, and now uses 100.
Use the extra space
Change-Id: I493a2195094b23ecc70091b906b12cf742deac7c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114340
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
This CL decreases the default vector size in Composite from 8 to 4.
There will, probably, be a lot more vectors then arrays and structs so
this should reduce the used memory slightly.
Change-Id: I0a47780736192b43189cd211d34744a4f8028b97
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114200
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
The ImplResult type is the same as ConstEval::Result after recent
changes. This CL replaces all usages and removes ImplResult.
Bug: tint:1718
Change-Id: If424f3d00f953d97a339de8ae18c94083f3346bf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114162
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This CL moves the constants into the constant namespace.
Bug: tint:1718
Change-Id: Id8f98ca6c16085136c06d98bbd8b755b36cb2409
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114161
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
This Cl splits the concrete constant implementations out of the
const_eval.cc file and into individual files. The classes are left in
the resolver namespace and will have a namespace update in a followup
CL.
Bug: tint:1718
Change-Id: I54539b6aa06f09aff39a1b1331d89f67a3594791
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114160
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This CL moves ValueOf and IsPositiveZero into the Scalar class which was
the only usage.
Bug: tint:1718
Change-Id: I2c99831ac30d4d3f0b3bfe9ad25a85186bba0f1c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114123
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
The content of ImplConstant has been removed and can be replaced by the
constant::Constant base class.
Bug: tint:1718
Change-Id: I611f03d43335bf3b5629a8bc44d74318c7f69a58
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114122
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This CL pulls the convert methods out into standalone methods inside the
resolver and de-couples from the constants.
Bug: tint:1718
Change-Id: Id566704687b2d74e05eae860477552f88f6a06b9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114120
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
The const-eval Element is renamed to Scalar to better represent what is
stored.
Bug: tint:1718
Change-Id: I882a8d955f805bc04cea6794fdeaeba0ff2f2ae8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114101
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Removes the overhead of a virtual function call, at the expense of a larger object.
Change-Id: I81d783d4a69b16a69143d4b313f8d90d5df88a33
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114080
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
There was limited validation for this. Validate all ways to use a f16.
Change-Id: Ibdcde1f304e704790da3db379c79fcc0844cad67
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114140
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>