Commit Graph

11440 Commits

Author SHA1 Message Date
shrekshao 49a08b7668 Refix validation for command encoder pass encoding
According to latest spec, beginRenderPass/beginComputePass
don't throw validation error. Error still defers to
CommandEncoder::Finish()

Bug: dawn:1602
Change-Id: I5fd76f2c8951273a8dd82b02e20f076079354b60
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/115120
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
2022-12-20 21:03:16 +00:00
dawn-autoroll a68ce9213f Roll vulkan-deps from 28ede018d9d4 to e121f25bdace (4 revisions)
https://chromium.googlesource.com/vulkan-deps.git/+log/28ede018d9d4..e121f25bdace

Changed dependencies:
* glslang: f9b760e6c7..dcae187376
* spirv-tools: 5bec0884cf..c5d2316430
* vulkan-validation-layers: df33af3b22..c557a0035f

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/vulkan-deps-dawn-autoroll
Please CC jrprice@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dawn: https://bugs.chromium.org/p/dawn/issues/entry

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: jrprice@google.com
Change-Id: I4bef5c82e9a6af341017435037f5d44405719c0a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/115261
Bot-Commit: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2022-12-20 20:50:04 +00:00
James Price eb34a764a8 tint/uniformity: Fix handling of continuing block
Variables declared inside a loop block were not visible to the
continuing block. Special-case the continuing block by processing it
inside the loop-body block statement, instead of afterwards.

Change-Id: I05bc906bd98b24295dc91116b9ef8d8ef02c3af3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114860
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-12-20 20:12:51 +00:00
James Price efc9df4695 tint/uniformity: Fix issues with for-loops
Variables declared in for-loop initializers were not being tracked
properly across iterations as a check was wrongly determining them to
be declared inside the loop body.

Also fixes an issue where variables declared in for-loop initializers
were still considered to be in scope after loop exit.

Change-Id: I2ce3a519be45c8daba31bf00e8b2614f0bd6a2de
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114364
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Auto-Submit: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
2022-12-20 19:08:56 +00:00
Antonio Maiorano 056618541f tint: const eval of bitcast operator
Bug: tint:1581
Change-Id: Ida43b34118282eeb99ae099c91a6465eb3040ca6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/115080
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2022-12-20 18:34:06 +00:00
Antonio Maiorano ffa83ad1f7 tint: make utils::Bitcast not trigger gcc warning
When useing Bitcast to or from a class type, gcc warns even if the type
is trivially copyable. Fixed this by static_asserting that both types
are trivially copyable, and casting the pointers to std::byte*.

Change-Id: Ibb420f2dcdd35cfb187d74983fa8ab9b50d10c85
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/115180
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-12-20 17:13:39 +00:00
Yuly Novikov c4673b7386 Suppress couple more WebGPU CTS flakes on Win Intel
From:
https://luci-milo.appspot.com/p/chromium/builders/ci/Dawn%20Win10%20x64%20Experimental%20Release%20%28Intel%29/641
https://luci-milo.appspot.com/p/chromium/builders/ci/Dawn%20Win10%20x86%20Experimental%20Release%20%28Intel%29/433

Bug: None
Change-Id: Icb7e3b7fd3a0920cd74677717e5ec061b9fbe78e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/115160
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Yuly Novikov <ynovikov@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2022-12-20 16:51:34 +00:00
dawn-autoroll 1058e7aa50 Roll vulkan-deps from 3a484e08ceca to 28ede018d9d4 (5 revisions)
https://chromium.googlesource.com/vulkan-deps.git/+log/3a484e08ceca..28ede018d9d4

Changed dependencies:
* spirv-tools: cc81529f4b..5bec0884cf
* vulkan-loader: 96488e2b2e..bf28c824b8

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/vulkan-deps-dawn-autoroll
Please CC jrprice@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dawn: https://bugs.chromium.org/p/dawn/issues/entry

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: jrprice@google.com
Change-Id: I0497982edb19802538766b2bc55e35624b093bb3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/115046
Bot-Commit: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-12-20 07:47:36 +00:00
Austin Eng 5cc118bde7 Clear reference to MTLTexture on TextureView::DestroyImpl
Bug: dawn:1355
Change-Id: I834b02a05d50c39b1a8d272e2d437d7ce1f96fb5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/115061
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
2022-12-19 23:36:00 +00:00
Dawn Autoroller 13e48132c0 Roll SwiftShader from 67f520305136 to 3b2177fcfcba (1 revision)
https://swiftshader.googlesource.com/SwiftShader.git/+log/67f520305136..3b2177fcfcba

