An abstract base class (Device::Context) is used to avoid adding dependencies to Device, with ContextEGL derived from it. This also
leaves open the possibility of supporting other native GL contexts
in the future (e.g., glX). One temporary EGLContext is created by opengl::Backend during Adapter discovery, then one is created for and
owned by each Device.
Contexts for the desktop GL backend are also managed via EGL, which
works for most modern drivers. This also means that GLFW is now
always used in GLFW_NO_API mode.
Since contexts are now per-device, all of the default GL state
setting and debug output setup was moved from Adapter to Device.
Bug: dawn:810
Change-Id: Idfe30939f155d026fcad549787fc167cc43aa3cb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93981
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
When enabling the SPIR-V reader or SPIR-V writer we were suppressing
-Wnewline-eof, -Wold-style-cast, -Wsign-conversion, and -Wweak-vtables
for the `libtint` cmake target and anything that depended on that
target. Because we'd build all readers/ writers by default this caused
us to never hit those warnings.
A recent change to the cmake build sets the Tint backend based on
the Dawn backend. So, there is a much higher chance of not building
the SPIR-V support if you're on a Mac or Windows machine.
This CL removes the suppression of the warnings, adds specific pragmas
into the SPIR-V reader code which imports the SPIRV-Tools headers
and fixes up the warnings which were then firing due to checking
for the new warnings.
Change-Id: I0d0be6aa3d0b692e939ce8ff924dfb82c82792fc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94901
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
This function was attempting to pick a higher-precision type by using
the decltype() of FROM + TO. This doesn't work if FROM and TO are both
similar bit-widths, and of a different signness, as the picked type may
not be wide enough to hold both the signed and unsigned representation.
Just use AInt or AFloat (both 64-bit), which are the largest types
supported by WGSL.
Change-Id: Ic76475d98bad8def12a0283a1c83c62f2ed58b5d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/95041
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@google.com>
This pulls in the entire world, and isn't needed from this header.
Remove it. Fix all the places that were transtively depending on
program_builder.h's includes.
Change-Id: I5209dcd387fb47dd6744a3d676997338b8f45473
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/95040
Reviewed-by: dan sinclair <dsinclair@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Enable the parsing of 'const'.
Warn on use of module-scope 'let', and automatically replace with 'const'.
Fixed: tint:1580
Change-Id: I214aabca80686dc6b60ae21a7a57fbfb4898ea83
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93786
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Module-scope 'let' is getting replaced by 'const'. For all backends,
'const' will be inlined into the place of usage, making most of these
tests produce no output (if replaced with 'const'). Instead switch to
emitting with 'var'.
Bug: tint:1580
Change-Id: Ied5ddf9cdb7fbd3cef8e7b0c6f4983748aaa3d07
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94688
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
This patch re-enables the workaround for T2T copy issue on Intel
GPUs as we have found there are still other issues about T2T copies
on latest Intel D3D12 driver when we investigate the WebGPU CTS
failures on Intel Gen9 and Gen9.5 GPUs.
Bug: chromium:1161355
Change-Id: Ibd8a8c299453dff6a5432b3c4ab5350558c5313f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94980
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
The usages in Chromium have been updated to pass a descriptor.
Bug: dawn:1451
Change-Id: I1f08141759dc7b8e0e805aa8efc9a8db51162876
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94941
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Polyfill them completely for HLSL.
For the other backends, just add range checks for acosh and atanh.
Fixed: tint:1465
Change-Id: I3abda99b474d9f5ba09abf400381467dc28ea0bd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94380
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This patch add f16 types and their constructors and conversions in
resolver and intrinsic table. Also implement relating unit tests.
Bug: tint:1473, tint:1502
Change-Id: Ida1336193a72a73959e50e6a3eb12be44c0396b5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94642
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
If a module-scope private variable is only referenced within a single
function, promote it to a function scope declaration instead of
passing it as a parameter. This reduces the number of a function
parameters that are needed in some cases.
Bug: tint:1509
Change-Id: I8951f6216bc7e4cf5abfda314bea1e9ed3ded560
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94002
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This patch clears mTempBuffers everytime after d3d12CommandList
is executed in CommandRecordingContext. Previously mTempBuffers
won't be cleaned up until device is destroyed, which will
consume lots of unnecessary GPU memory.
Bug: chromium:1161355
Change-Id: Ie03d43847ed56e7f2b4bfc5b0f8244dfd7012625
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94820
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Always report the Javascript duration from the page instead of
the total duration from ResultDB. Reporting of the total duration
could be added back in the future, but usages of the tooling are
currently interested in the Javascript duration.
Bug: chromium:1336333
Change-Id: I74e91e7a9c29f3a4c45ed67898cc6f2de62e19a4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94762
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
The issue causing these tests to fail was resolved in
https://chromium-review.googlesource.com/c/chromium/src/+/3716961
Bug: 1069302
Change-Id: Iacf06539a0415431b3355bc4b2345c2eb7cab61a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94761
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Rename PromoteInitializersToConstVar to PromoteInitializersToLet, and
implement promotion of 'const' variables that resolve to array types.
This is required, as the backends will inline variables that resolve to
'const' variables, and so we need to promote any 'const' values that
would emit an array constructor.
Bug: tint:1580
Change-Id: I1b7f5459512b0043385ba741d644ec776c912899
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94684
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Introduce //build_overrides/wayland.gni to simplify the management of
the wayland dependencies.
Bug: chromium:1327041
Bug: angleproject:7409
Change-Id: Ib1e120c722aec6ff3cb171f39a8e794b93799129
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93788
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: dan sinclair <dsinclair@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This patch clamps GPURenderPassColorAttachment.clearValue into the
legal range for uint/sint formats according to the latest WebGPU
SPEC.
This patch also adds tests to verify we can directly apply floating
point clear values for normalized floating formats.
We don't handle non-normalized floating formats as the exact choice
of the converted value is implementation-defined.
Bug: dawn:1449
Test: dawn_end2end_tests
Change-Id: I864f3e9bafb9c7ecd0ed9cfa7f401174da000884
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94501
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Creating GPUExternalTexture from destroyed device should return
an error external texture instead of a valid one. Adding this API
for such usage.
Bug: 1336713, 1338182
Change-Id: Ie7d13811a9c1e8890ba91045c88af63f3fb09687
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94534
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
The WGSL specification changed so that the enforcing of
initializers being only const-expr is no longer done by the
grammar. This is change is required to allow for 'const' expressions to
reference each other.
Bug: tint:1580
Change-Id: Ia95b6a0bc86ce391a38f4248f20898dd9a6cf27f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94683
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
This enables the WGSL parsing of 'const' for only tint_unittests,
allowing code to be split up into smaller chunks for review.
Once all the logic is submitted to handle 'const', the test-only
flag will be removed, and 'const' will be enabled for production.
Bug: tint:1580
Change-Id: I3189b6bd15445ecc3fa1cd6f568885e7ba3c91c0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94680
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Required for 'const' values that use other 'const' values in their
expressions.
Bug: tint:1580
Change-Id: I1d86281bec19340fdc0c60dc5b22eb3d6dc04cf5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94606
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
The frontends do not currently emit these, nor do the backends currently
handle them.
Bug: tint:1580
Change-Id: I469a5379663c2802145b28a94f5c1e348cc14ff3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94605
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
We have `GlobalLet()`, `Let()`, `Var()`, so this just
keeps things consistent
Change-Id: Ie9f79b62e737a15b995c5a2b19f84621a5ac3cc9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94604
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
GlobalConst() is going to mean a module-scope `const`, once we
support `const`. `GlobalLet()` will then be removed.
Bug: tint:1580
Change-Id: Ie00e9ccdee8c111266850bfe1e1e24f022a59a06
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94603
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
Fix collision of two CLs landing with different expectations.
Change-Id: I44eb904b552f635e37dd51dcc94329fbc34af031
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94685
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Motivation is to simplify cache evicting by reusing the LRU to evict stale entries from older Dawn versions since there isn't already a simple cache busting solution. The dawn version will just be pushed into the cache keys instead so old version entries will eventually be retired.
- Removes the fingerprint from the GetCachingInterface API on DawnNative.
- Adds the "fingerprint", which was just the hash, to the device;s cache key directly instead.
Bug: dawn:549
Change-Id: I573aa03a2bb96dfe044293b1176d3a7746725572
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94140
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Use the constant evaluated value instead of manually traversing
variables to find the literal value. This is a small step towards
supporting 'const' values for array sizes.
Also make our OOB-byte related error diagnostics consistent.
Bug: tint:1580
Change-Id: Idf9eb22cdbf69d750218c554e9f826c30458c6b9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94600
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
The following operations are supported:
OpAtomicLoad
OpAtomicStore
OpAtomicExchange
OpAtomicCompareExchange
OpAtomicCompareExchangeWeak
OpAtomicIIncrement
OpAtomicIDecrement
OpAtomicIAdd
OpAtomicISub
OpAtomicSMin
OpAtomicUMin
OpAtomicSMax
OpAtomicUMax
OpAtomicAnd
OpAtomicOr
OpAtomicXor
These are not, but may be supported in the future:
OpAtomicFlagTestAndSet
OpAtomicFlagClear
OpAtomicFMinEXT
OpAtomicFMaxEXT
OpAtomicFAddEXT
Bug: tint:1441
Change-Id: Ifd53643b38d43664905a0dddfca609add4914670
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94121
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Split tests up by variable type, and group them.
Change-Id: I4a9ae620883cd2acc05745b54f85df7b3fe7ac3d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94602
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Bug: dawn:1471
Change-Id: I73a38ac113bdd6084c5fe7b5e921f40a9ae5665b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94760
Reviewed-by: Austin Eng <enga@chromium.org>
Auto-Submit: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>