Add the defaults for Draw and DrawIndexed

And updates all places in tests and examples where they could have been
used.

Bug: dawn:22
Change-Id: Ic36e3f1810037b5addeb9e971b1da28fdd1da183
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/18380
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2020-03-31 16:21:35 +00:00 committed by Commit Bot service account
parent 7982cc0527
commit 67b1ad7a97
38 changed files with 161 additions and 161 deletions

View File

@ -956,19 +956,19 @@
"name": "draw",
"args": [
{"name": "vertex count", "type": "uint32_t"},
{"name": "instance count", "type": "uint32_t"},
{"name": "first vertex", "type": "uint32_t"},
{"name": "first instance", "type": "uint32_t"}
{"name": "instance count", "type": "uint32_t", "default": "1"},
{"name": "first vertex", "type": "uint32_t", "default": "0"},
{"name": "first instance", "type": "uint32_t", "default": "0"}
]
},
{
"name": "draw indexed",
"args": [
{"name": "index count", "type": "uint32_t"},
{"name": "instance count", "type": "uint32_t"},
{"name": "first index", "type": "uint32_t"},
{"name": "base vertex", "type": "int32_t"},
{"name": "first instance", "type": "uint32_t"}
{"name": "instance count", "type": "uint32_t", "default": "1"},
{"name": "first index", "type": "uint32_t", "default": "0"},
{"name": "base vertex", "type": "int32_t", "default": "0"},
{"name": "first instance", "type": "uint32_t", "default": "0"}
]
},
{
@ -1102,19 +1102,19 @@
"name": "draw",
"args": [
{"name": "vertex count", "type": "uint32_t"},
{"name": "instance count", "type": "uint32_t"},
{"name": "first vertex", "type": "uint32_t"},
{"name": "first instance", "type": "uint32_t"}
{"name": "instance count", "type": "uint32_t", "default": "1"},
{"name": "first vertex", "type": "uint32_t", "default": "0"},
{"name": "first instance", "type": "uint32_t", "default": "0"}
]
},
{
"name": "draw indexed",
"args": [
{"name": "index count", "type": "uint32_t"},
{"name": "instance count", "type": "uint32_t"},
{"name": "first index", "type": "uint32_t"},
{"name": "base vertex", "type": "int32_t"},
{"name": "first instance", "type": "uint32_t"}
{"name": "instance count", "type": "uint32_t", "default": "1"},
{"name": "first index", "type": "uint32_t", "default": "0"},
{"name": "base vertex", "type": "int32_t", "default": "0"},
{"name": "first instance", "type": "uint32_t", "default": "0"}
]
},
{

View File

@ -161,7 +161,7 @@ void frame() {
for (size_t i = 0; i < kNumTriangles; i++) {
uint32_t offset = i * sizeof(ShaderData);
pass.SetBindGroup(0, bindGroup, 1, &offset);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
}
pass.EndPass();

View File

@ -279,7 +279,7 @@ wgpu::CommandBuffer createCommandBuffer(const wgpu::TextureView backbufferView,
pass.SetPipeline(renderPipeline);
pass.SetVertexBuffer(0, bufferDst);
pass.SetVertexBuffer(1, modelBuffer);
pass.Draw(3, kNumParticles, 0, 0);
pass.Draw(3, kNumParticles);
pass.EndPass();
}

View File

@ -163,7 +163,7 @@ void frame() {
pass.SetBindGroup(0, bindGroup);
pass.SetVertexBuffer(0, vertexBuffer);
pass.SetIndexBuffer(indexBuffer);
pass.DrawIndexed(3, 1, 0, 0, 0);
pass.DrawIndexed(3);
pass.EndPass();
}

View File

@ -274,18 +274,18 @@ void frame() {
pass.SetBindGroup(0, bindGroup[0]);
pass.SetVertexBuffer(0, vertexBuffer);
pass.SetIndexBuffer(indexBuffer);
pass.DrawIndexed(36, 1, 0, 0, 0);
pass.DrawIndexed(36);
pass.SetStencilReference(0x1);
pass.SetPipeline(planePipeline);
pass.SetBindGroup(0, bindGroup[0]);
pass.SetVertexBuffer(0, planeBuffer);
pass.DrawIndexed(6, 1, 0, 0, 0);
pass.DrawIndexed(6);
pass.SetPipeline(reflectionPipeline);
pass.SetVertexBuffer(0, vertexBuffer);
pass.SetBindGroup(0, bindGroup[1]);
pass.DrawIndexed(36, 1, 0, 0, 0);
pass.DrawIndexed(36);
pass.EndPass();
}

View File

@ -140,7 +140,7 @@ void DoRender(WindowData* data) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&desc);
pass.SetPipeline(trianglePipeline);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
} else {
data->clearCycle -= 1.0 / 60.f;

View File

@ -211,7 +211,7 @@ TEST_P(BindGroupTests, ReusedUBO) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
wgpu::CommandBuffer commands = encoder.Finish();
@ -316,7 +316,7 @@ TEST_P(BindGroupTests, UBOSamplerAndTexture) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
wgpu::CommandBuffer commands = encoder.Finish();
@ -400,7 +400,7 @@ TEST_P(BindGroupTests, MultipleBindLayouts) {
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroups[0]);
pass.SetBindGroup(1, bindGroups[1]);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
wgpu::CommandBuffer commands = encoder.Finish();
@ -446,10 +446,10 @@ TEST_P(BindGroupTests, DrawTwiceInSamePipelineWithFourBindGroupSets) {
pass.SetBindGroup(1, bindGroup);
pass.SetBindGroup(2, bindGroup);
pass.SetBindGroup(3, bindGroup);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.SetPipeline(pipeline);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
wgpu::CommandBuffer commands = encoder.Finish();
@ -489,7 +489,7 @@ TEST_P(BindGroupTests, SetBindGroupBeforePipeline) {
// Set the bind group, then the pipeline, and draw.
pass.SetBindGroup(0, bindGroup);
pass.SetPipeline(pipeline);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
@ -550,7 +550,7 @@ TEST_P(BindGroupTests, SetDynamicBindGroupBeforePipeline) {
// Set the pipeline and draw.
pass.SetPipeline(pipeline);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
@ -627,7 +627,7 @@ TEST_P(BindGroupTests, BindGroupsPersistAfterPipelineChange) {
// Both bind groups match the pipeline.
// They should persist and not need to be bound again.
pass.SetPipeline(pipeline1);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
@ -721,7 +721,7 @@ TEST_P(BindGroupTests, DrawThenChangePipelineAndBindGroup) {
dynamicOffset = color2Offset;
pass.SetBindGroup(2, storageBindGroup, 1, &dynamicOffset);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
// Set the pipeline to (uniform, storage, storage)
// - The first bind group should persist (inherited on some backends)
@ -734,7 +734,7 @@ TEST_P(BindGroupTests, DrawThenChangePipelineAndBindGroup) {
dynamicOffset = color3Offset;
pass.SetBindGroup(1, storageBindGroup, 1, &dynamicOffset);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
wgpu::CommandBuffer commands = encoder.Finish();
@ -773,7 +773,7 @@ TEST_P(BindGroupTests, BindGroupLayoutVisibilityCanBeNone) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
wgpu::CommandBuffer commands = encoder.Finish();
@ -831,7 +831,7 @@ TEST_P(BindGroupTests, ArbitraryBindingNumbers) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
wgpu::CommandBuffer commands = encoder.Finish();

View File

@ -89,7 +89,7 @@ TEST_P(ClipSpaceTest, ClipSpace) {
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder renderPass = commandEncoder.BeginRenderPass(&renderPassDescriptor);
renderPass.SetPipeline(CreatePipelineForTest());
renderPass.Draw(6, 1, 0, 0);
renderPass.Draw(6);
renderPass.EndPass();
wgpu::CommandBuffer commandBuffer = commandEncoder.Finish();
wgpu::Queue queue = device.CreateQueue();

View File

@ -109,13 +109,13 @@ class ColorStateTest : public DawnTest {
// First use the base pipeline to draw a triangle with no blending
pass.SetPipeline(basePipeline);
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({{base}})));
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
// Then use the test pipeline to draw the test triangle with blending
pass.SetPipeline(testPipeline);
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({{triangle.color}})));
pass.SetBlendColor(&blendColor);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
}
@ -726,7 +726,7 @@ TEST_P(ColorStateTest, ColorWriteMaskBlendingDisabled) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(testPipeline);
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({{base}})));
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
}
@ -842,12 +842,12 @@ TEST_P(ColorStateTest, IndependentColorState) {
pass.SetPipeline(basePipeline);
pass.SetBindGroup(
0, MakeBindGroupForColors(std::array<RGBA8, 4>({{base, base, base, base}})));
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.SetPipeline(testPipeline);
pass.SetBindGroup(0, MakeBindGroupForColors(
std::array<RGBA8, 4>({{color0, color1, color2, color3}})));
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
}
@ -915,11 +915,11 @@ TEST_P(ColorStateTest, DefaultBlendColor) {
pass.SetPipeline(basePipeline);
pass.SetBindGroup(0,
MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(0, 0, 0, 0)}})));
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.SetPipeline(testPipeline);
pass.SetBindGroup(
0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}})));
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
}
@ -937,12 +937,12 @@ TEST_P(ColorStateTest, DefaultBlendColor) {
pass.SetPipeline(basePipeline);
pass.SetBindGroup(0,
MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(0, 0, 0, 0)}})));
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.SetPipeline(testPipeline);
pass.SetBlendColor(&kWhite);
pass.SetBindGroup(
0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}})));
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
}
@ -961,12 +961,12 @@ TEST_P(ColorStateTest, DefaultBlendColor) {
pass.SetPipeline(basePipeline);
pass.SetBindGroup(0,
MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(0, 0, 0, 0)}})));
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.SetPipeline(testPipeline);
pass.SetBlendColor(&kWhite);
pass.SetBindGroup(
0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}})));
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
}
{
@ -974,11 +974,11 @@ TEST_P(ColorStateTest, DefaultBlendColor) {
pass.SetPipeline(basePipeline);
pass.SetBindGroup(0,
MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(0, 0, 0, 0)}})));
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.SetPipeline(testPipeline);
pass.SetBindGroup(
0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}})));
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
}
@ -1031,7 +1031,7 @@ TEST_P(ColorStateTest, ColorWriteMaskDoesNotAffectRenderPassLoadOpClear) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(basePipeline);
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({{base}})));
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
// Set a pipeline that will dirty the color write mask
pass.SetPipeline(testPipeline);

