Commit Graph

414 Commits

Author SHA1 Message Date
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
Loko Kung e70563ac03 Implements maxColorAttachmentBytesPerSample
- Adds the limit
- Adds relevant format-specific data into format table
- Adds deprecation validations regarding the limit
- Adds deprecation validation unit tests and helpful utils
- Moves deprecated api tests from end2end to unittests, allowing tests
  to be cross-files for ease after deprecation.
- Updates some validation messages to include helpful contexts.

Bug: dawn:1522
Change-Id: Ib05f9adb60808ff4d68061d9646e76c729a23643
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/113543
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2022-12-12 20:55:05 +00:00
Brandon Jones 85ceb08d5c Add ExternalTexture Rotate and FlipY Functionality
Adds functionality to Dawn and Tint to rotate and flip-Y external
textures through the shader transform. Tests are included.

Bug: chromium:1316671
Change-Id: I40a6b67eaeb2a348f469e4879eeb585bc40537b2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110181
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-11-30 21:32:26 +00:00
Jiawei Shao 806c58324c Wire: Make validation error prior to OOM if mappedAtCreation == false
This patch updates the validations about CreateBuffer() with dawn_wire
to match the latest WebGPU SPEC.

According to the SPEC, the validations in CreateBuffer() should be
executed in the below order:
1. If mappedAtCreation == true, return nullptr and a RangeError will be
   generated in Chromium.
2. Validate BufferDescriptor and check if there is OOM at device timeline
3. Check if there is OOM at content timeline

Bug: dawn:1586
Change-Id: I97ff5f82a42208442ddf6e46e66381c3b3680450
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/109040
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2022-11-23 02:06:11 +00:00
Yan,Shaobo e8dd681f19 Provide origin info for ExternalTexture
Current ExternalTexture visible related info only contains width and height.

But not all the visible rect started at (0, 0). This CL add visibleOrigin to contain origin info and record (width, height) in
visibleSize

Bug: chromium:1361363
Change-Id: I3d8931e490c97740f152653383f07d0a2d984dd3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/108024
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
2022-11-03 09:03:01 +00:00
Li Hao 74f6bc7e40 Move timestamp query inside compute/render passes to new feature
Feature::TimestampQuery is used for timestamp query in command encoder
and compute/render descriptor to match WebGPU SPEC.

Add a new feature timestamp-query-inside-passes for writeTimestamp API
on compute pass and render pass.

Split timestamp query tests in dawn_end2end_tests and dawn_unit_tests.

Bug: dawn:1193, dawn:1250
Change-Id: I8dd66c1d40939877e37ec2b979a573cc4812c21f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106500
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Hao Li <hao.x.li@intel.com>
2022-10-28 04:51:16 +00:00
Yan,Shaobo b4d8c8012b Reland "Add CopyExternalTextureForBrowser()"
This is a reland of commit f392c38b67

The new added structure ImageCopyExternalTexture used in dawn only. Adding
tags : ["dawn"] to fix compile error.

Original change's description:
> Add CopyExternalTextureForBrowser()
>
> This API accept ExternalTexture object as copy source and a dawn 2D texture
> as destination. It has similar functions as CopyTextureForBrowser().
> The API is used to support cases that source images are multi-planar format
> and want to do conversion and uploading to a dawn 2D texture.
>
> Bug: chromium:1361363
> Change-Id: Ie390acfb95b47d417f4a8faa2d1e19163d549154
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/105880
> Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
> Reviewed-by: Austin Eng <enga@chromium.org>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>

Bug: chromium:1361363
Change-Id: I213c3dc7fe81ccc35050592e491995d0d5425f6e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106883
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
2022-10-26 00:58:46 +00:00
dan sinclair f4baf2713c Revert "Add CopyExternalTextureForBrowser()"
This reverts commit f392c38b67.

Reason for revert: Breaking the roll into Chromium, and breaks the CMake build of Dawn. https://chromium-review.googlesource.com/c/chromium/src/+/3974728

Original change's description:
> Add CopyExternalTextureForBrowser()
>
> This API accept ExternalTexture object as copy source and a dawn 2D texture
> as destination. It has similar functions as CopyTextureForBrowser().
> The API is used to support cases that source images are multi-planar format
> and want to do conversion and uploading to a dawn 2D texture.
>
> Bug: chromium:1361363
> Change-Id: Ie390acfb95b47d417f4a8faa2d1e19163d549154
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/105880
> Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
> Reviewed-by: Austin Eng <enga@chromium.org>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>

