Commit Graph

7152 Commits

Author SHA1 Message Date
dan sinclair ff7cf21021 Rename StorageClass to AddressSpace.
This CL updates the internals to use AddressSpace instead of the old
StorageClass name.

Bug: tint:1404
Change-Id: Iecc208e839453437f4d630f65e0152206a52db7e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/104420
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
2022-10-03 14:05:23 +00:00
Brandon Jones da866181ab Don't advertise timestamp support on Qualcomm
The Android devices I've tested with Qualcomm GPUs (like the Pixel 4)
are exhibiting an issue where resolving timestamp queries after a
render pass is causing a crash. Until that issue can be resolved it's
safest to simply not advertise timestamp query support on these devices.

Bug: dawn:1559
Change-Id: Id76aa5095ffbb7f55579cc428388f55f4528581d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/104441
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2022-09-30 23:46:48 +00:00
Yunchao He 7a4072e3e3 Add extra layers to work around array texture corruption issue
This change works around the array texture corruption issue for
some Windows Intel devices on some old drivers. The number of
extra layer for a given texture is precisely calculated according
to texture memory layout on these devices.

It also adds one more test: clearTexture.

Bug: dawn:949, dawn:1507

Change-Id: I0b2a6497c77f3edf45c49220517e13be76c6b608
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103120
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
2022-09-30 17:57:38 +00:00
David Neto 82177da767 spirv-reader: add ColMajor decoration as needed for end2end
Add ColMajor decoration to matrix test cases that ultimately
become end2end test cases.

Corresponds to end2end test fix in
https://dawn-review.googlesource.com/c/dawn/+/103821

Change-Id: I30e9f706dcb935a6044ba650e5c9084363a1414b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/104400
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: David Neto <dneto@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2022-09-30 16:12:59 +00:00
Corentin Wallez be4b8cb4d1 Remove suppressions for passing tests.
Fixed: dawn:966
Change-Id: I852d2098030014c7ec750800462df95be2cc0417
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/104361
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2022-09-30 15:14:08 +00:00
Brandon Jones fdbc31f76b Fix Qualcomm render pass attachment bug
Works around a driver bug described in
https://developer.qualcomm.com/forum/qdn-forums/software/adreno-gpu-sdk/68949

Requires the pResolveAttachments member of a VkSubpassDescription to
explicitly be null if the number of color attachments is 0.

Allows the removal of multiple test suppressions related to
depth/stencil readback.

Bug: dawn:1558
Change-Id: Ia03c74a35cbb619b5968f649d41848f53378bf35
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/104183
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-09-30 04:19:18 +00:00
dawn-autoroll feb14eb761 tint: update spirv-tools and fix unittests
This should fix vulkan-deps roll into Dawn.

Change-Id: I3c6685fa140a5e7f6313c7420109864d7783ffed
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/104280
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-09-29 21:58:20 +00:00
Antonio Maiorano d909f2b9c5 dawn: Suppress tests that fail on ANGLE/SwiftShader
Fails roll of SwiftShader into Dawn. See crbug.com/dawn/1557 for
details.

Bug: dawn:1557
Change-Id: Ibe97f1c3083b1fe254dd935b4abfdfbea9e34050
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/104260
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-09-29 20:39:17 +00:00
dan sinclair 2bcade246a Update MSL generator to handle casts of packed types.
Currently in the MSL backend we cast int values to uint in order to get
the correct WGSL behaviour for over/under flow. This fails in the case
of host shareable buffers as they use `packed` types which need to get
cast to the non-packed version first.

Bug: tint:1677
Change-Id: I57b70abaa8ca614472a26d63f19c1aef2bd64668
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103986
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-09-29 19:44:58 +00:00
shrekshao d1a5f93630 Add maxBufferSize limit
Also emits a warning when create buffer size exceeds
the maxBufferSize limit during the deprecation period.

Bug: dawn:1525
Change-Id: I7b47ae5c85b116035fdcea8b68fb574c0a550729
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103660
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Shrek Shao <shrekshao@google.com>
Commit-Queue: Shrek Shao <shrekshao@google.com>
2022-09-29 19:02:11 +00:00
Antonio Maiorano 06844a5e24 tint/hlsl: remove [loop] attribute on all loops
I added the forcing of the "loop" attribute to all loops to address FXC
failing on uniformity errors related to gradients in loops. Since then,
Tint now implements UA and it recently became an error, so we no longer
need this hack. As a result, FXC is now better able to cope with loops
that it determines executes 0 times.