View File

@ -180,7 +180,7 @@ class CompressedTextureBCFormatTest : public DawnTest {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(renderPipeline);
pass.SetBindGroup(0, bindGroup);
pass.Draw(6, 1, 0, 0);
pass.Draw(6);
pass.EndPass();
}

View File

@ -84,7 +84,7 @@ class CullingTest : public DawnTest {
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder renderPass = commandEncoder.BeginRenderPass(&renderPassDescriptor);
renderPass.SetPipeline(CreatePipelineForTest(frontFace, cullMode));
renderPass.Draw(6, 1, 0, 0);
renderPass.Draw(6);
renderPass.EndPass();
wgpu::CommandBuffer commandBuffer = commandEncoder.Finish();
wgpu::Queue queue = device.CreateQueue();

View File

@ -288,7 +288,7 @@ class DepthStencilStateTest : public DawnTest {
pass.SetStencilReference(test.stencil); // Set the stencil reference
pass.SetBindGroup(
0, bindGroup); // Set the bind group which contains color and depth data
pass.Draw(6, 1, 0, 0);
pass.Draw(6);
}
pass.EndPass();

View File

@ -76,7 +76,7 @@ class DestroyTest : public DawnTest {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline);
pass.SetVertexBuffer(0, vertexBuffer);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
}
wgpu::CommandBuffer commands = encoder.Finish();

View File

@ -221,7 +221,7 @@ TEST_P(DynamicBufferOffsetTests, BasicRenderPipeline) {
commandEncoder.BeginRenderPass(&renderPass.renderPassInfo);
renderPassEncoder.SetPipeline(pipeline);
renderPassEncoder.SetBindGroup(0, mBindGroups[0], offsets.size(), offsets.data());
renderPassEncoder.Draw(3, 1, 0, 0);
renderPassEncoder.Draw(3);
renderPassEncoder.EndPass();
wgpu::CommandBuffer commands = commandEncoder.Finish();
queue.Submit(1, &commands);
@ -243,7 +243,7 @@ TEST_P(DynamicBufferOffsetTests, SetDynamicOffestsRenderPipeline) {
commandEncoder.BeginRenderPass(&renderPass.renderPassInfo);
renderPassEncoder.SetPipeline(pipeline);
renderPassEncoder.SetBindGroup(0, mBindGroups[0], offsets.size(), offsets.data());
renderPassEncoder.Draw(3, 1, 0, 0);
renderPassEncoder.Draw(3);
renderPassEncoder.EndPass();
wgpu::CommandBuffer commands = commandEncoder.Finish();
queue.Submit(1, &commands);
@ -309,10 +309,10 @@ TEST_P(DynamicBufferOffsetTests, InheritDynamicOffestsRenderPipeline) {
commandEncoder.BeginRenderPass(&renderPass.renderPassInfo);
renderPassEncoder.SetPipeline(pipeline);
renderPassEncoder.SetBindGroup(0, mBindGroups[0], offsets.size(), offsets.data());
renderPassEncoder.Draw(3, 1, 0, 0);
renderPassEncoder.Draw(3);
renderPassEncoder.SetPipeline(testPipeline);
renderPassEncoder.SetBindGroup(1, mBindGroups[1]);
renderPassEncoder.Draw(3, 1, 0, 0);
renderPassEncoder.Draw(3);
renderPassEncoder.EndPass();
wgpu::CommandBuffer commands = commandEncoder.Finish();
queue.Submit(1, &commands);
@ -368,9 +368,9 @@ TEST_P(DynamicBufferOffsetTests, UpdateDynamicOffestsMultipleTimesRenderPipeline
commandEncoder.BeginRenderPass(&renderPass.renderPassInfo);
renderPassEncoder.SetPipeline(pipeline);
renderPassEncoder.SetBindGroup(0, mBindGroups[0], offsets.size(), offsets.data());
renderPassEncoder.Draw(3, 1, 0, 0);
renderPassEncoder.Draw(3);
renderPassEncoder.SetBindGroup(0, mBindGroups[0], testOffsets.size(), testOffsets.data());
renderPassEncoder.Draw(3, 1, 0, 0);
renderPassEncoder.Draw(3);
renderPassEncoder.EndPass();
wgpu::CommandBuffer commands = commandEncoder.Finish();
queue.Submit(1, &commands);

View File

@ -144,7 +144,7 @@ TEST_P(GpuMemorySyncTests, RenderPass) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(render);
pass.SetBindGroup(0, bindGroup);
pass.Draw(1, 1, 0, 0);
pass.Draw(1);
pass.EndPass();
}
@ -176,7 +176,7 @@ TEST_P(GpuMemorySyncTests, RenderPassToComputePass) {
wgpu::RenderPassEncoder pass0 = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass0.SetPipeline(render);
pass0.SetBindGroup(0, bindGroup0);
pass0.Draw(1, 1, 0, 0);
pass0.Draw(1);
pass0.EndPass();
// Read that data in compute pass.
@ -221,7 +221,7 @@ TEST_P(GpuMemorySyncTests, ComputePassToRenderPass) {
wgpu::RenderPassEncoder pass1 = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass1.SetPipeline(render);
pass1.SetBindGroup(0, bindGroup0);
pass1.Draw(1, 1, 0, 0);
pass1.Draw(1);
pass1.EndPass();
wgpu::CommandBuffer commands = encoder.Finish();
@ -325,7 +325,7 @@ TEST_P(StorageToUniformSyncTests, ReadAfterWriteWithSameCommandBuffer) {
wgpu::RenderPassEncoder pass1 = encoder0.BeginRenderPass(&renderPass.renderPassInfo);
pass1.SetPipeline(render);
pass1.SetBindGroup(0, renderBindGroup);
pass1.Draw(1, 1, 0, 0);
pass1.Draw(1);
pass1.EndPass();
wgpu::CommandBuffer commands = encoder0.Finish();
@ -364,7 +364,7 @@ TEST_P(StorageToUniformSyncTests, ReadAfterWriteWithDifferentCommandBuffers) {
wgpu::RenderPassEncoder pass1 = encoder1.BeginRenderPass(&renderPass.renderPassInfo);
pass1.SetPipeline(render);
pass1.SetBindGroup(0, renderBindGroup);
pass1.Draw(1, 1, 0, 0);
pass1.Draw(1);
pass1.EndPass();
cb[1] = encoder1.Finish();
@ -404,7 +404,7 @@ TEST_P(StorageToUniformSyncTests, ReadAfterWriteWithDifferentQueueSubmits) {
wgpu::RenderPassEncoder pass1 = encoder1.BeginRenderPass(&renderPass.renderPassInfo);
pass1.SetPipeline(render);
pass1.SetBindGroup(0, renderBindGroup);
pass1.Draw(1, 1, 0, 0);
pass1.Draw(1);
pass1.EndPass();
cb[1] = encoder1.Finish();
@ -550,7 +550,7 @@ TEST_P(MultipleWriteThenMultipleReadTests, SeparateBuffers) {
pass1.SetVertexBuffer(0, vertexBuffer);
pass1.SetIndexBuffer(indexBuffer, 0);
pass1.SetBindGroup(0, bindGroup1);
pass1.DrawIndexed(6, 1, 0, 0, 0);
pass1.DrawIndexed(6);
pass1.EndPass();
wgpu::CommandBuffer commandBuffer = encoder.Finish();
@ -674,7 +674,7 @@ TEST_P(MultipleWriteThenMultipleReadTests, OneBuffer) {
pass1.SetVertexBuffer(0, buffer);
pass1.SetIndexBuffer(buffer, offsetof(Data, indices));
pass1.SetBindGroup(0, bindGroup1);
pass1.DrawIndexed(6, 1, 0, 0, 0);
pass1.DrawIndexed(6);
pass1.EndPass();
wgpu::CommandBuffer commandBuffer = encoder.Finish();

View File

@ -318,7 +318,7 @@ class IOSurfaceUsageTests : public IOSurfaceTestBase {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup);
pass.Draw(6, 1, 0, 0);
pass.Draw(6);
pass.EndPass();
}

View File

@ -80,7 +80,7 @@ TEST_P(IndexFormatTest, Uint32) {
pass.SetPipeline(pipeline);
pass.SetVertexBuffer(0, vertexBuffer);
pass.SetIndexBuffer(indexBuffer);
pass.DrawIndexed(3, 1, 0, 0, 0);
pass.DrawIndexed(3);
pass.EndPass();
}
@ -107,7 +107,7 @@ TEST_P(IndexFormatTest, Uint16) {
pass.SetPipeline(pipeline);
pass.SetVertexBuffer(0, vertexBuffer);
pass.SetIndexBuffer(indexBuffer);
pass.DrawIndexed(3, 1, 0, 0, 0);
pass.DrawIndexed(3);
pass.EndPass();
}
@ -157,7 +157,7 @@ TEST_P(IndexFormatTest, Uint32PrimitiveRestart) {
pass.SetPipeline(pipeline);
pass.SetVertexBuffer(0, vertexBuffer);
pass.SetIndexBuffer(indexBuffer);
pass.DrawIndexed(7, 1, 0, 0, 0);
pass.DrawIndexed(7);
pass.EndPass();
}
@ -199,7 +199,7 @@ TEST_P(IndexFormatTest, Uint16PrimitiveRestart) {
pass.SetPipeline(pipeline);
pass.SetVertexBuffer(0, vertexBuffer);
pass.SetIndexBuffer(indexBuffer);
pass.DrawIndexed(7, 1, 0, 0, 0);
pass.DrawIndexed(7);
pass.EndPass();
}
@ -235,7 +235,7 @@ TEST_P(IndexFormatTest, ChangePipelineAfterSetIndexBuffer) {
pass.SetVertexBuffer(0, vertexBuffer);
pass.SetIndexBuffer(indexBuffer);
pass.SetPipeline(pipeline32);
pass.DrawIndexed(3, 1, 0, 0, 0);
pass.DrawIndexed(3);
pass.EndPass();
}
@ -265,7 +265,7 @@ TEST_P(IndexFormatTest, DISABLED_SetIndexBufferBeforeSetPipeline) {
pass.SetIndexBuffer(indexBuffer);
pass.SetPipeline(pipeline);
pass.SetVertexBuffer(0, vertexBuffer);
pass.DrawIndexed(3, 1, 0, 0, 0);
pass.DrawIndexed(3);
pass.EndPass();
}

View File

@ -112,7 +112,7 @@ class MultisampledRenderingTest : public DawnTest {
wgpu::RenderPassEncoder renderPassEncoder = commandEncoder.BeginRenderPass(&renderPass);
renderPassEncoder.SetPipeline(pipeline);
renderPassEncoder.SetBindGroup(0, bindGroup);
renderPassEncoder.Draw(3, 1, 0, 0);
renderPassEncoder.Draw(3);
renderPassEncoder.EndPass();
}

View File

@ -190,7 +190,7 @@ TEST_P(OpArrayLengthTest, Fragment) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, mBindGroup);
pass.Draw(1, 1, 0, 0);
pass.Draw(1);
pass.EndPass();
}
@ -251,7 +251,7 @@ TEST_P(OpArrayLengthTest, Vertex) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, mBindGroup);
pass.Draw(1, 1, 0, 0);
pass.Draw(1);
pass.EndPass();
}

View File

@ -200,7 +200,7 @@ class PrimitiveTopologyTest : public DawnTest {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline);
pass.SetVertexBuffer(0, vertexBuffer);
pass.Draw(6, 1, 0, 0);
pass.Draw(6);
pass.EndPass();
}

View File

@ -103,7 +103,7 @@ TEST_P(RenderBundleTest, Basic) {
renderBundleEncoder.SetPipeline(pipeline);
renderBundleEncoder.SetVertexBuffer(0, vertexBuffer);
renderBundleEncoder.SetBindGroup(0, bindGroups[0]);
renderBundleEncoder.Draw(6, 1, 0, 0);
renderBundleEncoder.Draw(6);
wgpu::RenderBundle renderBundle = renderBundleEncoder.Finish();
@ -133,7 +133,7 @@ TEST_P(RenderBundleTest, MultipleBundles) {
renderBundleEncoder.SetPipeline(pipeline);
renderBundleEncoder.SetVertexBuffer(0, vertexBuffer);
renderBundleEncoder.SetBindGroup(0, bindGroups[0]);
renderBundleEncoder.Draw(3, 1, 0, 0);
renderBundleEncoder.Draw(3);
renderBundles[0] = renderBundleEncoder.Finish();
}
@ -143,7 +143,7 @@ TEST_P(RenderBundleTest, MultipleBundles) {
renderBundleEncoder.SetPipeline(pipeline);
renderBundleEncoder.SetVertexBuffer(0, vertexBuffer);
renderBundleEncoder.SetBindGroup(0, bindGroups[1]);
renderBundleEncoder.Draw(3, 1, 3, 0);
renderBundleEncoder.Draw(3, 1, 3);
renderBundles[1] = renderBundleEncoder.Finish();
}
@ -172,7 +172,7 @@ TEST_P(RenderBundleTest, BundleAndRenderPassCommands) {
renderBundleEncoder.SetPipeline(pipeline);
renderBundleEncoder.SetVertexBuffer(0, vertexBuffer);
renderBundleEncoder.SetBindGroup(0, bindGroups[0]);
renderBundleEncoder.Draw(3, 1, 0, 0);
renderBundleEncoder.Draw(3);
wgpu::RenderBundle renderBundle = renderBundleEncoder.Finish();
@ -184,7 +184,7 @@ TEST_P(RenderBundleTest, BundleAndRenderPassCommands) {
pass.SetPipeline(pipeline);
pass.SetVertexBuffer(0, vertexBuffer);
pass.SetBindGroup(0, bindGroups[1]);
pass.Draw(3, 1, 3, 0);
pass.Draw(3, 1, 3);
pass.ExecuteBundles(1, &renderBundle);
pass.EndPass();

View File

@ -89,7 +89,7 @@ TEST_P(RenderPassTest, TwoRenderPassesInOneCommandBuffer) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.SetPipeline(pipeline);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
}
@ -101,7 +101,7 @@ TEST_P(RenderPassTest, TwoRenderPassesInOneCommandBuffer) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.SetPipeline(pipeline);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
}
@ -133,7 +133,7 @@ TEST_P(RenderPassTest, NoCorrespondingFragmentShaderOutputs) {
{
// First we draw a blue triangle in the bottom left of renderTarget.
pass.SetPipeline(pipeline);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
}
{
@ -153,7 +153,7 @@ TEST_P(RenderPassTest, NoCorrespondingFragmentShaderOutputs) {
device.CreateRenderPipeline(&descriptor);
pass.SetPipeline(pipelineWithNoFragmentOutput);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
}
pass.EndPass();

View File

@ -143,7 +143,7 @@ protected:
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&mRenderPass.renderPassInfo);
pass.SetPipeline(mPipeline);
pass.SetBindGroup(0, bindGroup);
pass.Draw(6, 1, 0, 0);
pass.Draw(6);
pass.EndPass();
}

View File

@ -57,7 +57,7 @@ TEST_P(ScissorTest, DefaultsToWholeRenderTarget) {
{
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline);
pass.Draw(6, 1, 0, 0);
pass.Draw(6);
pass.EndPass();
}
@ -80,7 +80,7 @@ TEST_P(ScissorTest, LargerThanAttachment) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline);
pass.SetScissorRect(0, 0, 200, 200);
pass.Draw(6, 1, 0, 0);
pass.Draw(6);
pass.EndPass();
}
@ -108,7 +108,7 @@ TEST_P(ScissorTest, PartialRect) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline);
pass.SetScissorRect(kX, kY, kW, kH);
pass.Draw(6, 1, 0, 0);
pass.Draw(6);
pass.EndPass();
}
@ -139,7 +139,7 @@ TEST_P(ScissorTest, NoInheritanceBetweenRenderPass) {
{
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline);
pass.Draw(6, 1, 0, 0);
pass.Draw(6);
pass.EndPass();
}

View File

@ -278,7 +278,7 @@ class TextureFormatTest : public DawnTest {
wgpu::RenderPassEncoder renderPass = encoder.BeginRenderPass(&renderPassDesc);
renderPass.SetPipeline(pipeline);
renderPass.SetBindGroup(0, bindGroup);
renderPass.Draw(3, 1, 0, 0);
renderPass.Draw(3);
renderPass.EndPass();
{

View File

@ -171,7 +171,7 @@ protected:
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&mRenderPass.renderPassInfo);
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup);
pass.Draw(6, 1, 0, 0);
pass.Draw(6);
pass.EndPass();
}
@ -507,7 +507,7 @@ class TextureViewRenderingTest : public DawnTest {
{
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassInfo);
pass.SetPipeline(oneColorPipeline);
pass.Draw(6, 1, 0, 0);
pass.Draw(6);
pass.EndPass();
}