TBR=cwallez@chromium.org,shaobo.yan@intel.com,enga@chromium.org,noreply+kokoro@google.com,dawn-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I3f057b1e5fe3bb0e41063eb402d2c269c27aaedf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1361363
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106842
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: dan sinclair <dsinclair@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2022-10-24 14:24:29 +00:00
Yan,Shaobo f392c38b67 Add CopyExternalTextureForBrowser()
This API accept ExternalTexture object as copy source and a dawn 2D texture
as destination. It has similar functions as CopyTextureForBrowser().
The API is used to support cases that source images are multi-planar format
and want to do conversion and uploading to a dawn 2D texture.

Bug: chromium:1361363
Change-Id: Ie390acfb95b47d417f4a8faa2d1e19163d549154
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/105880
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2022-10-24 06:03:22 +00:00
Yan,Shaobo 96a0bd5bdf Add visibleRect to ExternalTextureDescriptor
Add visibleRect in ExternalTextureDescriptor to create ExternalTexture.
This helps ExternalTexture present the content correctly if needed.

Bug: chromium:1361363
Change-Id: I54b1912305080943babd7558ef40bca8528c932c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106181
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-10-24 04:19:43 +00:00
Corentin Wallez 873df0a2f7 webgpu.h: bundlesCount -> bundleCount
This is a noop change because it just renames a function
argument in dawn.json. All other places for that argument
already used bundleCount so no additional changes are needed.

Bug: None
Change-Id: Id3d77d61886b470beede8229cc079905682c3525
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/104362
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
2022-09-30 20:34:08 +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
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
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
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
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
Zhaoming Jiang 7ca82ac4d0 dawn: Refactor device creation and add shader-f16 feature
This CL modifies the way adapter creating devices, adds `shader-f16`
feature, and deprecates the `dawn-shader-float16` feature which is no
longer used.
Details:
1. Parse the toggles chained with device descriptor in
`adapter::CreateDeviceInternal`, which are then used to validate
features requirement within `CreateDeviceInternal` and passed to device
constructor as initializer.
2. When creating device, validate features requirement in
`CreateDeviceInternal` with toggles known, make sure to fail the device
creation if a required feature is not supported by adapter or is guarded
by certain toggles which were not enabled/disabled. Feature ShaderF16
and ChromiumExperimentalDp4a are validated in this way. Unittest is
added to check creating devices with toggles-guarded features required.
3. Add `shader-f16` feature, which allow `using f16;` in WGSL code.
End-to-end tests are added to test a trival f16 WGSL shader could be
used if and only if the device has `shader-f16` feature.
4. Deprecate the `dawn-shader-float16` feature, which will be completely
removed after cleaning up Blink code.

Bug: dawn:1510
Change-Id: I6cb2dcbe1ee584fdd6131c62df1ee850b881dbd2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/100802
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2022-09-08 00:11:04 +00:00
Brandon Jones 567f06849b Add the "internal" error type
Currently only raised if Tint produces an Internal Compiler Error
(ICE). These were previously surfaced as validation errors.

Bug: dawn:1531
Change-Id: I9a10549b3e0bc2cbf962c99d157aa6dbe8032a3c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/101500
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2022-09-07 14:14:14 +00:00
Brandon Jones 2b0fce7071 Revert "Implement maxBindingsPerBindGroup limit"
This reverts commit 4d67a883b6.

Reason for revert: Seems to be causing MSAN issues with the Dawn/Chromium roll?

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>

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: dawn:1523
Change-Id: I757457089be6af18dfce7f64c0da5d310351cece
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/101401
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2022-09-06 17:38:03 +00:00
Brandon Jones 4d67a883b6 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>
2022-08-31 17:01:58 +00:00
Loko Kung 3a53edcf18 Promote LoseForTesting to ForceLoss device so that user agents can use.
Bug: chromium:1356738
Change-Id: I348837ad4224124d9adba1ecf69a05b2060760c9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/100566
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2022-08-29 22:33:50 +00:00
Austin Eng bf3243568c Add DeviceBase::APIGetAdapter
Adds a way to query the adapter from a device. Only valid in Dawn Native.
Returns a new reference to the caller. The caller is responsible for
releasing it.

