Commit Graph

3402 Commits

Author SHA1 Message Date
Alexander Vestin f2556ab35c Initial Android surface
Bug: dawn:286

Change-Id: I50b45706f031254ac5beba5c07c3c4c3d7f9ea12
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84200
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-03-25 13:18:46 +00:00
Jiawei Shao 59f4320f83 Add missing space in the description of Toggle::DisallowSpirv
BUG=chromium:1214923

Change-Id: Iac9dce87c86c38175f9081de9fc8611a3b0040f5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84800
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-03-25 07:08:07 +00:00
Yuly Novikov 1e988b417c Ignore VUID-vkCmdDraw-None-06538 VVL message
To get vulkan-deps roll going

Bug: chromium:1310052
Change-Id: Ia47aa9a486256a9b3c96b90a66cd39bd2ec7c155
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84724
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-24 23:54:36 +00:00
Corentin Wallez 0bf63577d2 Implement the stencil8 format.
Rolled in changes made by cwallez@ as part of
https://dawn-review.googlesource.com/c/dawn/+/75983, which was
originally based on this change.

Bug: dawn:666

Change-Id: I5d6ad592294ee8302f3b18f7f31bbfd982297251
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68280
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2022-03-24 17:54:56 +00:00
Austin Eng cbdde604b8 Fix ForceSetToggle to only warn when an overriden toggle is forced
The condition was partially wrong, causing lots of spurious warning
messages when the default toggle (not user override) was forced to
another value by the backend.

Change-Id: Ie69e275fa3d4ceaeb7c3379dfdc8d8cbb91cf04a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84601
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-24 16:01:55 +00:00
Loko Kung a9386f3060 Fixes popErrorScope to match the specs.
- Prepares for removal of unnecessary bool return, and just call callbacks appropriately. For now always returns true until all users are updated.
- Removes PushErrorScope from handwritten commands now that we no longer need to do anything special.
- Updates tests to reflect the change and make sure to set EXPECTs before calling functions to make tests easier to follow.

Bug: dawn:1324, dawn:526
Change-Id: I90b09c54f9adbf2d6d50ad20dcedf68b5ed0b1fa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83942
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-22 14:45:34 +00:00
Brandon Jones c86f28cb84 De-duplicate ExternalTexture Dummy Textures
Avoid recreating 1x1x1 dummy textures for single-plane external texture
by just caching one and reusing it.

Bug: dawn:1082
Change-Id: Ia1fc3520a1b503d4491a256353277400ba90f344
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80462
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
2022-03-21 19:02:53 +00:00
James Price 3b5415f53a Remove usages of the @stride attribute in tests
Support for @stride is about to removed from Tint.

Bug: tint:1381
Change-Id: I6e30ed67d61ab82fd50843caf14216274b1e05fe
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83960
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
2022-03-21 16:48:23 +00:00
Loko Kung 4d8352542a Adds strformat code-gen for helping auto-generate readable strings for structs.
- Adds generator infra for absl::StrFormat for bind group structs and types.
- Uses absl::ParsedFormat to avoid multiple parsing for format strings.

Bug: dawn:549
Change-Id: Ida4ca65eb85c4474c492161c8ae34f53bd692a3c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81944
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-03-19 00:21:48 +00:00
Brandon Jones 39c2029063 Allow CopyBufferToTexture with Depth16Unorm
Removes the validation logic that was blocking this copy from being
valid and update tests to ensure that it works properly.

Copy logic worked with this format as-is, so no updates were necessary.

Bug: dawn:1251
Change-Id: Id0ca503ed0f82e79e75f63ad6870389f7f647d22
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81024
Reviewed-by: Shrek Shao <shrekshao@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-18 20:40:08 +00:00
Antonio Maiorano 67efacb67f Fix CMake build
Change-Id: I765fa78a47861cdb4445211a437a34ae2a189bda
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83940
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2022-03-17 15:24:47 +00:00
Loko Kung 2391382b14 Implements a cache key serializer and tests.
- Introduces necessary infra to support cache key serialization templating and extensibility.
- Tests cover basic use cases of the infra.

Bug: dawn:549
Change-Id: Idc0bbcb07a3037e9c59841bb3ad7d1040d7b401f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83121
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-03-17 00:27:26 +00:00
shrekshao ed840583eb Relax vertex stride requirement
Relax validation of last stride of vertex buffer according to the
updated spec.

Bug: dawn:1287
Change-Id: I7a58401933b48c5cb121ba73c592575ada3e7151
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83203
Auto-Submit: Shrek Shao <shrekshao@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-11 01:09:02 +00:00
Shrek Shao 5b9b9867cd Rename SurfaceDescriptorFromXlib -> SurfaceDescriptorFromXlibWindow
As suggested by
https://github.com/webgpu-native/webgpu-headers/pull/150#discussion_r822311773

Bug: none
Change-Id: I4f611a1c345eb644168cf923c6c0c1672114b9d9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83201
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
2022-03-09 19:04:21 +00:00
Austin Eng 74d4e53fc6 Make loapOp/storeOp undefined valid
It is valid for depth/stencil attachment if the attachments are
readonly. It is not valid for color attachments. Make the enum valid,
and update validation.

Caught in CTS roll
https://chromium-review.googlesource.com/c/chromium/src/+/3499286

Bug: dawn:1269
Change-Id: Ib849ed757ccca145f85cadea6f92a1f2a5082d49
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/82540
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-09 18:43:51 +00:00
Austin Eng 154bcbbf4d Metal/GL: Make new texture view for non-2D view of single-layer texture
Fixed: dawn:1309
Change-Id: Ide68f6498fc5fe9dd9e06c6c5caf7d3fff74e526
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83060
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-09 01:07:20 +00:00
Austin Eng 5073fb5685 Fix BindGroupLayoutEntry validation message for no bindings types set
Fixed: dawn:1318
Change-Id: I9c5953d77c9758f0814fa50a98f5f813daf5e705
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83061
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-09 00:07:31 +00:00
Austin Eng 1a73be4107 Update shader validation message to reflect new @ binding syntax
Fixed: dawn:1317
Change-Id: Ib8eb4068ae9c52513945a51fe0a7a88a6e3fa43e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83062
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-09 00:06:30 +00:00
Austin Eng 4f1596134e Use GetInternalUsage in vulkan::TextureView::Initialize
We need to consider the real usage the texture was allocated as, not
the public API usage.

Fixes VVL violation in canvas_composite_alpha_bgra8_unorm_opaque_copy
CTS ref test.

Bug: chromium:1083478
Change-Id: I4461458f98750c1632b823536ff3846a9b31796b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83041
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-09 00:05:40 +00:00
Shrek Shao 1554a7d8f9 Fix dawn.json for upstream webgpu-headers
- Add disabled_tags 'dawn' to webgpu_headers_gen
- Rename WGPUSurfaceDescriptorFromXlib to sync with upstream
- Other sync with upstream: surface wayland and android enums

Bug: dawn:269
Change-Id: I5ca5c5362c54018f9d217af6a6ab4e3e84a5d780
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83000
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
2022-03-08 20:56:10 +00:00
Jiawei Shao 345bf87c35 Vulkan: Use Zero Initialize Workgroup Memory extension if possible
This patch adds a toggle to enable/disable workgroup memory
initialization with OpConstantNull according to the Vulkan extension
VK_KHR_zero_initialize_workgroup_memory. This toggle is by default
enabled when VK_KHR_zero_initialize_workgroup_memory is supported by
the Vulkan driver.

BUG=dawn:1302
TEST=dawn_end2end_tests

Change-Id: Ie04484c2d0944ead082bd22a436b1c52bc7d93bb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/82400
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2022-03-08 02:23:19 +00:00
Austin Eng ea287f5b48 Remove WGSL readonly-storage to storage binding type promotion
Fixed: dawn:1188
Change-Id: Ied8e1fb8a47884456de3d56e049a361fdbcaf640
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/82403
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-05 01:37:25 +00:00
Shrek Shao 6d205fcb5d Allow sparse color attachments
Add implementations and related tests reflecting the spec update.

Bug: dawn:1294
Change-Id: I2c20af313259e1d6d6049189cb8adebe4c2436af
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81922
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
2022-03-05 01:34:02 +00:00
Li Hao 131c422489 Add timestampWrites on render/compute passes
The timestampWrites in render/compute pass descriptor store the
timestamps at the beginning and end of passes, this requires validating
all timestampWrite members in BeginXxxPass and inserting the
timestampWrite cmd as close as possible to the BeginXxxPass and
EndXxxPass. To do that, we first record only the querySets and
queryIndexes that need to be used in BeginXxxPassCmd and EndXxxPassCmd,
then insert timestampWrite cmd after the native BeginXxxPass and before
the native EndXxxPass in backends.

This CL adds timestampWrites in render/compute pass descriptor
including the validation and tests first.

Implement timestampWrites in backends in following CL.

Bug: dawn:1250

Change-Id: I39b50975aa03cc1afe7a736c3b39df284f54d163
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/82100
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2022-03-05 01:22:52 +00:00
Ben Clayton db8666fa71 Roll WebGPU IDL, update dawn/node bindings.
Bug: dawn:1123
Bug: dawn:1286
Change-Id: I3ffeea82fda381905ee8f02f9f2768c81c7e6d6d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79761
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2022-03-03 21:13:51 +00:00
Loko Kung ba70fac14d Extends current CachedObject interface to allow setting and getting cache keys.
Bug: dawn:549
Change-Id: I52d9321207d67b0214a52acc75456ee8d7943e8c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81943
Reviewed-by: Shrek Shao <shrekshao@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-03-03 20:08:22 +00:00
Austin Eng cab7419338 Vulkan: Skip newLayout transition on import if not specified
Fixes vulkan validation layer assertions on Linux in CTS reftests:
 canvas_complex_bgra8unorm_copy.https.html
 canvas_size_different_with_back_buffer_size.https.html

Bug: chromium:1083478
Change-Id: I36580184d15fe36423e5f759eaf959191c6b571c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/82480
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-02 23:28:17 +00:00
Shaobo a24acf2fbc Validate destination texture states for CopyTextureForBrowser
Current implmentation of ValidateCopyTextureForBrowser has a bug
to verify destination texture states.
This CL fix the simple bug and add noop copy in unittest to catch this
issue.