2022-12-19 sugoi@google.com Reland "Float only writeColor" only

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/swiftshader-dawn-autoroll
Please CC jrprice@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in SwiftShader: https://bugs.chromium.org/p/swiftshader/issues/entry
To file a bug in Dawn: https://bugs.chromium.org/p/dawn/issues/entry

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: jrprice@google.com
Change-Id: If6ec6570785e7c48ce3f0599604c50a40e1dbe8f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/115041
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2022-12-19 20:32:30 +00:00
Brandon Jones b38b3b0f8c Implement AlwaysResolveIntoZeroLevelAndLayer globally
Previously this toggle was implemented only for the Metal backend, but
a need for it was identified on Android as well. This change moves the
implementation to the backend-agnostic command encoder recording so that
it works for all backends. Fundamentally it's still doing the same
thing, however: Swapping resolve targets that point at a non-zero mip
level or layer with a temporary texture and then performing a copy once
the render pass has ended.

Bug: dawn:1569
Change-Id: I292860cc74f653b2880e727d2ef3a7dfa3f10b91
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106040
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-12-19 19:46:12 +00:00
Takahiro 915e55a0d8 Add Buffer.GetMapState()
Bug: dawn:1521
Change-Id: I68962a4d6b17867cd17cfcb3a17910a2007764fa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/111924
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Takahiro <hogehoge@gachapin.jp>
2022-12-19 19:06:51 +00:00
dawn-autoroll 5abda5fa2c Roll vulkan-deps from 29e87c1e6ee6 to 3a484e08ceca (2 revisions)
https://chromium.googlesource.com/vulkan-deps.git/+log/29e87c1e6ee6..3a484e08ceca

Changed dependencies:
* vulkan-headers: 63637cb1c6..00671c64ba
* vulkan-validation-layers: 081dc9e60f..df33af3b22

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/vulkan-deps-dawn-autoroll
Please CC jrprice@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dawn: https://bugs.chromium.org/p/dawn/issues/entry

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: jrprice@google.com
Change-Id: I667d9790fc571b32e879ea92d660b02cbfd7fb6b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/115060
Bot-Commit: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2022-12-19 18:41:36 +00:00
Ben Clayton ce93a6b224 tint: Replace type::UniqueNode::Hash() virtual with field
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>
2022-12-19 17:07:29 +00:00
Yuly Novikov ada5e7b0f9 Suppress WebGPU tests flaky on Win Intel UHD630 driver 31.0.101.2111
Seen on experimental bots since tests were enabled, e.g.:
https://luci-milo.appspot.com/ui/p/chromium/builders/ci/Dawn%20Win10%20x64%20Experimental%20Release%20(Intel)/588/overview
https://luci-milo.appspot.com/ui/p/chromium/builders/ci/Dawn%20Win10%20x86%20Experimental%20Release%20(Intel)/371/overview

Bug: None
Change-Id: I541cb895690ce2fa488d350735f6d0e73cd6b5d0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/115020
Auto-Submit: Yuly Novikov <ynovikov@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2022-12-19 16:24:27 +00:00
Corentin Wallez 20a6ca0041 generator_lib.py: Fix exception when racing for dir creation.
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>
2022-12-19 11:14:54 +00:00
Takahiro ad541a7cdd Immediate Buffer.MapAsync() rejection if pending map in Wire
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>
2022-12-17 04:24:05 +00:00
James Price 0fcc00e22a tint/uniformity: Fix debug graph output
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>
2022-12-17 02:21:36 +00:00
Ben Clayton 2f9a98870e tint: Implement sem::Load
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>
2022-12-17 02:20:04 +00:00
dawn-autoroll 57ca8cffa4 Roll vulkan-deps from c943ccc4d398 to 29e87c1e6ee6 (3 revisions)
https://chromium.googlesource.com/vulkan-deps.git/+log/c943ccc4d398..29e87c1e6ee6