This is needed so in Chrome, SharedImage can query the WGPUAdapter from
the WGPUDevice, and then WGPUAdapterProperties may be queried from the
WGPUAdapter.

Change-Id: I719a8728eff06ab7a22be3db5fb5cfd2ebb2f0f7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/99703
Reviewed-by: Zhenyao Mo <zmo@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-08-18 18:02:00 +00:00
Shrek Shao 9ec183ed9f Update VertexStepMode::VertexBufferNotUsed jsrepr to undefined
As suggested in an emscripten update,
VertexStepMode::VertexBufferNotUsed will be undefined in jsrepr
in generated files.

Bug: dawn:1000
Change-Id: I3ad96f66f2965d6aa589174225eee538ec97d060
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/97900
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Shrek Shao <shrekshao@google.com>
2022-08-01 23:03:14 +00:00
Corentin Wallez 1260a53018 Mark descriptor/options as optional for requestDevice/Adapter
These were not marked as optional previously because it would mean that
C++ methods would look like void F(a = null, b, c) which is invalid in C++
because default arguments must be contiguous and at the end of the
signature.

This commit adds a special case when optional=true where no_default=true
still marks the argument as optional, but doesn't produce a C++ default
argument.

Fixed: dawn:1502
Change-Id: I1b648d37edb94b8412109fc0a06a91bbbd31b8c4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/97002
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2022-07-26 17:36:44 +00:00
Corentin Wallez 256e026f64 dawn: Add Device::CreateErrorTexture(desc)
This will be used by Blink to create error textures with correct
reflection information exposed to JavaScript.

Bug: chromium:1345736
Change-Id: I0bc3a72d602c1bb57dc76e90f4883951f86ef428
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/96681
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
2022-07-20 16:07:44 +00:00
Austin Eng 8d73198aca Remove depth-clamping and add depth-clip-control feature
Fixed: dawn:1178
Change-Id: I251a7e05fec9ecef44300d4f948b2d0611888109
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/96320
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-07-18 20:38:05 +00:00
Corentin Wallez a45561bb8c dawn.json: Add the "chain roots" data for chained structs.
This helps output in the headers information about which structure can
be used to extend which. In the future it could also be used to generate
helpers that validate that the chain for a root structure contains only
allowed extension structs.

Fixed: dawn:1486
Change-Id: I6134332d477503e242b3bec9f8e9bedeeb352351
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/96000
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-07-14 12:58:25 +00:00
shrekshao a3f4a32022 Add clear alpha to one step to copy texture for browser
Bug: chromium:1331139
Change-Id: I69c31aea0320f302be686adf0167649a98db3414
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/95682
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Shaobo Yan <shaobo.yan@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2022-07-11 18:11:14 +00:00
shrekshao c6cbcdb05b Add internal usage for copyTextureForBrowser
Add an internal usage option for copyTextureForBrowserOption
allowing internal calls from call to use canvas context
texture as source/destination.

Bug: chromium:1331139
Change-Id: Ida8421b3962a6434e8ef57c581c7a2e1d607954c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94985
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2022-07-11 18:11:14 +00:00
Takahiro 831296debc Implement RenderPassDescriptor.maxDrawCount
Bug: dawn:1465
Change-Id: I6b0aab25ec7a48a6521e4e7f52e42d6890ae2013
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94821
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Takahiro <hogehoge@gachapin.jp>
2022-06-30 04:19:42 +00:00
Yan,Shaobo 7ce3c2da35 Add Device.CreateErrorExternalTexture()
Creating GPUExternalTexture from destroyed device should return
an error external texture instead of a valid one. Adding this API
for such usage.

Bug: 1336713, 1338182
Change-Id: Ie7d13811a9c1e8890ba91045c88af63f3fb09687
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94534
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-06-27 02:57:40 +00:00
Brandon Jones 431c7a4f66 Add maxInterStageShaderVariables Limits
Will statically report the base limit of 16 for now. Important to note
that this is not validated properly within Tint at this point, and the
current constant associated with this limit is actually 15.

