This change makes it harder to misuse ConsumedError which can cause
device loss. When it is a known error, instead use HandleError to
bypass the "unlikely" if clause.
Bug: dawn:1336
Change-Id: I3052db343fe4080b257f1c2f9535f743a0e78526
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120384
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Note that we can just log these errors and avoid bubbling them up since
cache creation failure should not be fatal in Vulkan.
Bug: dawn:1336
Change-Id: Ie49d433f9b991508859f4969f2d4bf3b7c9e66d3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122024
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Most suppressions where ok, but some needed to be expanded to cover all
configurations. Which this CL does.
Bug: chromium:1417269
Change-Id: Iad223e5cff31f8691c9131bec763f281df46bded
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122041
Reviewed-by: Austin Eng <enga@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
It was renamed to wgpu::TextureSampleType in the spec but the enum is
still used in some parts of dawn::native. Tag the enum as internal for
now until we can change Format.h and friends to no longer require the
enum.
Bug: dawn:1682
Change-Id: I673353ff290495777ed1618810daa011b450dff5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122122
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
This commit makes depthWriteEnabled and depthCompare required and
makes depthClearValue conditionally required for the spec change
in WebGPU V1.
https://github.com/gpuweb/gpuweb/pull/3849
depthClearValue is required if depthLoadOp is clear and the
attachment has a depth aspect. To simulate it, this commit lets
NAN represent unspecified depthClearValue and lets the default
value of depthClearValue be NAN.
Bug: dawn:1669
Change-Id: I469338e909b1d3c345bc2642ee47daee858909ca
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120620
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Hoisting them would cause premature materialization. This will only
happen in cases where we do not actually need to hoist (e.g. assigning
to a phony), so we can safely skip these.
Fixed: tint:1852
Change-Id: Ifcbe3e13496daa0a6aaceb58540e60cb037885ea
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122104
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
This CL converts most of the remaining Tint usages (leaving out the
fuzzer code and some float_to_string code).
Bug: tint:1686
Change-Id: I4d5cef176c15479250861903870ec5bec0f95b5e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122002
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
This assertion was mistakenly changed to only allow index accessors
when the ast::AccessorExpression base class was added.
Bug: chromium:1420257
Change-Id: Ic2b695dd7605c8852ab6d822602dca5d28ecf2d4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122103
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This CL updates the WGSL reader to use utils::StringStream internally.
Bug: tint:1686
Change-Id: I203c764bbb86e99da323fde2be2af555f158b7bf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122001
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This CL updates the SPIR-V reader to use utils::StringStream internally.
Bug: tint:1686
Change-Id: I619c2aa56b85e6c24b933ffa2a1a409d63846f5e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122000
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This CL updates the resolver to use utils::StringStream instead of
std::stringstream.
Bug: tint:1686
Change-Id: Ib15a9ae3228757bbddcf787fa9130ca19bc9eab7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121980
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Up to 1024 threads in the X and Y dimensions. This is supported on all
Mac, all Windows, and most Vulkan devices.
Bug: dawn:685
Change-Id: I067a492bdfc32d6a186d6875e545238babca8784
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122003
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This CL updates the TextGenerator base class to use utils::StringStream.
Bug: tint:1686
Change-Id: Ie36f55cf32e63773c4bee2cf89cdef19ab1fba28
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121960
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This CL updates the WGSL generator to use utils::StringStream
internally.
Bug: tint:1686
Change-Id: I7387a583f9cba3c6a955f5be376adc141e3ee394
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121941
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This CL updates the spir-v writer to use utils::StringStream.
Bug: tint:1686
Change-Id: I0b1367991de9ecb9fe02bdd0d1827aeba633f2fb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121940
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This CL converts the MSL generator to use utils::StringStream
internally.
Bug: tint:1686
Change-Id: I4225ebb87fd5281a3527bf2a9067651b60b114a8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121920
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This CL converts the HLSL generator to use utils::StringStream instead
of std::stringstream.
Bug: tint:1686
Change-Id: I69d4deec9b65bbcba6afe319cc1266879cd7c373
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121900
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This CL switches the GLSL Generator to use utils::StringStream. The line
writer is converted internally as well, although it converts to
`std::ostream` for now. This caused a couple of the MSL, HLSL and GLSL
tests to generate slightly fewer decimal points in a couple tests.
Bug: tint:1686
Change-Id: I9ec8c1a5ef49679fc1c9a9aece86ab3390e103fc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121880
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This Cl updates the IR to use the `utils::StringStream` instead of
`std::stringstream`.
Bug: tint:1686
Change-Id: Iee9063db554bc75e7a730a8629d7f3403ff1a190
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121860
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This CL adds `utils::StringStream`. This is a wrapper over
std::stringstream which forces the locale to always be `classic`. The
logic to format floats and doubles as expected is moved from
`float_to_string` and handled in the StreamStream. This will make all of
our float emission the same.
Bug: tint:1686
Change-Id: If51868f577580d3ea6ab94d3910393e239fd55e4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121800
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
- Defaults consume error calls to only allow validation and device loss
errors.
- Allows OOM errors on Buffers, QuerySets, and Textures only.
- Adds initial suite of unit tests (and any necessary updates to mock
framework).
Bug: dawn:1336
Change-Id: I82112ea6c147e894280e605bf8ae0ce00488c9f3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119800
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
The Dawn E2E tests for memory layout now check that padding bytes are
preserved, instead of skipping them.
Bug: tint:1571
Change-Id: I02edbe140e7025937a3188106da5e43ff03ad078
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121602
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
A Napi::TypedArray may have a non-zero offset on its underlying
ArrayBuffer backing buffer. Also use the length of the typed array,
not the backing buffer.
Change-Id: Icaa310ef8f87393b4d7582ba0a0afb2b87318664
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121820
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
The higher tier for this limit is available on all D3D12, all Metal,
and most Vulkan devices.
Bug: dawn:685
Change-Id: Ic2a39ad7908ea178e7aac48b7bb54b262d7039cf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121543
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
In order to preserve padding properly for MSL, we need to use its
packed_vec type for all vec3 types in storage buffers, not just struct
members. This commit includes a complete rewrite of the PackedVec3
transform to achieve this. The key details are:
* An internal `__packed_vec3<>` type was added, which corresponds to a
`type::Vector` with an additional flag to indicate that it will be
emitted as packed vector.
* The `PackedVec3` transform replaces all vec3 types used in
host-shareable address spaces with the internal `__packed_vec3`
type. This includes vec3 types that appear as the store type of a
pointer.
* When used as an array element, these `__packed_vec3` types are
wrapped in a struct that contains a single `__packed_vec3`
member. This allows us to add an `@align()` attribute that ensures
that `array<vec3<T>>` still has the correct array element stride.
* When the `vec3<T>` appears as a struct member in the input program,
we apply the `@align()` to that member to ensure that we do not
change its offset.
* Matrix types with three rows that are used in memory are replaced
with an array of columns, where each column uses a `__packed_vec3`
inside an aligned wrapper structure as above.
* Accesses to host-shareable memory that involve any of these types
invoke a "pack" or "unpack" helper function to convert them to the
equivalent type that uses `__packed_vec3` or a regular `vec3` as
required.
* The `chromium_internal_relaxed_uniform_layout` extension is used to
avoid issues where modifying a type in the uniform address space
triggers stricter layout validation rules.
Bug: tint:1571
Fixed: tint:1837
Change-Id: Idaf2da2f5bcb2be00c85ec657edfb614186476bb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121200
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Only load extension entry points if the extension is supported.
From the eglGetProcAddress manpage:
"A non-NULL return value does not guarantee that an extension function
is actually supported at runtime. The client must also make a
corresponding query, such as glGetString(GL_EXTENSIONS) for OpenGL and
OpenGL ES extensions [...] to determine if a function is supported by
EGL or a specific client API context."
This required moving extension initialization from OpenGLFunctions
into OpenGLFunctionsBase.
Change-Id: Ib4e8360ba455818701990b4476689b651d097ca8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121760
Commit-Queue: Stephen White <senorblanco@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Also increased stack size for windows + debug GN builds of
tint_unittests to 4 MB, which matches what we do in the CMake build.
Required, otherwise some of my new tests stack overflow.
Bug: tint:1209
Change-Id: I3b98000a989aa8b42b20cc4e2219c91887e52451
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121360
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This will be used by the PackedVec3 transform to avoid triggering
stricter layout validation rules for the uniform address space when
mutating types.
Bug: tint:1571
Change-Id: Ib15737fbe3cab4a8fbe453bcaf96ef2acc595921
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121601
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This will allow the WGSL interpreter to use it (as the interpreter
does not have semantic nodes for its runtime results).
Change-Id: Icf81852d099b34cbb48c098bc116b4f08a3a7c61
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121545
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
Kokoro: James Price <jrprice@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
The PreservePadding transform now decomposes writes to matrices with
three rows into separate column vector writes, to avoid modifying
padding between columns.
Bug: tint:1571
Change-Id: If575f79bb87f52810783fd3338e2f3ce3228ab2e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121600
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>
The result of integer mod is defined to be zero when the RHS is zero
and for (MOST_NEGATIVE / -1). Floating point is expected to be
implementation defined, so also return zero in this case.
Change-Id: Ic25250d637ccb93ba62a5fc0bcebe670d5cd4e3b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121544
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: James Price <jrprice@google.com>