Bug: dawn:1306
Change-Id: I193105ced89db5092873d604c7dbf43d7ea4fba0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/82101
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2022-03-02 02:44:01 +00:00
Loko Kung 44f039d3c2 Adds new chained struct for device creation to specify cache options.
- Adds isolation key option, DawnNative support, and relevant unit tests.

Bug: dawn:549
Change-Id: I16344581c7956ce8576c0a4c14655fbdb4e15a54
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81920
Reviewed-by: Shrek Shao <shrekshao@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-03-01 22:59:40 +00:00
Yang Gu 6a9f9bd1ff Skip the check of maxFragmentCombinedOutputResources for Mesa llvmpipe driver
The Mesa Gallium llvmpipe driver is a software rasterizer that uses LLVM
to do runtime code generation. It seems to put incorrect value for
maxFragmentCombinedOutputResources, like we see on desktop GPUs.

Some relative values are as below.
vkLimits.maxFragmentCombinedOutputResources: 8
kMaxColorAttachments: 8
baseLimits.v1.maxStorageTexturesPerShaderStage: 4
baseLimits.v1.maxStorageBuffersPerShaderStage: 8

This CL will skip the check of this limit on llvmpipe, like we did for
desktop GPUs.

BUG=dawn:1311
Change-Id: I1698f6e26dd62b56f3819980fa2dcc986c9c5ba3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81941
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Hao Li <hao.x.li@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-02-25 18:30:47 +00:00
Jiawei Shao ec3e4b0510 Fix use-after-free issue in Create*PipelineAsyncTasks::Run()
This patch fixes a use-after-free issue in Create*PipelineAsyncTasks
that when pipeline->Initialize() returns error, the pipeline object
will be deleted, while we still attempt to call its member function
after it is deleted.

BUG=dawn:1310
TEST=dawn_unittests

Change-Id: I57d5ca98d6c97b14df1d7c3bf2941c9cc87adeff
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81800
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-02-25 16:28:39 +00:00
Jiawei Shao a84791a955 Ensure non-renderable formats don't support multisampling
This patch removes the support of multisampling on the below 4
formats as they are not renderable according to the discussions at
https://github.com/gpuweb/gpuweb/issues/2465.
- R8Snorm
- RG8Snorm
- RGBA8Snorm
- RG11B10Ufloat

BUG=chromium:1299154, dawn:1244
TEST=dawn_unittests

Change-Id: I3837f2aee322a71c90772322dc01fae410f03e57
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81801
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-02-24 17:46:46 +00:00
Shaobo 6084407b21 Change texture state validation in CopyTextureForBrowser() to report meaningful errors
CopyTextureForBrowser() will support all uploading paths for WebGPU
CopyExternalImageToTexture(). The validation checks for texture states
should report accurate errors to meet CopyExternalImageToTexture() validate
rules.

Bug: dawn:1306
Change-Id: Ie3b25ec82246d53e6c82968b5dc2f8a253c560c1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81240
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
2022-02-24 02:26:26 +00:00
Li Hao 7abcadfce6 Add toggle to disable the tick->ns conversion of timestamp query
Although the error rate of timestamp tick->ns conversion is very small
(3e-5), some profiling scenarios, such as CPU/GPU timestamp calibration
on Windows, require absolutely accurate timestamps.

Add new toggle to resolve timestamps to ticks for those cases where zero
error is required.

Add an end2end test for GPU timestamp calibration on D3D12 backend.

Disable timestamp period calculation on Device when the
DisableTimestampQueryConversion is enabled.

Bug: dawn:1305
Change-Id: I31ee6b4c1686d5dd2ac29ccb0bd398e650481c26
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81023
Reviewed-by: Shrek Shao <shrekshao@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-02-23 17:50:35 +00:00
Ryan Harrison b3e6d37055 tint->dawn: Shuffle tint repo layout
BUG=tint:1418

Change-Id: Iee47f1846be63bbd829067b3d818d2603647d4e6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80481
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
2022-02-21 17:56:32 +00:00
Jiawei Shao 68d44a7006 Add validations on the format of a resolve target
This patch adds the validations on the format of a resolve target
according to the latest updates in WebGPU SPEC. WebGPU SPEC only
supports the below texture formats being used as the resolve target
of a render pass encoder:
- R8Unorm
- RG8Unorm
- RGBA8Unorm
- RGBA8UnormSrgb
- BGRA8Unorm
- BGRA8UnormSrgb
- R16Float
- RG16Float
- RGBA16Float
- RGB10A2Unorm

BUG=dawn:1244
TEST=dawn_unittests

Change-Id: I16f9c3984f4ffb4641f4f43ecdb3cc76be6a562a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81080
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2022-02-19 02:53:32 +00:00
Brandon Jones 6e8c473fa5 Updating names of attachment clear values
Renames multiple attachment clear values to match their new names in the
spec, deprecating the old ones.
 - GPURenderPassColorAttachment.clearColor -> clearValue
 - GPURenderPassDepthStencilAttachment.clearDepth -> depthClearValue
 - GPURenderPassDepthStencilAttachment.clearStencil -> stencilClearValue

Additionally, the old names are marked as deprecated with appropriate
warnings if they are used during the deprecation period.

