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>
This commit is contained in:
Corentin Wallez
2021-03-18 16:46:58 +00:00
committed by Commit Bot service account
parent 8ce8271c34
commit 9895c273d6
6 changed files with 147 additions and 140 deletions

View File

@@ -113,15 +113,15 @@ void init() {
})");
wgpu::BindGroupLayout bgl = utils::MakeBindGroupLayout(
device, {{0, wgpu::ShaderStage::Vertex, wgpu::BindingType::UniformBuffer, true}});
device, {{0, wgpu::ShaderStage::Vertex, wgpu::BufferBindingType::Uniform, true}});
utils::ComboRenderPipelineDescriptor descriptor(device);
utils::ComboRenderPipelineDescriptor2 descriptor;
descriptor.layout = utils::MakeBasicPipelineLayout(device, &bgl);
descriptor.vertexStage.module = vsModule;
descriptor.cFragmentStage.module = fsModule;
descriptor.cColorStates[0].format = GetPreferredSwapChainTextureFormat();
descriptor.vertex.module = vsModule;
descriptor.cFragment.module = fsModule;
descriptor.cTargets[0].format = GetPreferredSwapChainTextureFormat();
pipeline = device.CreateRenderPipeline(&descriptor);
pipeline = device.CreateRenderPipeline2(&descriptor);
shaderData.resize(kNumTriangles);
for (auto& data : shaderData) {