mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-08 21:17:45 +00:00
Rename draw commands to match WebGPU IDL
BUG=dawn:51 Change-Id: I2a78f4e77c54aeae48d3fb78bf4701352ff40529 Reviewed-on: https://dawn-review.googlesource.com/c/3040 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This commit is contained in:
committed by
Commit Bot service account
parent
48a1923afb
commit
c789b84d8d
@@ -145,7 +145,7 @@ void frame() {
|
||||
for (int k = 0; k < 10000; k++) {
|
||||
shaderData[i].time = f / 60.0f;
|
||||
pass.SetPushConstants(dawn::ShaderStageBit::Vertex, 0, 6, reinterpret_cast<uint32_t*>(&shaderData[i]));
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ void frame() {
|
||||
|
||||
dawnRenderPassEncoder pass = dawnCommandBufferBuilderBeginRenderPass(builder, renderpassInfo);
|
||||
dawnRenderPassEncoderSetRenderPipeline(pass, pipeline);
|
||||
dawnRenderPassEncoderDrawArrays(pass, 3, 1, 0, 0);
|
||||
dawnRenderPassEncoderDraw(pass, 3, 1, 0, 0);
|
||||
dawnRenderPassEncoderEndPass(pass);
|
||||
dawnRenderPassEncoderRelease(pass);
|
||||
|
||||
|
||||
@@ -264,7 +264,7 @@ dawn::CommandBuffer createCommandBuffer(const dawn::RenderPassDescriptor& render
|
||||
pass.SetRenderPipeline(renderPipeline);
|
||||
pass.SetVertexBuffers(0, 1, &bufferDst, zeroOffsets);
|
||||
pass.SetVertexBuffers(1, 1, &modelBuffer, zeroOffsets);
|
||||
pass.DrawArrays(3, kNumParticles, 0, 0);
|
||||
pass.Draw(3, kNumParticles, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ void frame() {
|
||||
pass.SetBindGroup(0, bindGroup);
|
||||
pass.SetVertexBuffers(0, 1, &vertexBuffer, vertexBufferOffsets);
|
||||
pass.SetIndexBuffer(indexBuffer, 0);
|
||||
pass.DrawElements(3, 1, 0, 0);
|
||||
pass.DrawIndexed(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
||||
@@ -269,18 +269,18 @@ void frame() {
|
||||
pass.SetBindGroup(0, bindGroup[0]);
|
||||
pass.SetVertexBuffers(0, 1, &vertexBuffer, vertexBufferOffsets);
|
||||
pass.SetIndexBuffer(indexBuffer, 0);
|
||||
pass.DrawElements(36, 1, 0, 0);
|
||||
pass.DrawIndexed(36, 1, 0, 0);
|
||||
|
||||
pass.SetStencilReference(0x1);
|
||||
pass.SetRenderPipeline(planePipeline);
|
||||
pass.SetBindGroup(0, bindGroup[0]);
|
||||
pass.SetVertexBuffers(0, 1, &planeBuffer, vertexBufferOffsets);
|
||||
pass.DrawElements(6, 1, 0, 0);
|
||||
pass.DrawIndexed(6, 1, 0, 0);
|
||||
|
||||
pass.SetRenderPipeline(reflectionPipeline);
|
||||
pass.SetVertexBuffers(0, 1, &vertexBuffer, vertexBufferOffsets);
|
||||
pass.SetBindGroup(0, bindGroup[1]);
|
||||
pass.DrawElements(36, 1, 0, 0);
|
||||
pass.DrawIndexed(36, 1, 0, 0);
|
||||
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
@@ -531,10 +531,10 @@ namespace {
|
||||
}
|
||||
const auto& oIndicesBuffer = buffers.at(iIndices.bufferView);
|
||||
pass.SetIndexBuffer(oIndicesBuffer, static_cast<uint32_t>(iIndices.byteOffset));
|
||||
pass.DrawElements(static_cast<uint32_t>(iIndices.count), 1, 0, 0);
|
||||
pass.DrawIndexed(static_cast<uint32_t>(iIndices.count), 1, 0, 0);
|
||||
} else {
|
||||
// DrawArrays
|
||||
pass.DrawArrays(vertexCount, 1, 0, 0);
|
||||
pass.Draw(vertexCount, 1, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user