Bug: dawn:1269
Change-Id: I6649184d65578118942c1f51a41f350719665272
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80941
Reviewed-by: Shrek Shao <shrekshao@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2022-02-19 00:44:12 +00:00
Yan,Shaobo 893889b0bb CopyTextureForBrowser(): Validate src/dst texture state
The validation of CopyTextureForBrwoser() fails to valid src and dst
texture state. And a bug has been caught by cts
webgpu:api,validation,queue,copyToTexture,CopyExternalImageToTexture:destination_texture,state:*
after changing CopyExternalImageToTexture() to use CopyTextureForBroswer()
to upload CPU resource.

The CL fix this.

Bug: dawn:1306
Change-Id: Ie4cfd174dc9f54f6cf2099226c4e1cc00ed1d446
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80900
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2022-02-18 06:26:11 +00:00
Brandon Jones df70004c52 Add Validation For External Texture Bind Group Layout Mismatch
Adds validation to ensure that external texture binding entries match
the bind group layout. This should fix an issue found by the fuzzer.

Bug: dawn:1082
Bug: chromium:1296935
Change-Id: I1cc542ed9105dbe29d775e01e52475a7d6c8d393
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80460
Reviewed-by: Loko Kung <lokokung@google.com>
Auto-Submit: Brandon1 Jones <brandon1.jones@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-02-17 19:20:31 +00:00
Li Hao a73050795e Fix QueryInternalShaderTests
1. The left cases will be not checked if the first value is 0 in Check
function.
2. All timestamps are the same value at initialization.
3. Update 83.33 to 83.333 which is closer to the actual period on Intel.

Bug: dawn:1250
Change-Id: I7378cf45453682a3d364b6930072ccc229085f0c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80901
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-02-17 16:12:41 +00:00
Jiawei Shao ab1a2b7407 Add validation on format when creating a multisampled texture
This patch adds the validation on the texture format when we create
a texture with sample count > 1 according to the latest updates in
WebGPU SPEC.

Below formats can't be used to create a multisampled texture:
- R32Uint, R32Sint, RG32Uint, RG32Sint, RG32Float, RGBA32Uint,
  RGBA32Uint, RGBA32Sint, RGBA32Float
- All compressed formats
- RGB9E5UFloat

BUG=dawn:1244
TEST=dawn_unittests

Change-Id: I71743281ce12158be4b1904732934fad95f39cee
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80240
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2022-02-17 00:48:26 +00:00
Christopher Cameron be72f76c23 Expand GetFormatEquivalentToIOSurfaceFormat
Add support for IOSurface formats for:
- RGBA16Float
- RG16Float
- R16Float
- RGB10A2Unorm

Bug: chromium:1241369
Change-Id: I8d3ed2c7575fe651406cb470383f3d4d23fb7aeb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80820
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: ccameron chromium <ccameron@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2022-02-16 20:38:50 +00:00
Austin Eng 15bc24eeb8 Don't try to load libvulkan on Mac
Only SwiftShader would be available on Mac.

Bug: chromium:1297154
Change-Id: I943a39dfdde4215ba0ea880bf08294f37f08ee42
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80720
Reviewed-by: Shrek Shao <shrekshao@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-02-16 17:32:20 +00:00
James Price 0fe8d27903 Roll Tint and update WGSL syntax for overrides
The syntax for pipeline-overridable constants has changed in
WGSL. Since this feature is still hidden behind the
disallow-unsafe-APIs flag in Dawn, we removed support for the old
syntax in Tint. This commit rolls Tint forward to get that change, and
updates the WGSL syntax in affected tests at the same time.

Bug: tint:1403
Change-Id: I1d081d9dea0c1de9def5cd123020700df3419f35
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80500
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2022-02-15 18:36:10 +00:00
Austin Eng 7a8006033a Add additional guards in counter set feature checks
- Don't use for..in since some crashes show that NSFastEnumeration
   in those loops is doing something wrong.
 - Check that the receiver actually supports the selector before
   calling it. Crashes indicate an unrecognized selector is being
   used.
 - Add a ref to MTLCounterSet to be sure it is not somehow freed
   between when it is stored, and when we use it as the receiver for
   [MTLCounterSet counters].

Bug: dawn:1102
Change-Id: I882045ba09547df62a98a862e6e64c5a7d656e80
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80461
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-02-15 18:18:26 +00:00
Li Hao 3a60f96079 Reset root descriptor table for samplers when descriptor heaps are changed
When shader-visible heap switch happens, we re-populate all bindgroups
and change the descriptor heaps, which need to reset root descriptor
tables, but for the samplers which are cached in
mBoundRootSamplerTables and not changed, they won't be reset, which make
shaders cannot access the sampler heaps.

Bug: dawn:1255

Change-Id: Icc142206121af9daf8b9352b4c639f7d7ef8f1d3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/76780
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
2022-02-15 02:05:06 +00:00
Brandon Jones fe994f74ff More verbose BindGroupLayout error messages
Begins including the expected BindGroupLayout in validation messages
where a BindGroup descriptor does not match the BindGroupLayout. This
is especially helpful in cases where the BindGroupLayout was implicitly
created by the pipeline.