Changed dependencies:
* spirv-tools: 5a78d798f7..cc81529f4b
* vulkan-headers: 75a6b83f21..63637cb1c6
* vulkan-validation-layers: 3784a0d8b8..081dc9e60f

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/vulkan-deps-dawn-autoroll
Please CC bclayton@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dawn: https://bugs.chromium.org/p/dawn/issues/entry

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: bclayton@google.com
Change-Id: Id31d7f905cdcebf6a4ea8a3aa35ca55b5ab1c006
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114880
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2022-12-17 00:55:16 +00:00
Yuly Novikov 241d9a2f9f Suppress some WebGPU tests with validation on Win Intel
Already suppressed without validation.
Trying to enable tests with validation in crrev.com/c/4097070

Bug: None
Change-Id: I40ae8d31d644140fa4e6df22b875c2f11e966b60
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114840
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Auto-Submit: Yuly Novikov <ynovikov@chromium.org>
2022-12-16 23:37:05 +00:00
Yuly Novikov 5a4f5dcf90 Skip dawn_end2end_tests failures on Win Intel Optiplex 7080 Vulkan
BindGroupTests.ArbitraryBindingNumbers/Vulkan_Intel_R_UHD_Graphics_630
QueryInternalShaderTests.TimestampComputeShader/Vulkan_Intel_R_UHD_Graphics_630

Bug: dawn:1615
Change-Id: I76d677157857dbc6ef7cb5ecbad6e37d2cc292e1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114620
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2022-12-16 20:26:52 +00:00
Antonio Maiorano bf8a230c81 tint: const eval of ldexp builtin
Bug: tint:1581
Change-Id: Ib21717065041b65a637f4d73ce0088544b1fce0d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114321
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-12-16 18:37:19 +00:00
Dawn Autoroller 9a8ca18d6d Roll SwiftShader from c70b46423fc4 to 67f520305136 (2 revisions)
https://swiftshader.googlesource.com/SwiftShader.git/+log/c70b46423fc4..67f520305136

2022-12-16 msisov@igalia.com fixup! remove use_system_libwayland
2022-12-15 msisov@igalia.com remove use_system_libwayland

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/swiftshader-dawn-autoroll
Please CC bclayton@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in SwiftShader: https://bugs.chromium.org/p/swiftshader/issues/entry
To file a bug in Dawn: https://bugs.chromium.org/p/dawn/issues/entry

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: bclayton@google.com
Change-Id: I9586755228f422238a11ad774d8e7700dd3ca142
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114727
Kokoro: Kokoro <noreply+kokoro@google.com>
Bot-Commit: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2022-12-16 18:12:49 +00:00
Austin Eng 04ad2a4c14 Add informational toggle that indirect baseVertex is broken on Mac Intel
Bug: dawn:966
Change-Id: I5f8183911eb04d4809c30cb7c1efdeca414f3329
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114662
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-12-16 18:10:06 +00:00
Austin Eng e48253f31e Add informational toggle that sample mask is broken on Mac Intel
Bug: dawn:1462
Change-Id: Ifec68914edb7d0f7eaf90e066491a0af3fe7b232
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114400
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-12-16 16:54:42 +00:00
Yunchao He 5082727e55 D3D12: Remove the 24K extra memory for texture corruption
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>
2022-12-16 16:46:12 +00:00
Ben Clayton 7c3e9a6dd2 tint: Rework tint::Manager
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>
2022-12-16 15:31:19 +00:00
dawn-autoroll 1438e82354 Roll vulkan-deps from 9449c7f77d1b to c943ccc4d398 (3 revisions)
https://chromium.googlesource.com/vulkan-deps.git/+log/9449c7f77d1b..c943ccc4d398

