Add render pass color and depth stencil attachment descriptor

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>
diff --git a/examples/SampleUtils.cpp b/examples/SampleUtils.cpp
index 92b8a81..99e1519 100644
--- a/examples/SampleUtils.cpp
+++ b/examples/SampleUtils.cpp
@@ -157,9 +157,25 @@
     dawn::RenderPassDescriptor* info) {
     *backbuffer = swapchain.GetNextTexture();
     auto backbufferView = backbuffer->CreateDefaultTextureView();
+    dawn::RenderPassColorAttachmentDescriptor colorAttachment;
+    colorAttachment.attachment = backbufferView;
+    colorAttachment.resolveTarget = nullptr;
+    colorAttachment.clearColor = { 0.0f, 0.0f, 0.0f, 0.0f };
+    colorAttachment.loadOp = dawn::LoadOp::Clear;
+    colorAttachment.storeOp = dawn::StoreOp::Store;
+
+    dawn::RenderPassDepthStencilAttachmentDescriptor depthStencilAttachment;
+    depthStencilAttachment.attachment = depthStencilView;
+    depthStencilAttachment.depthLoadOp = dawn::LoadOp::Clear;
+    depthStencilAttachment.stencilLoadOp = dawn::LoadOp::Clear;
+    depthStencilAttachment.clearDepth = 1.0f;
+    depthStencilAttachment.clearStencil = 0;
+    depthStencilAttachment.depthStoreOp = dawn::StoreOp::Store;
+    depthStencilAttachment.stencilStoreOp = dawn::StoreOp::Store;
+
     *info = device.CreateRenderPassDescriptorBuilder()
-        .SetColorAttachment(0, backbufferView, dawn::LoadOp::Clear)
-        .SetDepthStencilAttachment(depthStencilView, dawn::LoadOp::Clear, dawn::LoadOp::Clear)
+        .SetColorAttachments(1, &colorAttachment)
+        .SetDepthStencilAttachment(&depthStencilAttachment)
         .GetResult();
 }