Bug: dawn:1258
Change-Id: Icbf27b4a2ac9b4dc1716feed47e3e63cf99929a7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80380
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2022-02-14 19:06:55 +00:00
Stephen White a52abab38c Nuke SPIRV-Cross.
Change-Id: I1fc58d50ba3999e3a9b6f4e30a0799be301893de
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79481
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2022-02-11 00:45:51 +00:00
Stephen White 96b72c262c OpenGL: use Tint for GLSL generation.
Change-Id: Ibced679fa6568f1eb33707f0157d03505e6f8a1c
Bug: dawn:1263
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67540
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2022-02-10 22:17:41 +00:00
Brandon Jones 31f60e3a40 Remove accidental unused Transform Manager
Removes an unused tint::Transform::Manager that was accidentally merged
as part of commit "Integrate Multiplanar External Texture Transform".

Bug: dawn:1082
Change-Id: I55b5eec8b17f27df22658a90912dec4d6d583cbb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80100
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
2022-02-10 21:56:51 +00:00
Austin Eng e710706858 Remove old src/tests/BUILD.gn
Bug: dawn:1275
Change-Id: I1da086fb291551b0a437411b13285a097557e7de
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80060
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-02-10 19:41:24 +00:00
Brandon Jones cff04b4d3f Integrate Multiplanar External Texture Transform
Introduces the majority of the logic associated with enabling
multiplanar external textures. Removes most backend logic associated
with external textures in favor of expanding them into their components
in the frontend. Includes a basic e2e test demonstrating multiplanar
YUV-to-RGB conversion.

Bug: dawn:1082
Change-Id: Ib5c042e5639b1a8efe2954680abc346c8c6c76d7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78248
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
2022-02-10 19:31:13 +00:00
Jiawei Shao 47f051984b D3D12: Only set root parameters for dynamic storage buffers when needed
This patch skips setting the items for dynamic storage buffer lengths
in root signatures when there is no dynamic storage buffer in the
pipeline layout so that we can avoid adding a root constant with
Num32BitValues == 0 in the root signature.

BUG=dawn:1262

Change-Id: I7d698425c94092299aefaf8cb6ef465745c8d194
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79742
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2022-02-10 00:05:01 +00:00
Corentin Wallez 82ca6096ac Mark 1D textures as safe.
Fixed: dawn:814
Change-Id: I216ebdb68cfb1634cfad8b44de998c2f1a87edaf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79320
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
2022-02-09 18:40:51 +00:00
Corentin Wallez 9fc28cf3b6 Metal: Fix leak of MTLVertexDescriptor when using vertex pulling
Bug: dawn:1175
Change-Id: I1fd833fef830de4165a397e07c3ddaae0d7bdca8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79762
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-02-09 15:56:32 +00:00
Austin Eng 189b0cec37 tint->dawn: Move src/dawn_tests -> src/dawn/tests
Bug: dawn:1275
Change-Id: I79f2aeb0c54a74dd5becd90c46792705a28e87da
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79100
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-02-09 14:54:31 +00:00
Austin Eng 7fd6b996f4 tint->dawn: Add proxy groups and temp targets for Dawn tests
Needed so that Chromium can reference the temp groups and
targets while we move Dawn's test build targets.

Bug: dawn:1275
Change-Id: Ia26769adfb3714e78ebd058ffcec50f3ccfa1a05
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79821
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-02-08 22:15:50 +00:00
Brandon Jones 0fee4c180a Deprecate endPass(), replace with end()
Method was renamed in https://github.com/gpuweb/gpuweb/pull/2560

Bug: dawn:1286
Change-Id: I02a5da3f6ff56868c4d8f45a17433b6c5adf5c22
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79480
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2022-02-07 19:48:39 +00:00
Corentin Wallez a9a80ef386 Guard for [MTLDevice counterSets] being null.
Bug: dawn:1102
Change-Id: I1c8fffba65cba0b04ef72018013f027f0a814f90
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79361
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
2022-02-07 16:12:00 +00:00
Corentin Wallez 31680a7ec0 Add validation of the max binding number.
Fixed: dawn:1283
Change-Id: I5efd0d5c92bd6c1a4cdfe91079a12a9f98ddfd61
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79260
Reviewed-by: Brandon Jones <bajones@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-02-07 12:02:57 +00:00
Austin Eng 377ead9d44 Fix version check for timestamp queries - Mac 11.0+ AMD
Bug: dawn:545
Change-Id: I7cb48813e0a582a6b7314c6fa726800b146ea6be
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79243
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-02-05 03:30:05 +00:00
Ben Clayton 7b77855a87 tint->dawn Add src/dawn/CMakeLists.txt
Promote up some build rules from the root CMakeLists.txt file that are
specific to Dawn.

Bug: dawn:1275
Change-Id: I11e9261ac595f6d71742b20d54dc658a5fa7e996
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79105
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-02-04 18:59:15 +00:00
Ben Clayton c6ccd539e8 tint->dawn: Move src/fuzzers/dawn -> src/dawn/fuzzers
This has already been moved once, but with more consideration, there's far less fuzzer-related stuff to put in the same root directory here.