Bug: dawn:1448
Change-Id: I74a5815cc34439ccc3b6ff9cd0afbc56590148fe
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94661
Commit-Queue: Brandon Jones <bajones@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2022-06-24 17:30:29 +00:00
jchen10 ef62b58cf9 Skip Gamma and Gamut conversions for BT.709->SRGB
This introduces a new field 'doYuvToRgbConversionOnly' in
ExternalTextureParams to have the WGSL only do yuv->rgb conversion for
better performance. User studies shows that users don't really care
about the Gamma difference between 2.4 and 2.2.
https://source.chromium.org/chromium/chromium/src/+/main:ui/gfx/color_space.cc;l=1022;drc=a1dbb594a6741a400db35fe3678e77bad2504ea4

Bug: dawn:1082
Bug: dawn:1466
Change-Id: I61c0fe65c5969d8a61c267c202c8dd64c259ed8a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92901
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
2022-06-22 03:14:26 +00:00
Brandon Jones 6d48f573af Remove support for depth24unorm-stencil8
It was removed from the spec after determining it didn't provide any
additional capabilities beyond depth24plus-stencil8.

Bug: dawn:1454
Change-Id: Ifba62f22cd38bea88866c849c8d1754a2aa683e2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92963
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2022-06-14 22:48:31 +00:00
Austin Eng 51d13a4fa4 Add depth-clip-control feature enum
Not implemented on any of the backends yet. The feature
has CTS coverage so tests can be enabled as implementation
is written.

Bug: dawn:1178
Change-Id: Ib0fa39346a42cbd996d3c42bf779767d159067e2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93309
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2022-06-13 19:18:55 +00:00
Austin Eng 1faf5921c6 Delete WGPUDeviceProperties
This struct is no longer needed now that the adapter exposes
a way to query its features that works both in native and the
wire.

Change-Id: Ib0d865330f65473bb0363858a9284e630da52eb1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93340
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-06-13 16:58:27 +00:00
Austin Eng cda3d7bfa8 Add maxColorAttachments limit
Bug: dawn:1455
Change-Id: I92ceb62df46cfb54a791d53a72921e99f46bca08
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93307
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2022-06-13 16:48:45 +00:00
Corentin Wallez 45820ae995 Add reflection APIs for wgpu::QuerySet.
Bug: dawn:1451
Change-Id: I8bce40e4fc0c7caca3c3a4b8c385ba8a393a3f1c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92662
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-06-09 10:12:13 +00:00
Corentin Wallez 736e97c5e0 Add reflection APIs for wgpu::Texture.
This requires adding a custom implementation of DeviceCreateTexture and
the Texture object in the wire client.

In dawn::native this requires the format enum separately from mFormat
which is a `const Format&` so that garbage format values can be
reflected correctly for error textures.

Bug: dawn:1451
Change-Id: I75b5635f36647f6f04dae54e92154f2b552beb64
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92661
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
2022-06-08 18:14:02 +00:00
Corentin Wallez d428187d35 Add reflection APIs for wgpu::Buffer.
Changes dawn::native procs to correctly convert C++ enum and bitmask
returns values.

Bug: dawn:1451
Change-Id: I39a8d218f76e25b178a83eeb99d653222d39d040
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92440
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2022-06-08 14:46:41 +00:00
Corentin Wallez 139d9c276a Remove wgpu::ExternalTextureDescriptor::colorSpace
Fixed: dawn:1445
Change-Id: I33ea40b371f9f72a36205df58f1964e083e0bf4a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92247
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-06-02 13:20:40 +00:00
Enrico Galli 1ee244b3d3 dawn/native: Add support for feature "indirect-first-instance"
Bug: dawn:1197
Change-Id: I9042b2dc178dfc01201bff55a2f5e43de28d335e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/90526
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Enrico Galli <enrico.galli@intel.com>
2022-06-01 06:14:07 +00:00
Takahiro f3cf19fdb2 Change wgpu::VertexStepMode::VertexBufferNotUsed enum value
When wgpu::VertexStepMode::VertexBufferNotUsed enum that must
be set to empty vertex buffer slots was introduced its value
was temporarily set to zero to pass some CTS tests by making
the use of zero-initialization without any change in Blink.

