Commit Graph

78 Commits

Author SHA1 Message Date
Brandon Jones 41c87d973a Removed deprecated CreateRenderPipeline path
Renames all the RenderPipeline*2 stuff to simple RenderPipeline* but
keeps *2 definitionas around as typedefs and wrappers so that users can
migrate away from it.

Bug: dawn:22
Change-Id: If301d81a829bba0646c3a61068f2279932b191e0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51764
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2021-05-21 05:01:38 +00:00
James Price 9e0debd91e Update examples for recent WGSL changes
* Use new entry point IO syntax
* Use `let` instead of `const`
* Remove `-> void` from function headers

Bug: dawn:755
Change-Id: I39b5687a342ea2298c3d2e85517c9b8d9017727e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47500
Commit-Queue: James Price <jrprice@google.com>
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2021-04-13 14:52:44 +00:00
Corentin Wallez 21bd02becf Remove deprecated WGSL "-> void"
Bug: dawn:755
Change-Id: I10f2fb3afd26560df10b21d149a65b625bdb2b4b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47600
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
2021-04-13 09:48:24 +00:00
Corentin Wallez 7aec4ae7c5 Remove utility to create shader modules from GLSL
And rename CreateShaderModuleFromWGSL to CreateShaderModule.

Bug: dawn:572
Change-Id: I80dab401078b2001d738b87d6e24437f93b690d1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/45764
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
2021-03-24 15:55:32 +00:00
Corentin Wallez 9895c273d6 Update samples to the new RenderPipelineDescriptor
Also does some updates for the new BindGroupLayoutEntry and
VertexFormats that were missed previously.

Bug: chromium:1177501
Change-Id: Icb336590673158538a1586a1f8d5ace398fb381e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/45282
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2021-03-18 16:46:58 +00:00
Corentin Wallez 6d315daa5d Device: Deprecated GetDefaultQueue in favor of ::GetQueue()
Bug: dawn:22

Change-Id: I103ea933ca5b93f20d8bf11c6671bd9f603d8ff3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/40061
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2021-02-04 15:33:42 +00:00
dan sinclair c2032ea637 Update vertex index decoration names.
This Cl updates the `vertex_idx` to the new `vertex_index` decoration
name.

Change-Id: Ic3688e1af87ed0d570b00ccb72d0e84ac920831b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/38142
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Auto-Submit: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2021-01-21 15:41:20 +00:00
Corentin Wallez 4814bdbdea Port most of the samples to WGSL
Animometer's fragment shaders remains unported because it isn't clear
how to use modf in WGSL.

Bug: dawn:572

Change-Id: I29aa0ee657b813e7308f0300addd1d5795bfc16d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33821
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-11-26 16:39:46 +00:00
Corentin Wallez 6b087819dd s/OutputAttachment/RenderAttachment/g
But also keep OutputAttachment so it can be gradually changed in all
dependants.

See https://github.com/gpuweb/gpuweb/pull/1168 and
https://github.com/gpuweb/gpuweb/pull/1168

Bug: dawn:22
Change-Id: I6a1ec1de6c22ca4deac88b7fffde4b98d9d54a84
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/31040
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-10-27 15:35:56 +00:00
Kai Ninomiya 2afea0c671 Autoformat all tests and examples
Bug: none
Change-Id: I69904944db1d4c2fbcca74bb8b66b5a7524e76bb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24642
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-07-10 20:33:08 +00:00
Corentin Wallez 8a437947a8 Introduce Device::GetDefaultQueue and deprecate CreateQueue
This makes all backends register the default queue at device
initialization time, so that the same queue is returned by
each call to GetDefaultQueue.

All usages of CreateQueue are replaced by GetDefaultQueue
except a couple ones that could use the queue initialized by
DawnTest::SetUp.

A deprecation warning mechanism is added so that users of Dawn
can now that they should upgrade their usage of the API. It also
comes with a backdoor so we can test that they are emitted.

New DeprecatedAPITests are added that will contain tests for
deprecated APIs, and will also check that deprecation warnings
are produced.

The special casing of GetDefaultQueue in the wire will be done
in a follow-up CL to ease the review. It happens to work through
the regular wire mechanisms at the moment but returns a different
object on each GetDefaultQueue call.

Bug: dawn:22

Change-Id: I78dc1fa474769674278d30040e8d05c658b88360
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19724
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-04-17 16:45:17 +00:00
Corentin Wallez 11652ff8f8 Implement the webgpu.h swapchains on Metal
The webgpu.h surface-based swapchains are implement on Metal which
required adding the present mode to NewSwapChainBase.

Additional automated tests are added which require getting the Instance
so a new getter is added to DawnTest. Additional some the state tracking
of swapchains is performed in the backend, so the
SwapChainValidationTests are turned into regular DawnTests so they can
check backends do the correct state tracking. To not lose coverage of
the Null backend, a NullBackend() DawnTestParam factory is added.

Finally swapchains cannot be entirely tested in an automated fashion, so
a new example is added called "ManualSwapChainTests" that allows
manually checking a number of properties. Documentation of the controls
and a manual test plan is in a comment at the top of the example's
source.

Bug: dawn:269

Change-Id: If62fffc29a6cefdbec62747d01c523e2a5475715
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17181
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-03-20 17:07:20 +00:00
Austin Eng 3ded65e807 Default initialize all descriptors
Some dawn_unittests crash on some configurations because the
uninitialized |label| member crashed string serialization.
Default initialize all descriptors to avoid this problem.

Bug: none
Change-Id: I6ea1851ebb6f54690a28ba396e0beaa85d8670cc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16260
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-02-28 22:29:15 +00:00
Corentin Wallez d87e676845 Add the webgpu.h swapchain creation path
This commit changes wgpu::Device::CreateSwapChain to take an additional
wgpu::Surface argument. Passing nullptr is enough to stay on the
previous swapchain implementation, until the new one is ready.

In order to support both the "old" implementation-based swapchains and
the "new" surface-based swapchains. SwapChainBase is now split into
three abstract classes:

 - SwapChainBase that has a virtual method for each of the
wgpu::SwapChain methods.
 - OldSwapChainBase that corresponds to the implementation-based
swapchains.
 - NewSwapChainBase that will contain the surface-based swapchain
implementation and will eventually just be renamed to SwapChainBase.

The interaction of the surface-based swapchains with the Surface objects
aren't implemented yet, neither are the swapchain methods. Only creation
works.

Validation tests for surface-based swapchain creation are added in the
end2end test target because they need to create OS windows.

Bug: dawn:269

Change-Id: I7e07d6c666479867b9a16d7b1b8c181d5dbd69a0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15281
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-01-23 17:20:38 +00:00
Corentin Wallez 604072bc2e Make the SwapChain interface match webgpu.h
This changes the methods of Dawn's SwapChain to match webgpu.h, namely
Present() now doesn't take arguments, and GetNextTexture() is replaced
with GetCurrentTextureView().

BUG=dawn:269

Change-Id: Ia0debefb170caf799c3310b1dad5535c4c5f59ca
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13441
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2019-11-12 18:30:11 +00:00
Kai Ninomiya ae1f25fee8 Update naming for vertex state
- VertexInputDescriptor -> VertexStateDescriptor
- VertexBufferDescriptor -> VertexBufferLayoutDescriptor
- VertexBufferDescriptor.stride -> .arrayStride
- VertexAttributeDescriptor.offset no longer optional

gpuweb PR: https://github.com/gpuweb/gpuweb/pull/469

Bug: dawn:22
Change-Id: I5431df4ba22cfbdb1bc81e6709e562cd736892a3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13100
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-11-07 22:23:29 +00:00
Corentin Wallez 04863c42be Make examples and utils use webgpu.h
BUG=dawn:22

Change-Id: I602d6a3422b493d199f3fded61ff1666bc2d9d7d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12702
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-10-25 11:36:47 +00:00
Corentin Wallez 5f53d5302f Fix RenderPassDescriptor to be extensible.
BUG=dawn:22

Change-Id: Ib9c2cd3259db0e07fa02134ce6d0d5d75a24546c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11901
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-10-08 07:34:43 +00:00
Jinho Bang 0b82671047 Rename PipelineStageDescriptor to ProgrammableStageDescriptor
This is to match the WebGPU's WebIDL[1].

[1] https://github.com/gpuweb/gpuweb/pull/359

Bug: dawn:22
Change-Id: Id0cf0a7a6605ea7ec474d0f0885685ed21875dce
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11883
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-10-07 12:23:09 +00:00
François Beaufort 277d2e15d5 Add missing optional label member to descriptors
This CL adds missing optional label members to all descriptors. It is
not used yet but needed from the WebGPU side.

Bug: dawn:22
Change-Id: I103870f9207eed8168bc2245294888af4e1edd9f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11720
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-10-03 14:56:49 +00:00
Corentin Wallez c81a717379 Remove indirection for colorStates
This is to match the work in progress webgpu.h header.

BUG=dawn:22

Change-Id: Ia1077fef95e6bda541cddbd2f6ce40b79138e960
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/9383
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-09-20 23:22:27 +00:00
Corentin Wallez a838c7d497 Remove indirection for colorAttachments
This is to match the work in progress webgpu.h header.

BUG=dawn:22

Change-Id: I1371cda1b7666de8eb8283fa7e5da935d17e1d52
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/9381
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2019-09-20 22:59:47 +00:00
Corentin Wallez c6c7a42e6e Remove indirection for vertexStage
This is to match the work in progress webgpu.h header.

Also contains a fix for the wire where it wouldn't GetExtraRequiredSize
for structures that are by-value members of other structures.

BUG=dawn:22

Change-Id: I3c706bf9cd7a550d40fd667877f032c860d0a032
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/9382
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-09-05 09:35:07 +00:00
Kai Ninomiya 4078ed8b62 Remove Texture::createDefaultView
https://github.com/gpuweb/gpuweb/pull/389

Bug: dawn:214
Change-Id: I86b8c46c71c3e5b9622ab3656124b312d3e85a7a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10420
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-08-27 17:56:23 +00:00
Corentin Wallez b9b088f57e Rename ShaderStageBit to ShaderStage.
This is to follow changes to WebGPU's IDL and header file where the Bit
suffix disappeared. This caused a conflict with
utils/dawn_native::ShaderStage that were both renamed to
SingleShaderStage.

BUG-dawn: 22
Change-Id: I7b085686775fa19e4b4a3b54979903d72f3ef660
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10462
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2019-08-27 08:42:29 +00:00
Corentin Wallez 9e9e29f7a6 Remove Bit from TextureUsageBit and BufferUsageBit
This is to match the naming convention of WebGPU's WebIDL and webgpu.h

BUG=dawn:22

Change-Id: Ia91c5a018403e6a72eb0311b5f1a072d102282a2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10461
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2019-08-27 08:21:39 +00:00
Corentin Wallez f07e85c604 Add missing WebGPU enums and defaulted members.
These additions to dawn.json don't require changes to users of the C++
API so they are done now to prepare for webgpu.h. Validation is added
that forbids using the new enum values and non-default values for
members until they are implemented.

BUG=dawn:22

Change-Id: Ie6f3384243d6874e7aca4b94733409755a066c93
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8862
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2019-07-15 20:47:56 +00:00
Corentin Wallez 2a1d8c2b1d Remove ShaderStage that doesn't exist in WebGPU.
Instead it is replaced by one enum in dawn_native and another in utils.

BUG=dawn:22

Change-Id: I094a40c8d4e22b704e59aea60cbefd1f05c5352a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8800
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-07-12 17:52:22 +00:00
Corentin Wallez 4b90c47ce0 Add missing descriptors that are present in WebGPU.
These are the CommandEncoder, ComputePass and CommandBuffer descriptors
that contains nothing but a debug name for now but are important for
later extensibility. Defaults are added so the C++ API doesn't require
the descriptors to be passed as arguments.

Also renames variables named "info" for RenderPassDescriptor to
"descriptor" as is now the standard in the codebase.

BUG=dawn:22

Change-Id: I9de4cfbbce952d01fb79ed1d9f34825a6fa174f9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8686
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2019-07-10 20:43:13 +00:00
Yunchao He 2d4b529443 Update VertexInput (InputState) to match the spec - Part 3
Rename num{Attribute|Buffer}s to {Attribute|Buffer}Count for VertexInput

BUG=dawn:80, dawn:107

Change-Id: I7ad62f28449e6283d5c5788dfbd5df1d1e9c813e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7861
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-06-06 17:54:30 +00:00
Yunchao He 97c0885a4a Update VertexInput (InputState) to match the spec - Part 2
This patch changed the front end code and tests and examples.

BUG=dawn:80, dawn:107

Change-Id: Ia6c60232c04a1bfb862263766eb28e9afc3bc8db
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7620
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-06-06 01:56:57 +00:00
Yunchao He eea2091068 Update VertexInput (InputState) to match spec - Part 1
This is only a renaming: change VertexInput to VertexBuffer, and
change InputState to VertexInput.