Bug: dawn:1275
Change-Id: Ic4bb556d9a9f104293cca3316cae84b66a6362b6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79104
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-02-04 18:48:05 +00:00
Ben Clayton a6750751c7 tint->dawn: Move examples -> samples/dawn
Bug: dawn:1275
Change-Id: I4824aaabc2c2b55a609a6e1370959394b93463b8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79103
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-02-04 18:35:55 +00:00
Ben Clayton 9fb7a5146a tint->dawn: Move src/include -> include
Also simplify the target names.

Bug: dawn:1275
Change-Id: I2929b70897f64903b91b693b48c2e8dd7c11d07b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79102
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-02-04 18:18:18 +00:00
Ben Clayton 35940f9b83 gn: Trim target prefixes from src/dawn targets
Removes stuttering.

Bug: dawn:1275
Change-Id: Ie32929e0b0ca579d7eef13a43fd2d1c648140276
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79101
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-02-04 17:15:16 +00:00
Ben Clayton 818001d32e tint->dawn: Move src/dawn_native -> src/dawn/native
Bug: dawn:1275
Change-Id: Ic60a00107a015bc677ff929c492f1085ffc38482
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79083
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2022-02-04 17:07:46 +00:00
Ben Clayton b2c4d7a244 tint->dawn: Move src/dawn_platform -> src/dawn/platform
Bug: dawn:1275
Change-Id: I043c5e6d84e199fe2e753ac43181b125882439bf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79082
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2022-02-04 12:51:25 +00:00
Ben Clayton 20cbe6d9e8 tint->dawn: Move src/dawn_wire -> src/dawn/wire
Bug: dawn:1275
Change-Id: I56535bf4d387c4bd423140705ea70812be073eac
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79081
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2022-02-04 12:51:25 +00:00
Ben Clayton 7d5badd9f4 gn: Trim target prefix from static and shared libraries
If the target name matches the package directory.
Reduces stuttering in target names.

Change-Id: I6cf01ac22c4998f4b862135b13b8503bdd92bdd0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79080
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2022-02-04 12:51:25 +00:00
Ben Clayton 902ad1f9b2 tint->dawn: Move src/dawn_node -> src/dawn/node
Bug: dawn:1275
Change-Id: I206287da7728788646929e696c756b43d53cf272
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79063
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2022-02-04 12:51:25 +00:00
Ben Clayton 1e657a6328 tint->dawn: Move src/utils -> src/dawn/utils
Also remove stuttering from the target names by dropping the 'dawn_' prefix.

Bug: dawn:1275
Change-Id: I3263f1236f71bf23795b4b12670ad3535822a537
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79062
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2022-02-04 12:51:25 +00:00
Ben Clayton d9ab69a9c1 tint->dawn: Move src/common -> src/dawn/common
Also remove stuttering from the target names by dropping the 'dawn_' prefix.

Bug: dawn:1275
Change-Id: Iac79f9927010b8e5edeb7e0949092b34431d54dd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79061
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2022-02-04 12:51:25 +00:00
Corentin Wallez 42e648c1cf Implement creating and using 1D texture views.
- Adds a test to sample a 1D texture.
 - Adds a test writing to a 1D texture as a storage texture.
 - Reworks some of the StorageTextureTests helper code to allow passing
   custom sizes (since 1D textures must have height=1).
 - Deletes some dead code leftover from readonly storage textures.
 - Adds validation tests for 1D texture view creation.

Bug: dawn:814

Change-Id: I279856569f4fc6c9a7a5023a42bfa50d444158ea
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79106
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-02-04 08:34:54 +00:00
Brandon Jones a20ce6f5a9 Deprecate read only depth/stencil Load/StoreOp
In https://github.com/gpuweb/gpuweb/pull/2387 the spec was updated to
require that when depthReadOnly or stencilReadOnly is set the associated
load and store ops must be omitted. This change deprecates setting them
to `Load` and `Store` respectively, while adding an `Undefined` value
which the enums default to.

Bug: dawn:1281
Change-Id: I36474ba67bfb080da8c713d5bb88b8522e4630f3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78980
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2022-02-03 17:59:04 +00:00
Brandon Jones 012840b752 Create 1x1 Dummy Texture For Single-Plane External Textures
Creates a 1x1x1 dummy texture that will be bound, but unused to shaders
that use external textures. It is expected that a special texture type
will be introduced and used in the future to optimize backends that
allow null bindings.

Bug: dawn:1082
Change-Id: I0c49f58f6a725290ec9b73b09578c0f85e5b38d7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78940
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
2022-02-02 21:11:42 +00:00
Austin Eng 2fbc170827 Add runtime search paths to Instance descriptor
So that Chrome can configure Dawn to load SwiftShader from
the bundled/module directory. The shared libraries and ICD
are packaged in a separate directory while dawn::native is
linked statically into the Chrome executable.

Change the Vulkan backend to use these paths for loading
Vulkan.

Bug: chromium:1266550
Change-Id: I40468b481881f6c249694c1c61137bc0c9b8fe76
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78840
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-02-02 21:00:52 +00:00
Ben Clayton 0123832cc0 BUILD: Remove temporary fuzzer alias
This was used to allow Dawn to roll into Chromium.

The usage of this build rule has been removed:
https://chromium-review.googlesource.com/c/chromium/src/+/3427755

So this can now be deleted.

