Fix deprecated API usages in samples

Bug: None
Change-Id: I13a05e6edf5dbd9419d6f2fa813ca0651c5ff6a1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84764
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2022-03-31 09:30:35 +00:00 committed by Dawn LUCI CQ
parent f57867264a
commit 9c0faa8500
5 changed files with 10 additions and 10 deletions

View File

@ -168,7 +168,7 @@ void frame() {
pass.Draw(3);
}
pass.EndPass();
pass.End();
}
wgpu::CommandBuffer commands = encoder.Finish();

View File

@ -112,7 +112,7 @@ void frame() {
{
colorAttachment.view = backbufferView;
colorAttachment.resolveTarget = nullptr;
colorAttachment.clearColor = {0.0f, 0.0f, 0.0f, 0.0f};
colorAttachment.clearValue = {0.0f, 0.0f, 0.0f, 0.0f};
colorAttachment.loadOp = WGPULoadOp_Clear;
colorAttachment.storeOp = WGPUStoreOp_Store;
renderpassInfo.colorAttachmentCount = 1;
@ -126,7 +126,7 @@ void frame() {
WGPURenderPassEncoder pass = wgpuCommandEncoderBeginRenderPass(encoder, &renderpassInfo);
wgpuRenderPassEncoderSetPipeline(pass, pipeline);
wgpuRenderPassEncoderDraw(pass, 3, 1, 0, 0);
wgpuRenderPassEncoderEndPass(pass);
wgpuRenderPassEncoderEnd(pass);
wgpuRenderPassEncoderRelease(pass);
commands = wgpuCommandEncoderFinish(encoder, nullptr);

View File

@ -165,7 +165,7 @@ void initSim() {
particles : array<Particle>;
};
@binding(0) @group(0) var<uniform> params : SimParams;
@binding(1) @group(0) var<storage, read> particlesA : Particles;
@binding(1) @group(0) var<storage, read_write> particlesA : Particles;
@binding(2) @group(0) var<storage, read_write> particlesB : Particles;
// https://github.com/austinEng/Project6-Vulkan-Flocking/blob/master/data/shaders/computeparticles/particle.comp
@ -276,7 +276,7 @@ wgpu::CommandBuffer createCommandBuffer(const wgpu::TextureView backbufferView,
pass.SetPipeline(updatePipeline);
pass.SetBindGroup(0, updateBGs[i]);
pass.Dispatch(kNumParticles);
pass.EndPass();
pass.End();
}
{
@ -286,7 +286,7 @@ wgpu::CommandBuffer createCommandBuffer(const wgpu::TextureView backbufferView,
pass.SetVertexBuffer(0, bufferDst);
pass.SetVertexBuffer(1, modelBuffer);
pass.Draw(3, kNumParticles);
pass.EndPass();
pass.End();
}
return encoder.Finish();

View File

@ -161,7 +161,7 @@ void frame() {
pass.SetVertexBuffer(0, vertexBuffer);
pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint32);
pass.DrawIndexed(3);
pass.EndPass();
pass.End();
}
wgpu::CommandBuffer commands = encoder.Finish();

View File

@ -142,7 +142,7 @@ void DoRender(WindowData* data) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&desc);
pass.SetPipeline(trianglePipeline);
pass.Draw(3);
pass.EndPass();
pass.End();
} else {
data->clearCycle -= 1.0 / 60.f;
if (data->clearCycle < 0.0) {
@ -151,11 +151,11 @@ void DoRender(WindowData* data) {
utils::ComboRenderPassDescriptor desc({view});
desc.cColorAttachments[0].loadOp = wgpu::LoadOp::Clear;
desc.cColorAttachments[0].clearColor = {data->clearCycle, 1.0f - data->clearCycle, 0.0f,
desc.cColorAttachments[0].clearValue = {data->clearCycle, 1.0f - data->clearCycle, 0.0f,
1.0f};
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&desc);
pass.EndPass();
pass.End();
}
wgpu::CommandBuffer commands = encoder.Finish();