Most e2e tests are affected because so many use loops, but 27 tests that
were previously failing are now passing with this change:

tint/bug/tint/1538.wgsl.expected.fxc.hlsl
tint/bug/tint/1604.wgsl.expected.fxc.hlsl
tint/bug/tint/1605.wgsl.expected.fxc.hlsl
tint/unittest/reader/spirv/SpvParserCFGTest_ClassifyCFGEdges_LoopBreak_FromLoopHeader_SingleBlockLoop_TrueBranch.spvasm.expected.fxc.hlsl
tint/unittest/reader/spirv/SpvParserCFGTest_ComputeBlockOrder_Loop_HeaderHasBreakUnless.spvasm.expected.fxc.hlsl
tint/unittest/reader/spirv/SpvParserCFGTest_EmitBody_IfSelection_TrueBranch_LoopBreak.spvasm.expected.fxc.hlsl
tint/unittest/reader/spirv/SpvParserCFGTest_FindIfSelectionInternalHeaders_TrueBranch_LoopBreak_Ok.spvasm.expected.fxc.hlsl
tint/unittest/reader/spirv/SpvParserFunctionVarTest_EmitStatement_Phi_MultiBlockLoopIndex.spvasm.expected.fxc.hlsl
tint/unittest/reader/spirv/SpvParserFunctionVarTest_EmitStatement_Phi_SingleBlockLoopIndex.spvasm.expected.fxc.hlsl
tint/vk-gl-cts/graphicsfuzz/cov-dead-code-unreachable-merge/0-opt.spvasm.expected.fxc.hlsl
tint/vk-gl-cts/graphicsfuzz/cov-dead-code-unreachable-merge/0-opt.wgsl.expected.fxc.hlsl
tint/vk-gl-cts/graphicsfuzz/similar-nested-ifs/0-opt.spvasm.expected.fxc.hlsl
tint/vk-gl-cts/graphicsfuzz/similar-nested-ifs/0-opt.wgsl.expected.fxc.hlsl
tint/vk-gl-cts/graphicsfuzz/spv-load-from-frag-color/1.spvasm.expected.fxc.hlsl
tint/vk-gl-cts/graphicsfuzz/spv-load-from-frag-color/1.wgsl.expected.fxc.hlsl
tint/vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/0.spvasm.expected.fxc.hlsl
tint/vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-false-if-discard-loop/0.wgsl.expected.fxc.hlsl
tint/vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-fragcoord-less-than-zero/0.spvasm.expected.fxc.hlsl
tint/vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-fragcoord-less-than-zero/0.wgsl.expected.fxc.hlsl
tint/vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-fragcoord-less-than-zero/1.spvasm.expected.fxc.hlsl
tint/vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-fragcoord-less-than-zero/1.wgsl.expected.fxc.hlsl
tint/vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-with-loop-read-write-global/0-opt.spvasm.expected.fxc.hlsl
tint/vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-with-loop-read-write-global/0-opt.wgsl.expected.fxc.hlsl
tint/vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-with-loop-read-write-global/1.spvasm.expected.fxc.hlsl
tint/vk-gl-cts/graphicsfuzz/stable-binarysearch-tree-with-loop-read-write-global/1.wgsl.expected.fxc.hlsl
tint/vk-gl-cts/graphicsfuzz/write-red-after-search/0-opt.spvasm.expected.fxc.hlsl
tint/vk-gl-cts/graphicsfuzz/write-red-after-search/0-opt.wgsl.expected.fxc.hlsl

Bug: tint:1522
Bug: tint:1538
Bug: tint:1604
Bug: tint:1605
Change-Id: I530b846b6b8df122ab351ff7b85d3e1c9ac11526
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/104121
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-09-29 16:53:58 +00:00
Stephan Hartmann b764a15c23 libstdc++: replace bit_set::operator!= in ityp_bitset
C++20 removed the operator.

Bug: chromium:957519
Change-Id: Iba9c3fcdf4d7d3c4286b5f5dac86304faa6a0c02
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/104201
Commit-Queue: Stephan Hartmann <stha09@googlemail.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2022-09-29 15:02:38 +00:00
Alastair Donaldson 2af7ab3b16 Add missing operator to regex fuzzer
Fixes a problem where the regex fuzzer would identify '==' as a
candidate operator for replacement, but where the replacement code did
not actually handle the '==' case.