We applied a patch to Blink to explicitly set
wgpu::VertexStepMode::VertexBufferNotUsed to empty vertex
buffer slots so we can set the enum value to non-zero.

("Undefined") Zero enum value should be used as the
default as specified in JS" so the APIs match more closely.
The default vertex step mode in VertexBufferLayout is
"vertex" then wgpu::VertexStepMode::VertexBufferNotUsed enum
value shouldn't be zero.

Bug: dawn:1000
Change-Id: Iffbc96d4c4e032673faa37894998e4e9944c3ba8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91920
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Takahiro <hogehoge@gachapin.jp>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-05-31 17:24:49 +00:00
Brandon Jones 8cb8c7add7 Begin auto generating GPUInfo utilities
This change moves the bulk of the existing GPUInfo functionality into an autogenerated source built from a JSON file that describes the GPU
vendor and device IDs, with device IDs broken down by GPU architecture.

Also adds the fields needed to implement GPUAdapterInfo in Blink to the AdapterProperties.

Bug: dawn:1427
Change-Id: I6a8b1fa7a63ec8d71556fc5bb3ae12cfe5abf28b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/90962
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2022-05-26 23:47:39 +00:00
Takahiro d42a809e8c Record zero-attribute vertex buffer when creating render pipeline
Currently Dawn ignores all zero-attribute vertex buffer in the given
pipeline descriptor when creating RenderPipelineBase because
zero-attribute vertex buffer is treated as unused slot, however the spec
doesn't state that zero-attribute vertex buffer should be ignored.

To support zero-attribute vertex buffer, this commit has the following
changes.

1. Add VertexBufferNotUsed enum value to wgpu::VertexStepMode to
   represent unused slots
2. Ignore VertexBufferNotUsed  step mode buffers when creating
   RenderPipelineBase and add tests to check it
3. Record zero-attribute vertex buffers when creating RenderPipelineBase
   and add tests to check it
4. Fix VertexStateTest::LastAllowedVertexBuffer broken by the above
   changes

Temporarily we set the enum value of
wgpu::VertexStepMode::VertexBufferNotUsed to 0 to pass the CTS tests
because currently empty vertex buffer slots step mode can be
zero-initialized. We will make a CL to Blink to explicitly set
wgpu::VertexStepMode::VertexBufferNotUsed for empty slots and change
the enum value to 2.

Bug: dawn:1000
Change-Id: Ibd4ab87f2c922e8e460f2311547f13d58f1d5611
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89340
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Takahiro <hogehoge@gachapin.jp>
2022-05-26 01:26:34 +00:00
Brandon Jones 136a0a4269 Change External Texture YUV-To-RGB Matrix To Be Optional
Changes the yuv-to-rgb constant matrix to be optional during external
texture creation because it is not necessary for single-plane scenarios.

Bug: dawn:1082
Change-Id: I543f4009e58f1571b0be80abb6b464b2b8c9d749
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91280
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2022-05-24 01:41:43 +00:00
Corentin Wallez 74771202c7 Add nullable annotations to webgpu.h
Bug: dawn:22
Change-Id: Ie14072e91bab3b69b8d98f15bcbdeaa6679ffcd7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91240
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-05-23 15:44:29 +00:00
Jiawei Shao 9ebba367e8 D3D12: Support feature chromium_experimental_dp4a
Bug: tint:1497
Test: dawn_end2end_tests
Change-Id: I57d5c06c15c0c366c7cc239426e5eee3a7237101
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/90028
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-05-20 08:21:00 +00:00
Brandon Jones e61a390b31 Make External Texture ColorSpace Conversion Configurable
Changes external texture creation to use constants provided by Chromium
instead of hardcoded values.

Bug: dawn:1082
Change-Id: Icfe58f5585732b1e66d2faa50d3aee4a8c53bf84
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89703
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-05-19 17:44:29 +00:00
Brandon Jones cf4a85e249 Add External Texture Conversion Constant Params
Adds parameters to ExternalTextureDescriptor for configurable source
and destination transfer functions, gamut conversion matrices and
yuv-to-rgb conversion matrices.

Bug: dawn:1082
Change-Id: I3b329d645fe113af512b5afb958e271b9bfc4ec4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88403
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-05-02 20:37:28 +00:00