Changed dependencies:
* spirv-tools: 43c99b5ee0..5a78d798f7
* vulkan-validation-layers: e4a4c1653c..3784a0d8b8

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/vulkan-deps-dawn-autoroll
Please CC bclayton@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dawn: https://bugs.chromium.org/p/dawn/issues/entry

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: bclayton@google.com
Change-Id: Ia7eab3d2ea27e0fe66fa72655d9225b6de193f21
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114724
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Bot-Commit: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2022-12-16 11:38:44 +00:00
Brandon Jones 183df9d24e Implement External Texture Crop Functionality
Adds to the External Texture shader transform to allow cropping. Tests
included.

Bug: chromium:1316671
Change-Id: Id0ec9acac22a0968ba6847d6ead9cf5084eaca88
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/113281
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-12-16 05:41:06 +00:00
Ben Clayton 0be08d8b88 CTS expectations: Add KEEP on [ Skip ]'d rules
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>
2022-12-16 01:20:43 +00:00
dawn-autoroll 764429a8ed Roll vulkan-deps from 3f9a78474605 to 9449c7f77d1b (2 revisions)
https://chromium.googlesource.com/vulkan-deps.git/+log/3f9a78474605..9449c7f77d1b

Changed dependencies:
* spirv-headers: 70ff9d939c..34d04647d3
* vulkan-validation-layers: 2beda7f6bd..e4a4c1653c

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/vulkan-deps-dawn-autoroll
Please CC bclayton@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dawn: https://bugs.chromium.org/p/dawn/issues/entry

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: bclayton@google.com
Change-Id: I889d192c49de20ebf320d9f99fd71f2252c4469c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114642
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-12-15 21:59:10 +00:00
dan sinclair 02b466feb1 Move CreateComposite into ProgramBuilder.
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>
2022-12-15 21:56:32 +00:00
dan sinclair 19ebcb2230 Convert ir::Constant over to use a constant::Value
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>
2022-12-15 19:17:22 +00:00
David Neto dd1e4e39f2 Fix typo
Change-Id: I5b15e16c140dde600e83e4f48e2902963e948b46
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114560
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: David Neto <dneto@google.com>
2022-12-15 18:00:24 +00:00
Takahiro 5208edf37d Buffer.MapAsync pending map error non validation error consumed
Bug: dawn:1613
Change-Id: Ib1e5014d36c2c35d7ed9b946de4d21e046cf1282
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114280
Commit-Queue: Takahiro <hogehoge@gachapin.jp>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2022-12-15 16:44:18 +00:00
Stephen White 987902e795 Update GLSL test results.
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>
2022-12-15 16:42:28 +00:00
dan sinclair b53b8cf5be Rename constant::Constant to constant::Value.
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>
2022-12-15 16:25:31 +00:00
Dawn Autoroller 7bacdfab4c Roll ANGLE from e108858e6a10 to 2c60b86e3565 (8 revisions)
e108858e6a..2c60b86e35

2022-12-15 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 72727941e886 to 276f2cb5e838 (618 revisions)
2022-12-15 cnorthrop@google.com Capture/Replay: Regen/Restore shaders and programs
2022-12-15 angle-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from a7b8bd76ed0c to a87c64cdfe8d (7 revisions)
2022-12-15 cclao@google.com Vulkan: Remove Serial::valid() check
2022-12-14 syoussefi@chromium.org Vulkan: Use vkCmdClearAttachments for unmasked scissored clears
2022-12-14 enh@google.com [PATCH] Add riscv64 support
2022-12-14 syoussefi@chromium.org Vulkan: Remove GlslangWrapperVk
2022-12-14 syoussefi@chromium.org Vulkan: Move SPIR-V transform to vulkan/

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/angle-dawn-autoroll
Please CC bclayton@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in ANGLE: https://bugs.chromium.org/p/angleproject/issues/entry
To file a bug in Dawn: https://bugs.chromium.org/p/dawn/issues/entry

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: bclayton@google.com
Change-Id: I62757cc32d045611f2f125308eb5dd67961df353
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114481
Bot-Commit: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2022-12-15 10:58:42 +00:00
dawn-autoroll 6871af6095 Roll vulkan-deps from a7b8bd76ed0c to 3f9a78474605 (9 revisions)
https://chromium.googlesource.com/vulkan-deps.git/+log/a7b8bd76ed0c..3f9a78474605