Bug: dawn:1275
Change-Id: If080cf3b576b51b2522699ae2063419bcaeba7c5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78804
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-02-02 09:40:12 +00:00
Ben Clayton 7d37677a03 dawn_native/metal: Round workgroup memory size to 16 bytes
The documentation for setThreadgroupMemoryLength states:
  length - The size of the threadgroup memory, in bytes. Must be a multiple of 16 bytes.

This is the likely cause of a number of CTS flakes for 'webgpu:shader,execution,zero_init:compute,zero_init:storageClass="workgroup";*'

Bug: dawn:1277
Change-Id: Ib8c271fccacac6e68cdf0ddb5c6b5a41756173b5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78801
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2022-02-01 16:53:21 +00:00
Ben Clayton 1a4185b742 Move src/fuzzers to src/fuzzers/dawn
As part of the tint -> dawn merge.

Bug: tint:1275
Change-Id: I0ebb8afe9971c21ca90f90f246edcfde01d5f4bc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78800
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-02-01 16:45:12 +00:00
Corentin Wallez 38b188ce61 Support 1D texture copies.
- WriteBuffer to 1D textures
 - copyBufferToTexture to 1D textures
 - copyTextureToBuffer from 1D textures
 - copyTextureToTexture with 1D textures

Test coverage will be provided by the CTS. At the time this
commit is up for review, the validation tests have been change
to test 1D texture copies comprehensively, except for copies
between 1D textures and textures of other dimensions.

Bug: dawn:814
Change-Id: I91a278d9c113a06a108fecb124aa21fea5e691b3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64544
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-02-01 15:32:32 +00:00
Corentin Wallez 777654e6b9 QueryHelper: improve the precision of the tick->ns conversion.
Previously the conversion lost precision because of the repeated
float additions and rounding of float to uint. It is reworked to operate
using only integers, giving a better precision (3e-5 instead of 2e-3)
for all periods between 1ns and 2^16ns (which all GPUs seem to fall in
to).

The QueryHelper test is reworked to test multiple periods to provide
better certainty that the maths in the conversion is correct.

Bug: dawn:1250
Change-Id: I43703bb3a40c4e362d78126e3bf0d830690bc1d7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/77780
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-02-01 12:05:22 +00:00
Corentin Wallez 9dfcc20750 D3D12: Unify both buffer<->texture copy paths.
The two paths were duplicated with extremely similar code.
Unifying them will help implement the buffer<->1D texture
copies by having a single place to change.

Bug: dawn:814
Change-Id: Id574bf62fc85e5e72ab54ba5066e52ff37000e87
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78723
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-02-01 11:04:53 +00:00
Corentin Wallez 9c2e07cff9 Use C++17 message-less static_assert where applicable.
Bug: dawn:824
Change-Id: I01dda88caaf613092541b62ea1b8d92768d405e9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78724
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-01-31 16:40:31 +00:00
Corentin Wallez abd099c063 Add a defaulted ExternalTextureBase destructor.
Without this, users of ExternalTextureBase will try to instantiate the
default destructor, which will cause a call to ~Ref<BufferBase> which
will fail when Buffer.h isn't included.

Fixes the roll of Dawn in google3.

Bug: None
Change-Id: Ib88d4338033468779f416973e5808910eb4ef110
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78721
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-01-31 12:20:04 +00:00
Dawn Autoroller a6222d2c5b Roll Tint from 3cdb8e3c3e to 0b39270e01 (8 revisions)
Also contains a fix for src/dawn_native/CompilationMessages.cpp, where
the tint::Source structure has changed in a breaking way.

https://dawn.googlesource.com/tint.git/+log/3cdb8e3c3e0a..0b39270e01ce

Bug: None
Change-Id: If801fa85200316012916b24324fd39d275d1fd2f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78720
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-01-31 07:35:21 +00:00
Yuly Novikov d21a970f76 Update SYNC-HAZARD-WRITE_AFTER_READ skip
VK_PIPELINE_STAGE_2_NONE_KHR
was renamed to
VK_PIPELINE_STAGE_2_NONE
in https://github.com/KhronosGroup/Vulkan-ValidationLayers/pull/3705

Removing the comma in the end of string will make it catch both cases.

Bug: chromium:1292106
Change-Id: Idca97cc6b2d53476b7d108595e329e7c287d086f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78640
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Auto-Submit: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2022-01-29 01:05:08 +00:00
Yunchao He 1365885386 Remove UnsafeAPI toggle for readonly depth/stencil attachment
Readonly depth/stencil attachment has already been supported on
D3D12, Metal and Vulkan. Its implement on GL and GLES will be
at post V1 via WebGPU-compat.

Bug: dawn:485
Change-Id: I1c13232f405b10b36f66c1c452449a864ca8fedc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78441
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
2022-01-28 19:44:58 +00:00
Ben Clayton 26c31f6b2c Shuffle 'docs' directories
As part of the tint -> dawn merge.

Bug: dawn:1275
Change-Id: Ice0c9d2f03f6d7e96471cf8398aecd16273c833f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78400
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-01-27 18:33:47 +00:00
Brandon Jones 9f1579469d Initialize External Texture's Internal Params Buffer
Initializes a uniform buffer on ExternalTexture objects that holds data
used by in shaders. Includes modifications to some Mock tests, which
should be using mock external texture objects instead of real ones.