Fixes http://crbug.com/1367902
Change-Id: I9a3bda9e7bae5e42872f17427419ab690d477533

Change-Id: If9cbb2db779c6873ff7a02d132981e8ee3410bb1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/104200
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Alastair Donaldson <afdx@google.com>
2022-09-29 14:36:08 +00:00
Zhaoming Jiang 5e22e46a63 dawn E2E: Refactor and add non-struct-member tests in ComputeLayoutMemoryBufferTests
This CL refactor the end-to-end test suit ComputeLayoutMemoryBufferTests
and add tests for non-struct-member scalar, vector, matrix, and array of
vectors and matrices types. This test suit is also intend to test f16
buffer read/write after it is implemented.

Bug: tint:1673
Change-Id: Iea4d3f70897d196ea00e3a3e0189a0372afe0382
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/102800
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
2022-09-29 04:02:48 +00:00
Brandon Jones f4faccbbbd Suppressions for Mali and Adreno Android devices
Adds suppressions for multiple failures in the end2end tests that are
showing up on Pixel devices I'm able to test. Majority (800+) affect
the devices with Qualcomm GPUs (Pixel 4, Pixel 2, etc) and 8 affect the
newer Tensor devices (Pixel 6).

Bug: dawn:1549
Bug: dawn:1550
Change-Id: Ia598734a1752e5f086e4e79c96a799156d84e448
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103940
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2022-09-28 19:17:18 +00:00
Shrek Shao 3a329f2209 Re-enable ValidationAfterOverrideStorageSize test
Also move Robustness transform to pipeline creation time on Vulkan
backend.

Bug: tint:1660, dawn:1041
Change-Id: I10220f34119d11f29be86fd29463a282175eccdd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103780
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Shrek Shao <shrekshao@google.com>
2022-09-28 18:36:47 +00:00
Corentin Wallez 00aced1bbf Allow usage chromium_disable_uniformity_analysis
Only when unsafe APIs are allowed.

Bug: None
Change-Id: Idbe0494bec29bb623c0af39d3fb65d4995bb1a9b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/104100
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-09-28 17:55:27 +00:00
dan sinclair f9f583bfe4 Update align attribute to allow u32.
The WGSL spec has been updated to allow attributes to be i32 or
u32. This CL updates the attribute support in Tint to follow.

Bug: tint:1633
Change-Id: Ie6caa54f26a757c374c51c7d24e54d2a476f9c84
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103800
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-09-28 15:36:47 +00:00
Zhaoming Jiang f304f25e7d Dawn: fix default value of size in BindGroupEntry
This CL fix the missing default value WGPU_WHOLE_SIZE for
BindGroupEntry.size, and also add unit tests for using default offset
and size in BindGroupEntry when creating bind group.

Bug: dawn:1553
Change-Id: Ia9c426c0fff1eaea3a0b7c84e5528881199e2c4a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/104023
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2022-09-28 12:49:27 +00:00
Sunny Sachanandani 3194b4a31f d3d12: Signal fence after PIX Present
Calling ID3D12SharingContract::Present issues GPU work on the command
queue which needs to be synchronized with resource deallocation. This
seems to work now perhaps due to the keyed mutex semantics keeping the
D3D11 texture alive for longer than necessary. With fences, this missing
synchronization causes the validation layers to complain about early
deallocation of the ID3D12Resource.

Moving the Present to SynchronizeImportTextureBeforeUse ensures that it
happens before NextSerial and hence the signal fence that's recorded
will include any GPU work issued by Present. Also, resource deallocation
will happen after this work. However, this has the side-effect of PIX
seeing more frames, once per ExecuteCommandLists, but it could be argued
that's more accurate and useful.

Bug: dawn:1544
Change-Id: I1b417049045a812837f67072d7f09ac47bc18125
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103841
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
2022-09-28 00:58:46 +00:00
dan sinclair a33bc2c6f2 Add some GLSL zero initialization tests.
This CL adds tests for GLSL zero initialization of an array, array of
arrays and array of structs.

Bug: chromium:1367602
Change-Id: I4246512f9238dcccc02c9c181b7a211958491dad
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103880
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
2022-09-27 20:44:06 +00:00
dan sinclair 764a2abc90 Have DeepestElementOf always return a type.
Currently deepest element only returns the type if it was a scalar
or the element of a vector, array or matrix. Otherwise it would
return `nullptr`. There are cases where we want to get the deepest
type which is a struct or some other type.