Changed dependencies:
* vulkan-headers: 9b48e83ef8..75a6b83f21
* vulkan-tools: ffa89a4447..dda9ae0f91
* vulkan-validation-layers: 56e3ebda22..2beda7f6bd

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/vulkan-deps-dawn-autoroll
Please CC bclayton@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dawn: https://bugs.chromium.org/p/dawn/issues/entry

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: bclayton@google.com
Change-Id: Ic0f0f70fbc3ea4d3ba10f3e8e86b6a331f6497cb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114401
Bot-Commit: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-12-15 08:22:23 +00:00
Dawn Autoroller 0a67dd54eb Roll SwiftShader from fbcd60957174 to c70b46423fc4 (1 revision)
https://swiftshader.googlesource.com/SwiftShader.git/+log/fbcd60957174..c70b46423fc4

2022-12-14 sugoi@google.com Fix use-of-uninitialized-value issue for indexType

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/swiftshader-dawn-autoroll
Please CC bclayton@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in SwiftShader: https://bugs.chromium.org/p/swiftshader/issues/entry
To file a bug in Dawn: https://bugs.chromium.org/p/dawn/issues/entry

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: bclayton@google.com
Change-Id: I1acbb6c327c959aae218dfd1901c682f7d0ee317
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114440
Kokoro: Kokoro <noreply+kokoro@google.com>
Bot-Commit: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2022-12-15 06:18:26 +00:00
Yunchao He 69b7f4a61c Add more tests for texture corruption: msaa and depth stencil formats
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>
2022-12-15 00:52:53 +00:00
Brandon Jones 87a1724368 Improve draw-time bind group validation messages
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>
2022-12-14 23:44:11 +00:00
Ben Clayton ea1cc79cb8 tint/castable: Add Maybe() MaybeAnyOf()
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>
2022-12-14 22:38:43 +00:00
Ben Clayton 55ceebec1e tools/intrinsic: Fix validation for type matchers
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>
2022-12-14 21:18:23 +00:00
dan sinclair 5addefb148 Rename Constant::As to Constant::ValueAs.
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>
2022-12-14 20:46:32 +00:00
Ben Clayton 35842190ef tint/castable: Reformat comments (grow width)
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>
2022-12-14 20:27:31 +00:00
Dawn Autoroller 52f7826234 Roll ANGLE from 22d731145a30 to e108858e6a10 (9 revisions)
22d731145a..e108858e6a

2022-12-14 penghuang@chromium.org Reland "Workaround GetModulePath() returns incorrect path for exe in Chrome"
2022-12-14 syoussefi@chromium.org Vulkan: Threaded monolithic pipeline creation
2022-12-14 syoussefi@chromium.org Metal: Remove references to GLSLANG
2022-12-14 syoussefi@chromium.org Metal: Remove references to ShaderInterfaceVariableInfoMap
2022-12-14 angle-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from 66d1f426b724 to a7b8bd76ed0c (8 revisions)
2022-12-14 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 438de6cec0a1 to 72727941e886 (660 revisions)
2022-12-14 cnorthrop@google.com Revert "Workaround GetModulePath() returns incorrect path for exe in Chrome"
2022-12-14 cclao@google.com D3D: Remove ResourceSerial
2022-12-14 cclao@google.com Vulkan: Split Serial class into UniqueSerial and Serial

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/angle-dawn-autoroll
Please CC bclayton@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in ANGLE: https://bugs.chromium.org/p/angleproject/issues/entry
To file a bug in Dawn: https://bugs.chromium.org/p/dawn/issues/entry

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: bclayton@google.com
Change-Id: I019dbdc5e414c50f3c4b613e4063261f881da3c7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114243
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Bot-Commit: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2022-12-14 19:51:55 +00:00
dan sinclair 93c0ef2b33 Reduce default vec size in composite.
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>
2022-12-14 19:29:10 +00:00
dan sinclair 9268561678 Remove ImplResult.
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>
2022-12-14 19:23:48 +00:00