The next two patches will do as follows:
1) change the structure of vertex input descriptor related stuff.
2) change num to count.

BUG=dawn:80, dawn:107

Change-Id: Ie76aa653a527759a9c3b4a4792e3254689f053b8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7420
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
2019-05-22 22:46:32 +00:00
Austin Eng 0c133bbe55 Rename DawnColorStateDescriptor.colorWriteMask to writeMask
Bug: chromium:877147
Change-Id: I566cea409b89de8abd724f344f7ae83f80e56572
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6600
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-04-15 20:43:35 +00:00
Yunchao He c33a8c1885 Implement rasterization state for render pipeline - Part 1
This change adds rasterization state into dawn.json. It includes
back face culling and depth bias. It also adds validation code
and default values for rasterization state in ComboRenderPipelineDesc
to pass dawn_unittests.

Validation for back face culling and depth bias related parameters
is quite easy, so unittests are not needed.

BUG=dawn:43

Change-Id: I332cbf3f72545cfa8e62b3534d5a6a6e8fdc6d2a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6460
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-04-11 18:46:54 +00:00
Austin Eng b4b3ea05eb Reland "Rename texture.createTextureView to createView to match WebGPU"
This is a reland of 6f0b021dbf.
It also renames CreateDefaultTextureView to CreateDefaultView in a test
that landed after the tryjobs for the reverted patch passed.

Original change's description:
> Rename texture.createTextureView to createView to match WebGPU
>
> Bug: chromium:877147
> Change-Id: I186fc26054cc6729c859a4161c755a1133dc0bca
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6360
> Commit-Queue: Austin Eng <enga@chromium.org>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>

Bug: chromium:877147
Change-Id: I8e1a1adc07ad2c78081ae3cb0fa2bdb648b39c50
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6361
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-04-09 16:57:00 +00:00
Yuly Novikov 2d4c66d2b8 Revert "Rename texture.createTextureView to createView to match WebGPU"
This reverts commit 6f0b021dbf.

Reason for revert: breaks compilation on https://ci.chromium.org/p/chromium/builders/ci/GPU%20FYI%20Linux%20Builder%20%28dbg%29/62003

Original change's description:
> Rename texture.createTextureView to createView to match WebGPU
> 
> Bug: chromium:877147
> Change-Id: I186fc26054cc6729c859a4161c755a1133dc0bca
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6360
> Commit-Queue: Austin Eng <enga@chromium.org>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>

TBR=cwallez@chromium.org,kainino@chromium.org,enga@chromium.org

Change-Id: I2d337881fc05cf8128ae7ab268514ea7ef462123
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:877147
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6420
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@google.com>
2019-04-09 15:28:01 +00:00
Austin Eng 6f0b021dbf Rename texture.createTextureView to createView to match WebGPU
Bug: chromium:877147
Change-Id: I186fc26054cc6729c859a4161c755a1133dc0bca
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6360
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-04-09 15:13:10 +00:00
Yunchao He f856903154 Move vertex index format from RenderPipelineDesc to InputStateDesc
Bug=dawn:107

Change-Id: Ia88232848995d5c4c3ac0f3137ffa518e85aa0a0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6140
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-03-28 17:09:23 +00:00
Yunchao He 889d743baa Input State Descriptorization
This change also removes InputState object.

BUG=dawn:107

Change-Id: Ia3fd2d348658f5719de0279bfe7bb10a4f183523
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/5660
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-03-27 18:08:50 +00:00
Austin Eng 45f9730855 Capitalize C types dawn -> Dawn
This is to match Chromium style.

Change-Id: Ic97cc03e2291c653ade9662ba3d5e629872b10ad
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/5482
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-03-11 16:52:42 +00:00
Jiawei Shao b2c5023c9c Remove RenderPassDescriptorBuilder
This patch removes RenderPassDescriptorBuilder completely from Dawn.
With this patch, RenderPassDescriptor is a structure instead of a Dawn
object, and all the checks in RenderPassDescriptorBuilder are moved into
CommandEncoder.cpp.

This patch also updates the helper functions and structures related to
RenderPassDescriptor because RenderPassDescriptor is no longer an
object but a structure with members in pointers.

BUG=dawn:6

