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:
parent
f57867264a
commit
9c0faa8500
|
@ -168,7 +168,7 @@ void frame() {
|
|||
pass.Draw(3);
|
||||
}
|
||||
|
||||
pass.EndPass();
|
||||
pass.End();
|
||||
}
|
||||
|
||||
wgpu::CommandBuffer commands = encoder.Finish();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue