mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 08:27:05 +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
@@ -143,7 +143,7 @@ TEST_P(BindGroupTests, ReusedUBO) {
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetBindGroup(0, bindGroup);
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
|
||||
dawn::CommandBuffer commands = builder.GetResult();
|
||||
@@ -257,7 +257,7 @@ TEST_P(BindGroupTests, UBOSamplerAndTexture) {
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetBindGroup(0, bindGroup);
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
|
||||
dawn::CommandBuffer commands = builder.GetResult();
|
||||
|
||||
@@ -107,13 +107,13 @@ class BlendStateTest : public DawnTest {
|
||||
// First use the base pipeline to draw a triangle with no blending
|
||||
pass.SetRenderPipeline(basePipeline);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { base } })));
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
|
||||
// Then use the test pipeline to draw the test triangle with blending
|
||||
pass.SetRenderPipeline(testPipeline);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { triangle.color } })));
|
||||
pass.SetBlendColor(triangle.blendFactor[0], triangle.blendFactor[1], triangle.blendFactor[2], triangle.blendFactor[3]);
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
@@ -690,7 +690,7 @@ TEST_P(BlendStateTest, ColorWriteMaskBlendingDisabled) {
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(testPipeline);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { base } })));
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
@@ -826,11 +826,11 @@ TEST_P(BlendStateTest, IndependentBlendState) {
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderpass);
|
||||
pass.SetRenderPipeline(basePipeline);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 4>({ { base, base, base, base } })));
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
|
||||
pass.SetRenderPipeline(testPipeline);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 4>({ { color0, color1, color2, color3 } })));
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
@@ -892,10 +892,10 @@ TEST_P(BlendStateTest, DefaultBlendColor) {
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(basePipeline);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { RGBA8(0, 0, 0, 0) } })));
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.SetRenderPipeline(testPipeline);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { RGBA8(255, 255, 255, 255) } })));
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
@@ -912,11 +912,11 @@ TEST_P(BlendStateTest, DefaultBlendColor) {
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(basePipeline);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { RGBA8(0, 0, 0, 0) } })));
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.SetRenderPipeline(testPipeline);
|
||||
pass.SetBlendColor(1, 1, 1, 1);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { RGBA8(255, 255, 255, 255) } })));
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
@@ -933,21 +933,21 @@ TEST_P(BlendStateTest, DefaultBlendColor) {
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(basePipeline);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { RGBA8(0, 0, 0, 0) } })));
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.SetRenderPipeline(testPipeline);
|
||||
pass.SetBlendColor(1, 1, 1, 1);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { RGBA8(255, 255, 255, 255) } })));
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
{
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(basePipeline);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { RGBA8(0, 0, 0, 0) } })));
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.SetRenderPipeline(testPipeline);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { RGBA8(255, 255, 255, 255) } })));
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
||||
@@ -225,7 +225,7 @@ class DepthStencilStateTest : public DawnTest {
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetStencilReference(test.stencil); // Set the stencil reference
|
||||
pass.SetBindGroup(0, bindGroup); // Set the bind group which contains color and depth data
|
||||
pass.DrawArrays(6, 1, 0, 0);
|
||||
pass.Draw(6, 1, 0, 0);
|
||||
}
|
||||
pass.EndPass();
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ class DrawElementsTest : public DawnTest {
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
|
||||
pass.SetIndexBuffer(indexBuffer, 0);
|
||||
pass.DrawElements(indexCount, instanceCount, firstIndex, firstInstance);
|
||||
pass.DrawIndexed(indexCount, instanceCount, firstIndex, firstInstance);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ TEST_P(IndexFormatTest, Uint32) {
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
|
||||
pass.SetIndexBuffer(indexBuffer, 0);
|
||||
pass.DrawElements(3, 1, 0, 0);
|
||||
pass.DrawIndexed(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ TEST_P(IndexFormatTest, Uint16) {
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
|
||||
pass.SetIndexBuffer(indexBuffer, 0);
|
||||
pass.DrawElements(3, 1, 0, 0);
|
||||
pass.DrawIndexed(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ TEST_P(IndexFormatTest, Uint32PrimitiveRestart) {
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
|
||||
pass.SetIndexBuffer(indexBuffer, 0);
|
||||
pass.DrawElements(7, 1, 0, 0);
|
||||
pass.DrawIndexed(7, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ TEST_P(IndexFormatTest, Uint16PrimitiveRestart) {
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
|
||||
pass.SetIndexBuffer(indexBuffer, 0);
|
||||
pass.DrawElements(7, 1, 0, 0);
|
||||
pass.DrawIndexed(7, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ TEST_P(IndexFormatTest, ChangePipelineAfterSetIndexBuffer) {
|
||||
pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
|
||||
pass.SetIndexBuffer(indexBuffer, 0);
|
||||
pass.SetRenderPipeline(pipeline32);
|
||||
pass.DrawElements(3, 1, 0, 0);
|
||||
pass.DrawIndexed(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ TEST_P(IndexFormatTest, DISABLED_SetIndexBufferBeforeSetPipeline) {
|
||||
pass.SetIndexBuffer(indexBuffer, 0);
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
|
||||
pass.DrawElements(3, 1, 0, 0);
|
||||
pass.DrawIndexed(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
||||
@@ -176,7 +176,7 @@ class InputStateTest : public DawnTest {
|
||||
pass.SetVertexBuffers(buffer.location, 1, buffer.buffer, &zeroOffset);
|
||||
}
|
||||
|
||||
pass.DrawArrays(triangles * 3, instances, 0, 0);
|
||||
pass.Draw(triangles * 3, instances, 0, 0);
|
||||
pass.EndPass();
|
||||
|
||||
dawn::CommandBuffer commands = builder.GetResult();
|
||||
|
||||
@@ -199,7 +199,7 @@ class PrimitiveTopologyTest : public DawnTest {
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
|
||||
pass.DrawArrays(6, 1, 0, 0);
|
||||
pass.Draw(6, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
||||
@@ -258,7 +258,7 @@ TEST_P(PushConstantTest, RenderPassDefaultsToZero) {
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
// Test render push constants are set to zero by default.
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.DrawArrays(1, 1, 0, 0);
|
||||
pass.Draw(1, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
@@ -386,7 +386,7 @@ TEST_P(PushConstantTest, SeparateVertexAndFragmentConstants) {
|
||||
pass.SetPushConstants(dawn::ShaderStageBit::Vertex, 0, 1, &one);
|
||||
pass.SetPushConstants(dawn::ShaderStageBit::Fragment, 0, 1, &two);
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.DrawArrays(1, 1, 0, 0);
|
||||
pass.Draw(1, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
@@ -411,7 +411,7 @@ TEST_P(PushConstantTest, SimultaneousVertexAndFragmentConstants) {
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetPushConstants(dawn::ShaderStageBit::Vertex | dawn::ShaderStageBit::Fragment, 0, 1, &two);
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.DrawArrays(1, 1, 0, 0);
|
||||
pass.Draw(1, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ class DrawQuad {
|
||||
.GetResult();
|
||||
|
||||
pass->SetRenderPipeline(renderPipeline);
|
||||
pass->DrawArrays(6, 1, 0, 0);
|
||||
pass->Draw(6, 1, 0, 0);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -136,7 +136,7 @@ protected:
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(mRenderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(mPipeline);
|
||||
pass.SetBindGroup(0, bindGroup);
|
||||
pass.DrawArrays(6, 1, 0, 0);
|
||||
pass.Draw(6, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ TEST_P(ScissorTest, DefaultsToWholeRenderTarget) {
|
||||
{
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.DrawArrays(6, 1, 0, 0);
|
||||
pass.Draw(6, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ TEST_P(ScissorTest, LargerThanAttachment) {
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetScissorRect(0, 0, 200, 200);
|
||||
pass.DrawArrays(6, 1, 0, 0);
|
||||
pass.Draw(6, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ TEST_P(ScissorTest, EmptyRect) {
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetScissorRect(0, 0, 0, 0);
|
||||
pass.DrawArrays(6, 1, 0, 0);
|
||||
pass.Draw(6, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ TEST_P(ScissorTest, PartialRect) {
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetScissorRect(kX, kY, kW, kH);
|
||||
pass.DrawArrays(6, 1, 0, 0);
|
||||
pass.Draw(6, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ TEST_P(ScissorTest, NoInheritanceBetweenRenderPass) {
|
||||
{
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.DrawArrays(6, 1, 0, 0);
|
||||
pass.Draw(6, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ protected:
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(mRenderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetBindGroup(0, bindGroup);
|
||||
pass.DrawArrays(6, 1, 0, 0);
|
||||
pass.Draw(6, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
@@ -512,7 +512,7 @@ class TextureViewRenderingTest : public DawnTest {
|
||||
dawn::RenderPassEncoder pass =
|
||||
commandBufferBuilder.BeginRenderPass(renderPassInfo);
|
||||
pass.SetRenderPipeline(oneColorPipeline);
|
||||
pass.DrawArrays(6, 1, 0, 0);
|
||||
pass.Draw(6, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ TEST_P(ViewportOrientationTests, OriginAt0x0) {
|
||||
{
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.DrawArrays(1, 1, 0, 0);
|
||||
pass.Draw(1, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ TEST_F(VertexBufferValidationTest, VertexInputsInheritedBetweenPipelines) {
|
||||
{
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderpass);
|
||||
pass.SetRenderPipeline(pipeline1);
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
builder.GetResult();
|
||||
@@ -119,9 +119,9 @@ TEST_F(VertexBufferValidationTest, VertexInputsInheritedBetweenPipelines) {
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderpass);
|
||||
pass.SetRenderPipeline(pipeline2);
|
||||
pass.SetVertexBuffers(0, 2, vertexBuffers.data(), offsets);
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.SetRenderPipeline(pipeline1);
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
builder.GetResult();
|
||||
@@ -146,14 +146,14 @@ TEST_F(VertexBufferValidationTest, VertexInputsNotInheritedBetweenRendePasses) {
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderpass);
|
||||
pass.SetRenderPipeline(pipeline2);
|
||||
pass.SetVertexBuffers(0, 2, vertexBuffers.data(), offsets);
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
{
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderpass);
|
||||
pass.SetRenderPipeline(pipeline1);
|
||||
pass.SetVertexBuffers(0, 1, vertexBuffers.data(), offsets);
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
builder.GetResult();
|
||||
@@ -164,13 +164,13 @@ TEST_F(VertexBufferValidationTest, VertexInputsNotInheritedBetweenRendePasses) {
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderpass);
|
||||
pass.SetRenderPipeline(pipeline2);
|
||||
pass.SetVertexBuffers(0, 2, vertexBuffers.data(), offsets);
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
{
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderpass);
|
||||
pass.SetRenderPipeline(pipeline1);
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
builder.GetResult();
|
||||
|
||||
Reference in New Issue
Block a user