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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
This change also removes BlendState object.
Bug=dawn:32
Change-Id: I8bf4ff7531e7504efb17b6bae3ca01f1f2b4131e
Reviewed-on: https://dawn-review.googlesource.com/c/3042
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
To match the WebGPU idl, SetRenderPipeline and SetComputePipeline need to change
the name to SetPipeline.
This patch just rename these two APIs
BUG=dawn:52
Change-Id: I2545c94158ebd051027a018650bf760a25845d73
Reviewed-on: https://dawn-review.googlesource.com/c/3480
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
This patch is the first one of the descriptorization of render pass. In
this patch we add support of RenderPassColorAttachmentDescriptor
and RenderPassDepthStencilAttachmentDescriptor to
RenderPassDescriptorBuilder.
This patch also adds StoreOp to render pass color and depth stencil
attachment descriptor.
RenderPassDescriptorBuilder will be completely removed in the next
patch.
BUG=dawn:6, dawn:49
TEST=dawn_end2end_tests, dawn_unittests
Change-Id: If623b41d04016425efa53932ae1648daf2263675
Reviewed-on: https://dawn-review.googlesource.com/c/3300
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This patch remove render pipeline builder and use descriptor to create render pipeline.
Sub-objects in descriptor will be removed in future.
Bug: dawn:4
Change-Id: I58dd569c7be42c2648311847b939c681189c2854
Reviewed-on: https://dawn-review.googlesource.com/c/2180
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
This splits off part of CommandBufferBuilder in separate
RenderPassEncoder and ComputePassEncoder objects. To match the WebGPU
IDL and factor some code, both these encoders inherit from
ProgrammablePassEncoder.
These encoders are pure frontend objects and record into the
CommandBufferBuilder command allocator objects, so no changes to the
backends were needed.
Error handling is still ew, because the "builder" mechanism we had
doesn't allow for "split builders". Nicer error handling will have to
wait on Dawn matching WebGPU.
All the tests and samples were updated to the new structure.
BUG=dawn:5
Change-Id: I5f5d4ad866e2c07fedd1ba7a122258c6610941f1
Reviewed-on: https://dawn-review.googlesource.com/1543
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This patch is the first one to descriptorze texture view. In this
patch, we completely remove TextureViewBuilder and add the entry
point CreateDefaultTextureView for creating a texture view on a
non-array 2D texture using the same type and format.
Texture view descriptors and 2D array texture views will be supported
in the next patch.
BUG=dawn:1, dawn:16
Change-Id: Ibd2a0bcf02cbb567a98d2faaaaa897eff2c062e5
Reviewed-on: https://dawn-review.googlesource.com/1440
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This removes the following for both Buffer and Texture:
- The builder's SetInitialUsage
- The object's FreezeUsage and TransitionUsage methods
- The CommandBuffer Transition<Object>Usage methods
All samples and tests are simplified as a result. This also obsoletes
the UsageValidationTest which is removed.
Some validation was dependent on "current usage" and hasn't been
reintroduced for implicit transitions yet:
- Buffers can be used while mapped
- Swapchain textures can be used after they have been presented.
Validation for these will involve collecting all the resources used by a
command buffer and will be done in a follow-up patch.
We are changing all object creation to use descriptors but there is no
creation argument to pass for queue, so instead Device::CreateQueue
takes no argument.
This as an API change to get closer to the direction in which WebGPU is
headed. The API change in next.json caused a ton of files to be changed
in the same commit to keep things compiling.
API: the Framebuffer and RenderPass objects are now merged in a single
RenderPassInfo that contains the attachments, loadOps and clear values
for a BeginRenderPass command. The concept of subpass is removed.
The RenderPass creation argument to RenderPipelines is replaced by
explicitly setting the format of attachments for RenderPipeline.
Validation: SetPipeline checks are changed to check that the attachments
info set on a RenderPipeline matches the attachments of the render pass.
Backends: Most changes are simplifications of the backends that no
longer require and indirection to query the current subpass out of the
render pass in BeginSubpass, and don't need to get the attachment info
from a RenderPass when creating RenderPipelines. In the Vulkan backend,
a VkRenderPass cache is added to reuse VkRenderPasses between
RenderPassInfos and RenderPipelines.
Tests and examples: they are updated with the simplified API. Tests
specific to the Framebuffer and RenderPass objects were removed and
validation tests for RenderPassInfo were added.
Tested by running CppHelloTriangle on all backends, end2end tests on all
platforms and all examples on the GL backend.
Explicitly configure swap chain usage in bindings and examples
Fix missing case in switch
Make swap chain Present usage implicit
Author: Austin Eng <enga@google.com>