View File

@ -399,7 +399,7 @@ TEST_P(TextureZeroInitTest, RenderingLoadingDepth) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
auto pass = encoder.BeginRenderPass(&renderPassDescriptor);
pass.SetPipeline(CreatePipelineForTest());
pass.Draw(6, 1, 0, 0);
pass.Draw(6);
pass.EndPass();
wgpu::CommandBuffer commandBuffer = encoder.Finish();
// Expect 0 lazy clears, depth stencil texture will clear using loadop
@ -441,7 +441,7 @@ TEST_P(TextureZeroInitTest, RenderingLoadingStencil) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
auto pass = encoder.BeginRenderPass(&renderPassDescriptor);
pass.SetPipeline(CreatePipelineForTest());
pass.Draw(6, 1, 0, 0);
pass.Draw(6);
pass.EndPass();
wgpu::CommandBuffer commandBuffer = encoder.Finish();
// Expect 0 lazy clears, depth stencil texture will clear using loadop
@ -480,7 +480,7 @@ TEST_P(TextureZeroInitTest, RenderingLoadingDepthStencil) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
auto pass = encoder.BeginRenderPass(&renderPassDescriptor);
pass.SetPipeline(CreatePipelineForTest());
pass.Draw(6, 1, 0, 0);
pass.Draw(6);
pass.EndPass();
wgpu::CommandBuffer commandBuffer = encoder.Finish();
// Expect 0 lazy clears, depth stencil texture will clear using loadop
@ -550,7 +550,7 @@ TEST_P(TextureZeroInitTest, RenderPassSampledTextureClear) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassDesc);
pass.SetPipeline(renderPipeline);
pass.SetBindGroup(0, bindGroup);
pass.Draw(6, 1, 0, 0);
pass.Draw(6);
pass.EndPass();
wgpu::CommandBuffer commands = encoder.Finish();
// Expect 1 lazy clear for sampled texture
@ -767,7 +767,7 @@ TEST_P(TextureZeroInitTest, RenderPassStoreOpClear) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassDesc);
pass.SetPipeline(renderPipeline);
pass.SetBindGroup(0, bindGroup);
pass.Draw(6, 1, 0, 0);
pass.Draw(6);
pass.EndPass();
commands = encoder.Finish();
// Expect 0 lazy clears, sample texture is initialized by copyBufferToTexture and render texture
@ -821,7 +821,7 @@ TEST_P(TextureZeroInitTest, RenderingLoadingDepthStencilStoreOpClear) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassDescriptor);
pass.SetPipeline(CreatePipelineForTest());
pass.Draw(6, 1, 0, 0);
pass.Draw(6);
pass.EndPass();
wgpu::CommandBuffer commandBuffer = encoder.Finish();
// Expect 0 lazy clears, depth stencil texture will clear using loadop
@ -846,7 +846,7 @@ TEST_P(TextureZeroInitTest, RenderingLoadingDepthStencilStoreOpClear) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassDescriptor);
pass.SetPipeline(CreatePipelineForTest());
pass.Draw(6, 1, 0, 0);
pass.Draw(6);
pass.EndPass();
wgpu::CommandBuffer commandBuffer = encoder.Finish();
// Expect 0 lazy clears, depth stencil texture will clear using loadop
@ -916,7 +916,7 @@ TEST_P(TextureZeroInitTest, PreservesInitializedMip) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassDesc);
pass.SetPipeline(renderPipeline);
pass.SetBindGroup(0, bindGroup);
pass.Draw(6, 1, 0, 0);
pass.Draw(6);
pass.EndPass();
commands = encoder.Finish();
// Expect 1 lazy clears, because not all mips of the sample texture are initialized by
@ -998,7 +998,7 @@ TEST_P(TextureZeroInitTest, PreservesInitializedArrayLayer) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassDesc);
pass.SetPipeline(renderPipeline);
pass.SetBindGroup(0, bindGroup);
pass.Draw(6, 1, 0, 0);
pass.Draw(6);
pass.EndPass();
commands = encoder.Finish();
// Expect 1 lazy clears, because not all array layers of the sample texture are initialized by

View File

@ -383,7 +383,7 @@ class VertexFormatTest : public DawnTest {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline);
pass.SetVertexBuffer(0, vertexBuffer);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
}

View File

@ -204,7 +204,7 @@ class VertexStateTest : public DawnTest {
pass.SetVertexBuffer(buffer.location, *buffer.buffer);
}
pass.Draw(triangles * 3, instances, 0, 0);
pass.Draw(triangles * 3, instances);
pass.EndPass();
wgpu::CommandBuffer commands = encoder.Finish();
@ -441,7 +441,7 @@ TEST_P(VertexStateTest, UnusedVertexSlot) {
pass.SetVertexBuffer(1, buffer);
pass.SetPipeline(instancePipeline);
pass.Draw(1 * 3, 4, 0, 0);
pass.Draw(3, 4);
pass.EndPass();
@ -486,10 +486,10 @@ TEST_P(VertexStateTest, MultiplePipelinesMixedVertexState) {
pass.SetVertexBuffer(1, buffer);
pass.SetPipeline(vertexPipeline);
pass.Draw(1 * 3, 1, 0, 0);
pass.Draw(3);
pass.SetPipeline(instancePipeline);
pass.Draw(1 * 3, 4, 0, 0);
pass.Draw(3, 4);
pass.EndPass();
@ -565,7 +565,7 @@ TEST_P(OptionalVertexStateTest, Basic) {
{
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline);
pass.Draw(1, 1, 0, 0);
pass.Draw(1);
pass.EndPass();
}

View File

@ -51,7 +51,7 @@ TEST_P(ViewportOrientationTests, OriginAt0x0) {
{
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline);
pass.Draw(1, 1, 0, 0);
pass.Draw(1);
pass.EndPass();
}

View File

@ -127,7 +127,7 @@ class ViewportTest : public DawnTest {
renderPass1.SetViewport(viewport.x, viewport.y, viewport.width, viewport.height,
viewport.minDepth, viewport.maxDepth);
}
renderPass1.Draw(6, 1, 0, 0);
renderPass1.Draw(6);
renderPass1.EndPass();
}
@ -147,7 +147,7 @@ class ViewportTest : public DawnTest {
wgpu::RenderPassEncoder renderPass2 =
commandEncoder.BeginRenderPass(&renderPassDescriptor2);
renderPass2.SetPipeline(CreatePipelineForTest(wgpu::CompareFunction::Greater));
renderPass2.Draw(6, 1, 0, 0);
renderPass2.Draw(6);
renderPass2.EndPass();
}

View File

@ -550,7 +550,7 @@ void DrawCallPerf::RecordRenderCommands(Encoder pass) {
UNREACHABLE();
break;
}
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
}
}