Bug: dawn:1082
Change-Id: I34c02eadaf38aebf22630ac99098e0637ca1279c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78240
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
2022-01-27 18:05:28 +00:00
Brandon Jones 913e158429 Update arg names for GPUComputePassEncoder.dispatch()
Slightly silly, since it has no effect on API use, but it is nice to
keep the arg names in sync with the spec.

Bug: dawn:1270
Change-Id: I1f8cfabefb3a721691c092815cbb66c959980b5e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78245
Auto-Submit: Brandon Jones <bajones@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-01-27 09:40:02 +00:00
Loko Kung a52dc04ee3 Adds validation tests for new device.Tick behavior based on internal and API calls.
Bug: dawn:628
Change-Id: I4de0a32fd18dc620637777754304df4634bbac66
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/77720
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-01-26 19:37:16 +00:00
Zhaoming Jiang 3d3e1757c4 Reland "Recording timing info in trace events when D3D12 queue submit"
This is a reland of 8e9fbbe7ca

Add a toggle RecordDetailedTimingInTraceEvents. When this toggle is
enabled, record detailed timing information in trace events right
before calling ExecuteCommandLists on a D3D12 command queue, and the
information includes system time, CPU timestamp, GPU timestamp, and
their frequency. All Windows APIs used here are supported since Windows
2000.

Original change's description:
> Recording timing info in trace events when D3D12 queue submit
>
> Add a toggle RecordDetailedTimingInTraceEvents. When this toggle is
> enabled, record detailed timing information in trace events right
> before calling ExecuteCommandLists on a D3D12 command queue, and the
> information includes system time, CPU timestamp, GPU timestamp, and
> their frequency.
>
> Bug: dawn:1264
> Change-Id: Ie06d3f2b7eb25c641ee00476334bd276227c3678
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/77381
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>

Bug: dawn:1264
Change-Id: I3f81a76726f88fc0e9d817bfe452a050583399e8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78252
Reviewed-by: Yuly Novikov <ynovikov@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
2022-01-26 13:34:51 +00:00
Jiawei Shao 04584a567e Skip two tests that fail on Win11 with backend validation == full
BUG=dawn:1273, dawn:1255

Change-Id: I78f3dc3a3cfb6a3cedd03c1644e31abf71306dd8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78180
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2022-01-26 07:37:54 +00:00
Shaobo 5875ad7064 Implement platform-independent isNaNCustom for VertexFormatTest
Wgsl removes inNaN from spec (https://github.com/gpuweb/gpuweb/pull/2311)
and VertexFormatTest needs to cover NaN input. So we implement a
platform-independent isNaNCustom based on the rules in IEEE 754-1985.

Bug: dawn:1268
Change-Id: I53aef428c72d34381efc6b3ba0250685fc685965
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78140
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
2022-01-26 00:22:40 +00:00
Yuly Novikov c64159ca25 Revert "Recording timing info in trace events when D3D12 queue submit"
This reverts commit 8e9fbbe7ca.

Reason for revert: crashes on Win7

Original change's description:
> Recording timing info in trace events when D3D12 queue submit
>
> Add a toggle RecordDetailedTimingInTraceEvents. When this toggle is
> enabled, record detailed timing information in trace events right
> before calling ExecuteCommandLists on a D3D12 command queue, and the
> information includes system time, CPU timestamp, GPU timestamp, and
> their frequency.
>
> Bug: dawn:1264
> Change-Id: Ie06d3f2b7eb25c641ee00476334bd276227c3678
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/77381
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>

TBR=cwallez@chromium.org,kainino@chromium.org,enga@chromium.org,zhaoming.jiang@intel.com,dawn-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I7884e1c9cb580237bfa65790e12879a075720b18
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: dawn:1264, chromium:1290964
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78250
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@google.com>
2022-01-25 22:13:03 +00:00
Ben Clayton 4a3503a610 dawn_native: Use 'auto' to handle change of tint type
tint::Source::FileContent::lines has changed from a vector of std::string to std::string_view.
The dawn usage of the field works with both types without changes, so juse use `auto` to let tint roll.

Change-Id: I0d8309a13e94da7e3558bd32d0d98a4f27a1a4bc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/77943
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-01-25 20:34:10 +00:00
Brandon Jones 37b3df4337 Modify External Texture Interface For BiPlanar Formats
Changes dawn.json entry for ExternalTexture to take a secondary plane
and adds wgpu::PredefinedColorSpace. Includes validation tests.

Bug: dawn:1082
Change-Id: I76475e4a1bce6f25c728ac0251ff582ef6369cd1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/76282
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
2022-01-25 18:09:00 +00:00
Stephen White 0999cb0371 Add missing @interpolate(flat) to validation test.
(Note that I've added the decoration to all types, integer or not.
This should make no difference for the purpose of this test.)

Bug: dawn:1271
Change-Id: I77a4c3ac25ad360ea59352499d97148c068ceda1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78204
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2022-01-25 17:17:52 +00:00
Ben Clayton a9ca8cb4ab wgsl: Replace use of [[attribute]] with @attribute
Bug: tint:1382
Change-Id: I58ad2c88fde1e7c96f2ae8257e6df924b94b61db
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/77660
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-01-25 16:29:04 +00:00