Change-Id: Ic6d015582031891f35ffef912f0e460a9c010f81
Reviewed-on: https://dawn-review.googlesource.com/c/4902
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-02-27 09:21:56 +00:00
Jiawei Shao 2030166137 Rename several parameters to match WebGPU IDL
This patch renames the following parameters to match the latest WebGPU
IDL:
- BindGroupDescriptor.numBindings -> bindingCount
- BindGroupLayoutDescriptor.numBindings -> bindingCount
- BindGroupDescriptor.numBindings -> bindingCount
- queue.submit(numCommands, ..) -> commandCount
- RenderPipelineDescriptor.numColorStates -> colorStateCount
- TextureDescriptor:
  arraySize -> arrayLayerCount
  levelCount -> mipLevelCount
- TextureViewDescriptor:
  levelCount -> mipLevelCount
  layerCount -> arrayLayerCount

BUG=dawn:80

Change-Id: I615842dd5754d1ae1ddff31e25403bb3161f0201
Reviewed-on: https://dawn-review.googlesource.com/c/4881
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-02-21 00:45:19 +00:00
Yunchao He 938811eef9 Use const*const* to annotate color state descriptors
Color state descriptors are a sequence of descriptors embedded
in RenderPipeline descriptor. We should use const*const* to
annotate them for supporting potential extended features added
in color state descriptors in future.

BUG=dawn:77

Change-Id: Id755569fa5076668c3db7b219b699845bc2a1d69
Reviewed-on: https://dawn-review.googlesource.com/c/4880
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
2019-02-20 13:00:36 +00:00
Corentin Wallez e1f0d4e639 WebGPU error handling 2: CommandEncoder for samples and end2end tests
CommandEncoder is the replacement for CommandBufferBuilder. This commit
adds the dawn.json definition for it and an initial implementation that
wraps CommandBufferBuilder. This is done so that the code can be ported
to CommandEncoder gradually, otherwise the commit would be too big and
would risk many merge conflicts.

This converts all samples and end2end tests to use CommandEncoder.

BUG=dawn:8

Change-Id: If4ce86e6fb39ba4e0c2af6328d40e63be17d18c1
Reviewed-on: https://dawn-review.googlesource.com/c/4741
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-02-15 12:54:08 +00:00
Corentin Wallez 7be2a71f2b Descriptorize SwapChain.
This also makes SwapChain support WebGPU-style error handling.

BUG=dawn:8

Change-Id: I5a142ae58600445f0f44f6dbe419cb7c3cdc9464
Reviewed-on: https://dawn-review.googlesource.com/c/4660
Reviewed-by: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-02-15 11:15:58 +00:00
Yunchao He 108bcbd5c9 Split AttachmentStateDescriptor, in order to match web idl
AttachmentStateDescriptor was removed in web idl. Its format info
for color attachment and depth/stencil attachment were split and
added into BlendStateDescriptor (renamed to ColorStateDescriptor)
and DepthStencilStateDescriptor (became optional) respectively.

This change makes dawn project match the revision in web idl.

BUG=dawn:106, dawn:102

Change-Id: If57b060db7b4b5d1124b4a79a3b92a3880047722
Reviewed-on: https://dawn-review.googlesource.com/c/4561
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-02-15 02:20:57 +00:00
Yunchao He 5987c4e839 Remove blendEnabled in BlendStateDescriptor, in order to match web idl
BUG=dawn:32

Change-Id: I7225d919ca1a9c1c848050ad3b9e8832725f0af6
Reviewed-on: https://dawn-review.googlesource.com/c/4460
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-02-12 00:32:13 +00:00
Yunchao He baa3741c9f Rename variables in DepthStencilStateDescriptor, in order to match web idl
Bug:dawn:31
Change-Id: Ie3326e13f62446bf020ae60f47c8dfa6687d7b9a
Reviewed-on: https://dawn-review.googlesource.com/c/4240
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
2019-01-30 21:11:43 +00:00
Yunchao He c0f31e73e4 Use const*const* to annotate a sequence of descriptors
BUG=dawn:77

Change-Id: I2a523e54a06173c157730e043c25e9629887fd1f
Reviewed-on: https://dawn-review.googlesource.com/c/3820
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-01-21 08:29:01 +00:00
Yunchao He ea56333c1e Replace DepthStencilState builder via DepthStencilState descriptor.
This change also removes DepthStencilState object.

Bug=dawn:31

Change-Id: I7bb54ef4da527184bb2726c77d93d411d44c3956
Reviewed-on: https://dawn-review.googlesource.com/c/3541
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
2019-01-04 04:28:37 +00:00