View File

@ -816,7 +816,7 @@ class SetBindGroupValidationTest : public ValidationTest {
wgpu::RenderPassEncoder renderPassEncoder = commandEncoder.BeginRenderPass(&renderPass);
renderPassEncoder.SetPipeline(renderPipeline);
renderPassEncoder.SetBindGroup(0, bindGroup, count, offsets);
renderPassEncoder.Draw(3, 1, 0, 0);
renderPassEncoder.Draw(3);
renderPassEncoder.EndPass();
if (!expectation) {
ASSERT_DEVICE_ERROR(commandEncoder.Finish());
@ -1124,7 +1124,7 @@ TEST_F(SetBindGroupPersistenceValidationTest, BindGroupBeforePipeline) {
renderPassEncoder.SetBindGroup(0, bindGroup0);
renderPassEncoder.SetBindGroup(1, bindGroup1);
renderPassEncoder.SetPipeline(pipeline);
renderPassEncoder.Draw(3, 1, 0, 0);
renderPassEncoder.Draw(3);
renderPassEncoder.EndPass();
commandEncoder.Finish();
@ -1182,13 +1182,13 @@ TEST_F(SetBindGroupPersistenceValidationTest, NotVulkanInheritance) {
renderPassEncoder.SetPipeline(pipelineA);
renderPassEncoder.SetBindGroup(0, bindGroupA0);
renderPassEncoder.SetBindGroup(1, bindGroupA1);
renderPassEncoder.Draw(3, 1, 0, 0);
renderPassEncoder.Draw(3);
renderPassEncoder.SetPipeline(pipelineB);
renderPassEncoder.SetBindGroup(0, bindGroupB0);
// This draw is valid.
// Bind group 1 persists even though it is not "inherited".
renderPassEncoder.Draw(3, 1, 0, 0);
renderPassEncoder.Draw(3);
renderPassEncoder.EndPass();
commandEncoder.Finish();

View File

@ -160,7 +160,7 @@ TEST_F(RenderBundleValidationTest, SimpleSuccess) {
renderBundleEncoder.SetBindGroup(0, bg0);
renderBundleEncoder.SetBindGroup(1, bg1);
renderBundleEncoder.SetVertexBuffer(0, vertexBuffer);
renderBundleEncoder.Draw(3, 0, 0, 0);
renderBundleEncoder.Draw(3);
wgpu::RenderBundle renderBundle = renderBundleEncoder.Finish();
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
@ -248,7 +248,7 @@ TEST_F(RenderBundleValidationTest, StateInheritance) {
renderBundleEncoder.SetBindGroup(0, bg0);
renderBundleEncoder.SetBindGroup(1, bg1);
renderBundleEncoder.SetVertexBuffer(0, vertexBuffer);
renderBundleEncoder.Draw(3, 0, 0, 0);
renderBundleEncoder.Draw(3);
ASSERT_DEVICE_ERROR(wgpu::RenderBundle renderBundle = renderBundleEncoder.Finish());
pass.ExecuteBundles(1, &renderBundle);
@ -267,7 +267,7 @@ TEST_F(RenderBundleValidationTest, StateInheritance) {
renderBundleEncoder.SetPipeline(pipeline);
renderBundleEncoder.SetVertexBuffer(0, vertexBuffer);
renderBundleEncoder.Draw(3, 0, 0, 0);
renderBundleEncoder.Draw(3);
ASSERT_DEVICE_ERROR(wgpu::RenderBundle renderBundle = renderBundleEncoder.Finish());
pass.ExecuteBundles(1, &renderBundle);
@ -286,7 +286,7 @@ TEST_F(RenderBundleValidationTest, StateInheritance) {
pass.SetBindGroup(1, bg1);
renderBundleEncoder.SetVertexBuffer(0, vertexBuffer);
renderBundleEncoder.Draw(3, 0, 0, 0);
renderBundleEncoder.Draw(3);
ASSERT_DEVICE_ERROR(wgpu::RenderBundle renderBundle = renderBundleEncoder.Finish());
pass.ExecuteBundles(1, &renderBundle);
@ -305,7 +305,7 @@ TEST_F(RenderBundleValidationTest, StateInheritance) {
renderBundleEncoder.SetPipeline(pipeline);
renderBundleEncoder.SetBindGroup(0, bg0);
renderBundleEncoder.SetBindGroup(1, bg1);
renderBundleEncoder.Draw(3, 0, 0, 0);
renderBundleEncoder.Draw(3);
ASSERT_DEVICE_ERROR(wgpu::RenderBundle renderBundle = renderBundleEncoder.Finish());
pass.ExecuteBundles(1, &renderBundle);
@ -335,7 +335,7 @@ TEST_F(RenderBundleValidationTest, StatePersistence) {
pass.SetBindGroup(0, bg0);
pass.SetBindGroup(1, bg1);
pass.SetVertexBuffer(0, vertexBuffer);
pass.Draw(3, 0, 0, 0);
pass.Draw(3);
pass.EndPass();
ASSERT_DEVICE_ERROR(commandEncoder.Finish());
@ -354,7 +354,7 @@ TEST_F(RenderBundleValidationTest, StatePersistence) {
pass.ExecuteBundles(1, &renderBundle);
pass.SetPipeline(pipeline);
pass.SetVertexBuffer(0, vertexBuffer);
pass.Draw(3, 0, 0, 0);
pass.Draw(3);
pass.EndPass();
ASSERT_DEVICE_ERROR(commandEncoder.Finish());
@ -373,7 +373,7 @@ TEST_F(RenderBundleValidationTest, StatePersistence) {
pass.ExecuteBundles(1, &renderBundle);
pass.SetVertexBuffer(0, vertexBuffer);
pass.Draw(3, 0, 0, 0);
pass.Draw(3);
pass.EndPass();
ASSERT_DEVICE_ERROR(commandEncoder.Finish());
@ -392,7 +392,7 @@ TEST_F(RenderBundleValidationTest, StatePersistence) {
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bg0);
pass.SetBindGroup(1, bg1);
pass.Draw(3, 0, 0, 0);
pass.Draw(3);
pass.EndPass();
ASSERT_DEVICE_ERROR(commandEncoder.Finish());
@ -420,7 +420,7 @@ TEST_F(RenderBundleValidationTest, ClearsState) {
pass.SetBindGroup(0, bg0);
pass.SetBindGroup(1, bg1);
pass.SetVertexBuffer(0, vertexBuffer);
pass.Draw(3, 0, 0, 0);
pass.Draw(3);
pass.EndPass();
ASSERT_DEVICE_ERROR(commandEncoder.Finish());
@ -436,7 +436,7 @@ TEST_F(RenderBundleValidationTest, ClearsState) {
pass.ExecuteBundles(1, &renderBundle);
pass.SetPipeline(pipeline);
pass.SetVertexBuffer(0, vertexBuffer);
pass.Draw(3, 0, 0, 0);
pass.Draw(3);
pass.EndPass();
ASSERT_DEVICE_ERROR(commandEncoder.Finish());
@ -452,7 +452,7 @@ TEST_F(RenderBundleValidationTest, ClearsState) {
pass.SetBindGroup(1, bg1);
pass.ExecuteBundles(1, &renderBundle);
pass.SetVertexBuffer(0, vertexBuffer);
pass.Draw(3, 0, 0, 0);
pass.Draw(3);
pass.EndPass();
ASSERT_DEVICE_ERROR(commandEncoder.Finish());
@ -468,7 +468,7 @@ TEST_F(RenderBundleValidationTest, ClearsState) {
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bg0);
pass.SetBindGroup(1, bg1);
pass.Draw(3, 0, 0, 0);
pass.Draw(3);
pass.EndPass();
ASSERT_DEVICE_ERROR(commandEncoder.Finish());
@ -484,7 +484,7 @@ TEST_F(RenderBundleValidationTest, ClearsState) {
pass.SetBindGroup(1, bg1);
pass.SetVertexBuffer(0, vertexBuffer);
pass.ExecuteBundles(0, nullptr);
pass.Draw(3, 0, 0, 0);
pass.Draw(3);
pass.EndPass();
commandEncoder.Finish();
@ -506,7 +506,7 @@ TEST_F(RenderBundleValidationTest, MultipleBundles) {
renderBundleEncoder0.SetBindGroup(0, bg0);
renderBundleEncoder0.SetBindGroup(1, bg1);
renderBundleEncoder0.SetVertexBuffer(0, vertexBuffer);
renderBundleEncoder0.Draw(3, 1, 0, 0);
renderBundleEncoder0.Draw(3);
renderBundles[0] = renderBundleEncoder0.Finish();
wgpu::RenderBundleEncoder renderBundleEncoder1 = device.CreateRenderBundleEncoder(&desc);
@ -514,7 +514,7 @@ TEST_F(RenderBundleValidationTest, MultipleBundles) {
renderBundleEncoder1.SetBindGroup(0, bg0);
renderBundleEncoder1.SetBindGroup(1, bg1);
renderBundleEncoder1.SetVertexBuffer(0, vertexBuffer);
renderBundleEncoder1.Draw(3, 1, 0, 0);
renderBundleEncoder1.Draw(3);
renderBundles[1] = renderBundleEncoder1.Finish();
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
@ -537,7 +537,7 @@ TEST_F(RenderBundleValidationTest, ExecuteMultipleTimes) {
renderBundleEncoder.SetBindGroup(0, bg0);
renderBundleEncoder.SetBindGroup(1, bg1);
renderBundleEncoder.SetVertexBuffer(0, vertexBuffer);
renderBundleEncoder.Draw(3, 1, 0, 0);
renderBundleEncoder.Draw(3);
wgpu::RenderBundle renderBundle = renderBundleEncoder.Finish();
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
@ -617,7 +617,7 @@ TEST_F(RenderBundleValidationTest, UsageTracking) {
renderBundleEncoder.SetBindGroup(0, bg0);
renderBundleEncoder.SetBindGroup(1, bg1Vertex);
renderBundleEncoder.SetVertexBuffer(0, vertexBuffer);
renderBundleEncoder.Draw(3, 0, 0, 0);
renderBundleEncoder.Draw(3);
renderBundle0 = renderBundleEncoder.Finish();
}
@ -628,7 +628,7 @@ TEST_F(RenderBundleValidationTest, UsageTracking) {
renderBundleEncoder.SetBindGroup(0, bg0);
renderBundleEncoder.SetBindGroup(1, bg1);
renderBundleEncoder.SetVertexBuffer(0, vertexStorageBuffer);
renderBundleEncoder.Draw(3, 0, 0, 0);
renderBundleEncoder.Draw(3);
renderBundle1 = renderBundleEncoder.Finish();
}
@ -640,7 +640,7 @@ TEST_F(RenderBundleValidationTest, UsageTracking) {
renderBundleEncoder.SetBindGroup(0, bg0);
renderBundleEncoder.SetBindGroup(1, bg1Vertex);
renderBundleEncoder.SetVertexBuffer(0, vertexStorageBuffer);
renderBundleEncoder.Draw(3, 0, 0, 0);
renderBundleEncoder.Draw(3);
ASSERT_DEVICE_ERROR(renderBundleEncoder.Finish());
}
@ -668,7 +668,7 @@ TEST_F(RenderBundleValidationTest, UsageTracking) {
pass.SetBindGroup(0, bg0);
pass.SetBindGroup(1, bg1Vertex);
pass.SetVertexBuffer(0, vertexBuffer);
pass.Draw(3, 0, 0, 0);
pass.Draw(3);
pass.ExecuteBundles(1, &renderBundle1);
pass.EndPass();
@ -688,7 +688,7 @@ TEST_F(RenderBundleValidationTest, UsageTracking) {
pass.SetBindGroup(0, bg0);
pass.SetBindGroup(1, bg1);
pass.SetVertexBuffer(0, vertexStorageBuffer);
pass.Draw(3, 0, 0, 0);
pass.Draw(3);
pass.EndPass();
ASSERT_DEVICE_ERROR(commandEncoder.Finish());

View File

@ -82,7 +82,7 @@ void main() {
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bg1);
pass.SetBindGroup(1, bg2);
pass.Draw(3, 0, 0, 0);
pass.Draw(3);
pass.EndPass();
commandEncoder.Finish();
}
@ -90,7 +90,7 @@ void main() {
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass);
pass.SetPipeline(pipeline);
pass.Draw(3, 0, 0, 0);
pass.Draw(3);
pass.EndPass();
ASSERT_DEVICE_ERROR(commandEncoder.Finish());
}
@ -99,7 +99,7 @@ void main() {
wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass);
pass.SetPipeline(pipeline);
pass.SetBindGroup(1, bg2);
pass.Draw(3, 0, 0, 0);
pass.Draw(3);
pass.EndPass();
ASSERT_DEVICE_ERROR(commandEncoder.Finish());
}
@ -108,7 +108,7 @@ void main() {
wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass);
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bg1);
pass.Draw(3, 0, 0, 0);
pass.Draw(3);
pass.EndPass();
ASSERT_DEVICE_ERROR(commandEncoder.Finish());
}

View File

@ -232,10 +232,10 @@ namespace {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass);
pass.SetIndexBuffer(buffer);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.SetBindGroup(0, bg);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
ASSERT_DEVICE_ERROR(encoder.Finish());

View File

@ -101,7 +101,7 @@ TEST_F(VertexBufferValidationTest, VertexBuffersInheritedBetweenPipelines) {
{
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.SetPipeline(pipeline1);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
}
ASSERT_DEVICE_ERROR(encoder.Finish());
@ -113,9 +113,9 @@ TEST_F(VertexBufferValidationTest, VertexBuffersInheritedBetweenPipelines) {
pass.SetPipeline(pipeline2);
pass.SetVertexBuffer(0, vertexBuffer1);
pass.SetVertexBuffer(1, vertexBuffer2);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.SetPipeline(pipeline1);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
}
encoder.Finish();
@ -139,14 +139,14 @@ TEST_F(VertexBufferValidationTest, VertexBuffersNotInheritedBetweenRendePasses)
pass.SetPipeline(pipeline2);
pass.SetVertexBuffer(0, vertexBuffer1);
pass.SetVertexBuffer(1, vertexBuffer2);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
}
{
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.SetPipeline(pipeline1);
pass.SetVertexBuffer(0, vertexBuffer1);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
}
encoder.Finish();
@ -158,13 +158,13 @@ TEST_F(VertexBufferValidationTest, VertexBuffersNotInheritedBetweenRendePasses)
pass.SetPipeline(pipeline2);
pass.SetVertexBuffer(0, vertexBuffer1);
pass.SetVertexBuffer(1, vertexBuffer2);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
}
{
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.SetPipeline(pipeline1);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
}
ASSERT_DEVICE_ERROR(encoder.Finish());

View File

@ -136,7 +136,7 @@ TEST_P(D3D12DescriptorHeapTests, SwitchOverHeaps) {
for (uint32_t i = 0; i < samplerHeapSize + 1; ++i) {
pass.SetBindGroup(0, utils::MakeBindGroup(device, renderPipeline.GetBindGroupLayout(0),
{{0, sampler}}));
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
}
pass.EndPass();
@ -313,7 +313,7 @@ TEST_P(D3D12DescriptorHeapTests, EncodeManyUBO) {
for (uint32_t i = 0; i < numOfEncodedBindGroups; ++i) {
pass.SetBindGroup(0, bindGroups[i]);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
}
pass.EndPass();
@ -360,7 +360,7 @@ TEST_P(D3D12DescriptorHeapTests, EncodeUBOOverflowMultipleSubmit) {
pass.SetPipeline(renderPipeline);
pass.SetBindGroup(0, bindGroup);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
}
@ -399,7 +399,7 @@ TEST_P(D3D12DescriptorHeapTests, EncodeUBOOverflowMultipleSubmit) {
for (uint32_t i = 0; i < heapSize; ++i) {
pass.SetBindGroup(0, bindGroups[i]);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
}
pass.EndPass();
@ -455,12 +455,12 @@ TEST_P(D3D12DescriptorHeapTests, EncodeReuseUBOOverflow) {
// Encode a heap worth of descriptors plus one more.
for (uint32_t i = 0; i < heapSize + 1; ++i) {
pass.SetBindGroup(0, bindGroups[i]);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
}
// Re-encode the first bindgroup again.
pass.SetBindGroup(0, bindGroups[0]);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
}
@ -518,7 +518,7 @@ TEST_P(D3D12DescriptorHeapTests, EncodeReuseUBOMultipleSubmits) {
for (uint32_t i = 0; i < heapSize + 1; ++i) {
pass.SetBindGroup(0, bindGroups[i]);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
}
pass.EndPass();
@ -540,7 +540,7 @@ TEST_P(D3D12DescriptorHeapTests, EncodeReuseUBOMultipleSubmits) {
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroups[0]);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
pass.EndPass();
}
@ -672,7 +672,7 @@ TEST_P(D3D12DescriptorHeapTests, EncodeManyUBOAndSamplers) {
for (uint32_t i = 0; i < kNumOfHeaps * bindGroupsPerHeap; ++i) {
pass.SetBindGroup(0, bindGroups[i % kNumOfBindGroups]);
pass.Draw(3, 1, 0, 0);
pass.Draw(3);
}
pass.EndPass();