This Cl updates ElementOf to return the type instead of nullptr for
types which previously returned nullptr.

Change-Id: I7963d4ce55d2e2b1a537a7533fa332813eed035c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103900
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-09-27 19:20:06 +00:00
dan sinclair cb41b8f97f Convert `align` attribute to expressions.
This CL updates the align attribute to parse expressions.

Bug: tint:1633
Change-Id: I5412180ff62e6b286b35ea3297e2b4f136899960
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/102841
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-09-26 15:54:55 +00:00
Ben Clayton 4c70d7fff2 tint: Make uniformity analysis failures a hard error
These have been warnings for multiple months.
Time to properly turn this on.

Bug: tint:880
Change-Id: I3b38f672309b5acd48c12a38dc5a1675f3c62470
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103480
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2022-09-26 12:30:05 +00:00
Corentin Wallez 03199c2b44 Protect against aspectReadOnly of unused DS attachements aspects
Unused aspects of depth-stencil attachments that are tagged as read-only
used to leak that read-only state to backends, even if the validation
made it seems like they always match (they only need to match if the
texture has both aspects). This confused backends like Vulkan which
checked for depthReadOnly || stencilReadOnly to choose between code
paths.

Instead reyify the depthStencilAttachement descriptor in the frontend to
protect against garbage values being passed for aspects that aren't
present in the texture.

Adds a regression test, with the caveat that a failure is only shown by
having the VVL output and error in stderr due to an unrelated issue.

Fixed: dawn:1512
Change-Id: I35d5581e46909b7f41ff4c7553d60c6ac844a56b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/101121
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-09-26 11:13:35 +00:00
Corentin Wallez ab882c17a5 Vulkan: Fix incorrect barriers for T2T copies of DS.
T2T copies for depth-stencil formats where done one by one. Because
the two per-aspect copies where submitted with no barriers in between
them, incorrect synchronization could occur, making the end state of the
destination texture incorrect.

Fix this by using the combined aspects of the texture to perform copies,
such that depth stencil are copied in a single command instead of two
commands.

Unfortunately the VVLs don't catch this issue, but the reporter of the
issue confirmed that this commit fix the dawn_end2end_tests failures
they were seeing.

Fixed: dawn:1514
Change-Id: I2e1c5f8d9aabeb0119364d26c9d66d0763cfadcf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103421
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
2022-09-26 11:07:25 +00:00
Antonio Maiorano 5f33facbc1 tint: const eval of binary left shift
Bug: tint:1581
Change-Id: I8c1b01bcae2a205e712b8004573cc26a3366785a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103061
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2022-09-23 21:58:29 +00:00
Yunchao He ef6696089d D3D12 Intel: change the driver version for array texture corruption issue
The previous driver version I got from Intel driver team is
not correct. That driver does contain the fix but it is not the
first version with the fix.

Bug: dawn:949, dawn:1507

Change-Id: I0044a181e4266b50f77734bbbf9cc8755a8334d9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103502
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-09-23 16:03:37 +00:00
Corentin Wallez 05e7332ac8 Rework how combined aspects are handled in TextureVk
At the moment the computations to decide whether aspects should be
combined are executed on every call related to aspect in TextureVk.
These computations never change and can be computed once at the creation
of TextureVk and reused at runtime.

This is meant to be a noop change as a slight rework prior to fixing
depth-stencil T2T copies no using the combined aspects.

Bug: dawn:1514

Change-Id: I1177cdcf42d072bb2bc2c3a2f149dc480fe79f2f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103420
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-09-23 09:56:06 +00:00
Sunny Sachanandani 85e6337027 d3d12: Move NextSerial out of ExecuteCommandList
Reverts to the code flow before fences were implemented. NextSerial is
now the reponsibility of the caller of ExecutePendingCommandContext like
it was before. We now use GetPendingCommandSerial to store the signal
fence value instead of GetLastSubmittedCommandSerial and check that the
signal fence value was submitted in EndAccess.

Bug: dawn:576
Change-Id: I616840a0932ec17f77fcab38058773006dfae32f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103501
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Auto-Submit: Sunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-09-23 00:52:56 +00:00
Jiawei Shao 5a0f8d32a2 Support optional query on adapter power preference
This patch adds DawnAdapterPropertiesPowerPreferenceDescriptor for
querying adapter power preference which is useful to distinguish
different logical adapters created on same physical device but with
different power preferences.

Bug: dawn:1516
Test: dawn_unittests
Change-Id: I12ed6e370f8b57c860520154565765f0ee894831
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/102780
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2022-09-23 00:29:46 +00:00
Loko Kung 3354bf0d91 Add cleanup when encoding indirect draw validations.
- Cleanup is necessary because otherwise encoded render commands may be
  leaked if the validation encoding fails. (The leaked render commands
  can then trigger an assert in ~Device::Cache because the commands can
  hold a ref to an AttachmentState that was not destroyed, and hence
  still be in the device cache.
- Added explicit check in EncoderIndirectDrawValidationCommands for
  device 'alive-ness' since it may create new objects later and hit the
  same error later on anyways.
- Added regression test.

Fixed: chromium:1365011
Change-Id: I342479a4227fc43d82ea35f662d049e6db2b1740
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103340
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-09-22 23:45:36 +00:00
Ben Clayton c4ebf2cc57 tint: Implement textureSampleBaseClampToEdge
Fixed: tint:1671
Change-Id: Iaae5b5d571a4401c0255de727245bf8dbbe06740
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/102642
Reviewed-by: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-09-22 22:59:16 +00:00
dan sinclair 78f8067fd5 Fix overrides in array size.
This CL fixes the usage of overrides in array sizes. Currently
the usage will generate a validation error as we check that the
array size is const.

Bug: tint:1660
Change-Id: Ibf440905c30a73b581d55b0c071b8621b61605e6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/101900
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: dan sinclair <dsinclair@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2022-09-22 22:28:21 +00:00
Austin Eng 534a198f88 Validate that the device is alive when wrapping external images
Will be tested in Chromium's webgpu_mailbox_unittest.cc

Bug: chromium:1359106
Change-Id: I8a9bf01cd593f2835e2876fa04139fd3afda9b2e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103462
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-09-22 22:10:56 +00:00
Takahiro d4dd547bae Implement "rg11b10ufloat-renderable" feature
Implement "rg11b10ufloat-renderable" feature that allows
the RENDER_ATTACHMENT usage on textures with format
"rg11b10ufloat", and also allows textures of that format
to be multisampled.

Bug: dawn:1518
Change-Id: I4109dc0e9d90f4c0803219292edea554927a187a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/102000
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-09-22 16:38:06 +00:00
Li Hao cbd3ef4bb9 Suppress TimestampQueryTests.ResolveTwiceToSameBuffer/D3D12 on Intel Gen12
This is a D3D driver regression on Intel Gen12 GPUs, the test could pass
on old driver version and pass with disable_timestamp_query_conversion
toggle on latest driver.

Bug: dawn:1546
Change-Id: I8cf63824d5147bb78f53a284cada8efdc653a3ce
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103380
Commit-Queue: Hao Li <hao.x.li@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-09-22 09:52:35 +00:00
Ben Clayton 490d9889a7 tint: Simplify workgroup size resolving
A `@workgroup_size()` value must be a constant or override expression.
There's nothing specific here about literals or variable expressions.

Remove the semantic tracking of override variables, as these can be override expressions.
The backends will require the `SubstituteOverride` transform to be run, so gut the workgroup_size override handling from the backends.

Bug: tint:1633
Change-Id: Ib3ff843fc64a3595d49223c661b4d58130c0ab30
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/100142
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2022-09-21 21:05:45 +00:00
Austin Eng 45a2c5193a Return false from IsTextureSubresourceInitialized for error textures
Otherwise, callers of this method will hit an ASSERT for error
textures.

Bug: chromium:1359106
Change-Id: I2602d209d837b3b27916221578f9ac4041f8848b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103281
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-09-21 20:18:30 +00:00
Ben Clayton f92830b623 dawn: Enable OpenGLBackend for ComputeLayoutMemoryBufferTests
The layout issues should now be fixed with the Std140 transform.

Bug: dawn:942
Change-Id: I714c2edb39f27b39f66c1e913f22232ad7908896
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103000
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
2022-09-21 18:13:14 +00:00
Brandon Jones 773800b68d Reland "Implement maxBindingsPerBindGroup limit"
This is a reland of commit 4d67a883b6
Underlying issue fixed in https://dawn-review.googlesource.com/c/dawn/+/102461

Original change's description:
> Implement maxBindingsPerBindGroup limit
>
> Bug: dawn:1523
> Change-Id: Ifcf83f6836a5d7ed447080ccb033e4163970432e
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/100706
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
> Reviewed-by: Austin Eng <enga@chromium.org>
> Kokoro: Kokoro <noreply+kokoro@google.com>
> Commit-Queue: Brandon Jones <bajones@chromium.org>

Bug: dawn:1523
Change-Id: If0824b6f8fcb7c152feceb95a2709d0a3b8ce582
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103280
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-09-21 17:42:24 +00:00
Ben Clayton 4953dabab7 dawn/tests: Remove OverridesWithZeroDefault test
It's not invalid to have create a shader module using zero-defaulted `override`s as workgroup size parameters.
These can be initialized with non-zero pipeline override values.

Bug: dawn:1504
Change-Id: I2636cbe2d26a6604735b0c8b0f5526bbc14e8ce2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103220
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-09-21 16:42:34 +00:00
dan sinclair 1662f5578e Fixup some grammar.
This Cl updates some double negative grammar to be a bit more readable.

Change-Id: Id5d9c64acc1dd8422b8116d8a6c1bf149f99e592
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103260
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>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-09-21 14:44:33 +00:00
Corentin Wallez 30f51b94da Delete the remove_stale_autogen_files mechanism.
Previously when moving around directories for generated files, Dawn ran
into an issue where stale files where #included instead of the new ones,
causing compilation failures. To get around this a
remove_stale_autogen_files mechanism was added that scans the gen/
directory for files not in an allow-list of directories.

This mechanism is now causing problems for bringing up Dawn standalone
tests on Android as these test also generate files in Dawn's gen/
directories, and their files get deleted by remove_stale_autogen_files.

We are not foresseing any additional shuffling of directories and it's
safe to expect that all stale files have been removed from CI builder
caches at this time. So remove_stale_autogen_files can go. This is what
this CL does.

Fixed: dawn:1543
Change-Id: I7dbf1eae6c55b7659f3837b6d4a565052001ce57
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103040
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-09-20 17:28:33 +00:00
Corentin Wallez eebb7d5e52 Fix leak of the eager exportable VkSemaphore.
Exporting an exportable VkSemaphore doesn't implicitly destroy the
VkSemaphore object. So instead of Detach()ing the VkSemaphore when it is
first consumed, just let it go out of the scope and be destroyed with
RAII. This also fixes the RAII by not destroying the VkSemaphore
immediately and instead wait until it becomes unused.

Found by running dawn_end2end_tests with the VVLs.

Bug: chromium:1258986
Change-Id: I858839b3094eee0f575c07a8f18504680afb53e3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103024
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2022-09-20 17:02:32 +00:00
Corentin Wallez 1d100e4270 Dedent OnDebugUtilsCallback
While trying to debug why VVL failures don't cause test failures I
reworked this code a little bit. There is not CL that fixes the
behavior, but the code is marginally better with less indentation so
here's a CL to check that in.

Bug: None
Change-Id: I6fc460c4b4b7959ae405219615a03230bfb9847a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103022
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-09-20 16:01:31 +00:00
Corentin Wallez 9a6ca2878e Fix deprecation warnings of module-scope lets
By promoting them to "const" as the deprecation warning suggests.

Bug: None
Change-Id: I7110b8d38754a0785d7fd56343c2c905dc491e1a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103023
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-09-20 15:58:27 +00:00
David Neto 7d9140feb9 spirv-reader: Refactor tracking of locally-defined values
Based on suggestions from bclayton to use std::optional

Change-Id: I372472dbd5e239713eee5c2ec6ae6ea05fc384fa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/102660
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-09-20 15:37:19 +00:00
Corentin Wallez 6270ea7675 Suppress unnecessary VVL warning.
WebGPU allows having fragment outputs that don't match any attachments
so suppress this warning from the VVLs.

Bug: None
Change-Id: I49d3d876fdbc9e25ff71fd763593c7d810cb248c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103021
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-09-20 14:40:22 +00:00
Corentin Wallez 19826c30c1 Update the matchers for skipped VVL messages
The casing of some of the messages was updates in the Vulkan Validation
Layers which made the suppression in the Vulkan backend not match
anymore.

Bug: dawn:1225
Change-Id: I58c23986dce96453ded5b573bccee0ec90dcad91
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103020
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2022-09-20 14:05:42 +00:00