Make the dynamicOffsets optional in SetBindGroup.

BUG=dawn:22

Change-Id: I9d032d9be16a483046edc6055b86e61ae08118e4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12023
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2019-10-09 16:08:42 +00:00 committed by Commit Bot service account
parent 16d20837cc
commit 70c8c10571
24 changed files with 115 additions and 114 deletions

View File

@ -395,8 +395,8 @@
"args": [
{"name": "group index", "type": "uint32_t"},
{"name": "group", "type": "bind group"},
{"name": "dynamic offset count", "type": "uint32_t"},
{"name": "dynamic offsets", "type": "uint64_t", "annotation": "const*", "length": "dynamic offset count"}
{"name": "dynamic offset count", "type": "uint32_t", "default": "0"},
{"name": "dynamic offsets", "type": "uint64_t", "annotation": "const*", "length": "dynamic offset count", "optional": true}
]
},
{
@ -826,8 +826,8 @@
"args": [
{"name": "group index", "type": "uint32_t"},
{"name": "group", "type": "bind group"},
{"name": "dynamic offset count", "type": "uint32_t"},
{"name": "dynamic offsets", "type": "uint64_t", "annotation": "const*", "length": "dynamic offset count"}
{"name": "dynamic offset count", "type": "uint32_t", "default": "0"},
{"name": "dynamic offsets", "type": "uint64_t", "annotation": "const*", "length": "dynamic offset count", "optional": true}
]
},
{
@ -973,8 +973,8 @@
"args": [
{"name": "group index", "type": "uint32_t"},
{"name": "group", "type": "bind group"},
{"name": "dynamic offset count", "type": "uint32_t"},
{"name": "dynamic offsets", "type": "uint64_t", "annotation": "const*", "length": "dynamic offset count"}
{"name": "dynamic offset count", "type": "uint32_t", "default": "0"},
{"name": "dynamic offsets", "type": "uint64_t", "annotation": "const*", "length": "dynamic offset count", "optional": true}
]
},
{

View File

@ -269,7 +269,7 @@ dawn::CommandBuffer createCommandBuffer(const dawn::Texture backbuffer, size_t i
{
dawn::ComputePassEncoder pass = encoder.BeginComputePass();
pass.SetPipeline(updatePipeline);
pass.SetBindGroup(0, updateBGs[i], 0, nullptr);
pass.SetBindGroup(0, updateBGs[i]);
pass.Dispatch(kNumParticles, 1, 1);
pass.EndPass();
}

View File

@ -161,7 +161,7 @@ void frame() {
{
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup, 0, nullptr);
pass.SetBindGroup(0, bindGroup);
pass.SetVertexBuffers(0, 1, &vertexBuffer, vertexBufferOffsets);
pass.SetIndexBuffer(indexBuffer, 0);
pass.DrawIndexed(3, 1, 0, 0, 0);

View File

@ -272,20 +272,20 @@ void frame() {
{
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup[0], 0, nullptr);
pass.SetBindGroup(0, bindGroup[0]);
pass.SetVertexBuffers(0, 1, &vertexBuffer, vertexBufferOffsets);
pass.SetIndexBuffer(indexBuffer, 0);
pass.DrawIndexed(36, 1, 0, 0, 0);
pass.SetStencilReference(0x1);
pass.SetPipeline(planePipeline);
pass.SetBindGroup(0, bindGroup[0], 0, nullptr);
pass.SetBindGroup(0, bindGroup[0]);
pass.SetVertexBuffers(0, 1, &planeBuffer, vertexBufferOffsets);
pass.DrawIndexed(6, 1, 0, 0, 0);
pass.SetPipeline(reflectionPipeline);
pass.SetVertexBuffers(0, 1, &vertexBuffer, vertexBufferOffsets);
pass.SetBindGroup(0, bindGroup[1], 0, nullptr);
pass.SetBindGroup(0, bindGroup[1]);
pass.DrawIndexed(36, 1, 0, 0, 0);
pass.EndPass();

View File

@ -28,7 +28,7 @@ protected:
dawn::CommandEncoder encoder = device.CreateCommandEncoder();
dawn::ComputePassEncoder pass = encoder.BeginComputePass();
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup, 0, nullptr);
pass.SetBindGroup(0, bindGroup);
pass.Dispatch(1, 1, 1);
pass.EndPass();
return encoder.Finish();
@ -219,7 +219,7 @@ TEST_P(BindGroupTests, ReusedUBO) {
dawn::CommandEncoder encoder = device.CreateCommandEncoder();
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup, 0, nullptr);
pass.SetBindGroup(0, bindGroup);
pass.Draw(3, 1, 0, 0);
pass.EndPass();
@ -335,7 +335,7 @@ TEST_P(BindGroupTests, UBOSamplerAndTexture) {
encoder.CopyBufferToTexture(&bufferCopyView, &textureCopyView, &copySize);
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup, 0, nullptr);
pass.SetBindGroup(0, bindGroup);
pass.Draw(3, 1, 0, 0);
pass.EndPass();
@ -431,8 +431,8 @@ TEST_P(BindGroupTests, MultipleBindLayouts) {
dawn::CommandEncoder encoder = device.CreateCommandEncoder();
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroups[0], 0, nullptr);
pass.SetBindGroup(1, bindGroups[1], 0, nullptr);
pass.SetBindGroup(0, bindGroups[0]);
pass.SetBindGroup(1, bindGroups[1]);
pass.Draw(3, 1, 0, 0);
pass.EndPass();
@ -473,10 +473,10 @@ TEST_P(BindGroupTests, DrawTwiceInSamePipelineWithFourBindGroupSets) {
dawn::BindGroup bindGroup =
utils::MakeBindGroup(device, layout, {{0, uniformBuffer, 0, sizeof(color)}});
pass.SetBindGroup(0, bindGroup, 0, nullptr);
pass.SetBindGroup(1, bindGroup, 0, nullptr);
pass.SetBindGroup(2, bindGroup, 0, nullptr);
pass.SetBindGroup(3, bindGroup, 0, nullptr);
pass.SetBindGroup(0, bindGroup);
pass.SetBindGroup(1, bindGroup);
pass.SetBindGroup(2, bindGroup);
pass.SetBindGroup(3, bindGroup);
pass.Draw(3, 1, 0, 0);
pass.SetPipeline(pipeline);
@ -518,7 +518,7 @@ TEST_P(BindGroupTests, SetBindGroupBeforePipeline) {
utils::MakeBindGroup(device, layout, {{0, uniformBuffer, 0, sizeof(color)}});
// Set the bind group, then the pipeline, and draw.
pass.SetBindGroup(0, bindGroup, 0, nullptr);
pass.SetBindGroup(0, bindGroup);
pass.SetPipeline(pipeline);
pass.Draw(3, 1, 0, 0);

View File

@ -116,12 +116,12 @@ class ColorStateTest : public DawnTest {
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
// First use the base pipeline to draw a triangle with no blending
pass.SetPipeline(basePipeline);
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({{base}})), 0, nullptr);
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({{base}})));
pass.Draw(3, 1, 0, 0);
// 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}})), 0, nullptr);
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({{triangle.color}})));
pass.SetBlendColor(&blendColor);
pass.Draw(3, 1, 0, 0);
pass.EndPass();
@ -735,7 +735,7 @@ TEST_P(ColorStateTest, ColorWriteMaskBlendingDisabled) {
{
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(testPipeline);
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({{base}})), 0, nullptr);
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({{base}})));
pass.Draw(3, 1, 0, 0);
pass.EndPass();
}
@ -853,12 +853,12 @@ TEST_P(ColorStateTest, IndependentColorState) {
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.SetPipeline(basePipeline);
pass.SetBindGroup(
0, MakeBindGroupForColors(std::array<RGBA8, 4>({{base, base, base, base}})), 0, nullptr);
0, MakeBindGroupForColors(std::array<RGBA8, 4>({{base, base, base, base}})));
pass.Draw(3, 1, 0, 0);
pass.SetPipeline(testPipeline);
pass.SetBindGroup(0, MakeBindGroupForColors(
std::array<RGBA8, 4>({{color0, color1, color2, color3}})), 0, nullptr);
std::array<RGBA8, 4>({{color0, color1, color2, color3}})));
pass.Draw(3, 1, 0, 0);
pass.EndPass();
}
@ -928,11 +928,11 @@ TEST_P(ColorStateTest, DefaultBlendColor) {
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(basePipeline);
pass.SetBindGroup(0,
MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(0, 0, 0, 0)}})), 0, nullptr);
MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(0, 0, 0, 0)}})));
pass.Draw(3, 1, 0, 0);
pass.SetPipeline(testPipeline);
pass.SetBindGroup(
0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}})), 0, nullptr);
0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}})));
pass.Draw(3, 1, 0, 0);
pass.EndPass();
}
@ -950,12 +950,12 @@ TEST_P(ColorStateTest, DefaultBlendColor) {
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(basePipeline);
pass.SetBindGroup(0,
MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(0, 0, 0, 0)}})), 0, nullptr);
MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(0, 0, 0, 0)}})));
pass.Draw(3, 1, 0, 0);
pass.SetPipeline(testPipeline);
pass.SetBlendColor(&kWhite);
pass.SetBindGroup(
0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}})), 0, nullptr);
0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}})));
pass.Draw(3, 1, 0, 0);
pass.EndPass();
}
@ -974,12 +974,12 @@ TEST_P(ColorStateTest, DefaultBlendColor) {
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(basePipeline);
pass.SetBindGroup(0,
MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(0, 0, 0, 0)}})), 0, nullptr);
MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(0, 0, 0, 0)}})));
pass.Draw(3, 1, 0, 0);
pass.SetPipeline(testPipeline);
pass.SetBlendColor(&kWhite);
pass.SetBindGroup(
0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}})), 0, nullptr);
0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}})));
pass.Draw(3, 1, 0, 0);
pass.EndPass();
}
@ -987,11 +987,11 @@ TEST_P(ColorStateTest, DefaultBlendColor) {
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(basePipeline);
pass.SetBindGroup(0,
MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(0, 0, 0, 0)}})), 0, nullptr);
MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(0, 0, 0, 0)}})));
pass.Draw(3, 1, 0, 0);
pass.SetPipeline(testPipeline);
pass.SetBindGroup(
0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}})), 0, nullptr);
0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}})));
pass.Draw(3, 1, 0, 0);
pass.EndPass();
}
@ -1046,7 +1046,7 @@ TEST_P(ColorStateTest, ColorWriteMaskDoesNotAffectRenderPassLoadOpClear) {
// Clear the output attachment to |base|
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(basePipeline);
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({{base}})), 0, nullptr);
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({{base}})));
pass.Draw(3, 1, 0, 0);
// Set a pipeline that will dirty the color write mask

View File

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

View File

@ -80,7 +80,7 @@ void ComputeCopyStorageBufferTests::BasicTest(const char* shader) {
dawn::CommandEncoder encoder = device.CreateCommandEncoder();
dawn::ComputePassEncoder pass = encoder.BeginComputePass();
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup, 0, nullptr);
pass.SetBindGroup(0, bindGroup);
pass.Dispatch(kInstances, 1, 1);
pass.EndPass();

View File

@ -90,7 +90,7 @@ void ComputeIndirectTests::BasicTest(std::initializer_list<uint32_t> bufferList,
dawn::CommandEncoder encoder = device.CreateCommandEncoder();
dawn::ComputePassEncoder pass = encoder.BeginComputePass();
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup, 0, nullptr);
pass.SetBindGroup(0, bindGroup);
pass.DispatchIndirect(indirectBuffer, indirectOffset);
pass.EndPass();

View File

@ -61,7 +61,7 @@ void ComputeSharedMemoryTests::BasicTest(const char* shader) {
dawn::CommandEncoder encoder = device.CreateCommandEncoder();
dawn::ComputePassEncoder pass = encoder.BeginComputePass();
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup, 0, nullptr);
pass.SetBindGroup(0, bindGroup);
pass.Dispatch(1, 1, 1);
pass.EndPass();

View File

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

View File

@ -311,7 +311,7 @@ TEST_P(DynamicBufferOffsetTests, InheritDynamicOffestsRenderPipeline) {
renderPassEncoder.SetBindGroup(0, mBindGroups[0], offsets.size(), offsets.data());
renderPassEncoder.Draw(3, 1, 0, 0);
renderPassEncoder.SetPipeline(testPipeline);
renderPassEncoder.SetBindGroup(1, mBindGroups[1], 0, nullptr);
renderPassEncoder.SetBindGroup(1, mBindGroups[1]);
renderPassEncoder.Draw(3, 1, 0, 0);
renderPassEncoder.EndPass();
dawn::CommandBuffer commands = commandEncoder.Finish();
@ -341,7 +341,7 @@ TEST_P(DynamicBufferOffsetTests, InheritDynamicOffestsComputePipeline) {
computePassEncoder.SetBindGroup(0, mBindGroups[0], offsets.size(), offsets.data());
computePassEncoder.Dispatch(1, 1, 1);
computePassEncoder.SetPipeline(testPipeline);
computePassEncoder.SetBindGroup(1, mBindGroups[1], 0, nullptr);
computePassEncoder.SetBindGroup(1, mBindGroups[1]);
computePassEncoder.Dispatch(1, 1, 1);
computePassEncoder.EndPass();
dawn::CommandBuffer commands = commandEncoder.Finish();

View File

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

View File

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

View File

@ -133,8 +133,8 @@ TEST_P(OpArrayLengthTest, Compute) {
dawn::CommandEncoder encoder = device.CreateCommandEncoder();
dawn::ComputePassEncoder pass = encoder.BeginComputePass();
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, mBindGroup, 0, nullptr);
pass.SetBindGroup(1, resultBindGroup, 0, nullptr);
pass.SetBindGroup(0, mBindGroup);
pass.SetBindGroup(1, resultBindGroup);
pass.Dispatch(1, 1, 1);
pass.EndPass();
@ -189,7 +189,7 @@ TEST_P(OpArrayLengthTest, Fragment) {
{
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, mBindGroup, 0, nullptr);
pass.SetBindGroup(0, mBindGroup);
pass.Draw(1, 1, 0, 0);
pass.EndPass();
}
@ -250,7 +250,7 @@ TEST_P(OpArrayLengthTest, Vertex) {
{
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, mBindGroup, 0, nullptr);
pass.SetBindGroup(0, mBindGroup);
pass.Draw(1, 1, 0, 0);
pass.EndPass();
}

View File

@ -111,7 +111,7 @@ TEST_P(RenderBundleTest, Basic) {
uint64_t zeroOffset = 0;
renderBundleEncoder.SetPipeline(pipeline);
renderBundleEncoder.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
renderBundleEncoder.SetBindGroup(0, bindGroups[0], 0, nullptr);
renderBundleEncoder.SetBindGroup(0, bindGroups[0]);
renderBundleEncoder.Draw(6, 1, 0, 0);
dawn::RenderBundle renderBundle = renderBundleEncoder.Finish();
@ -142,7 +142,7 @@ TEST_P(RenderBundleTest, MultipleBundles) {
renderBundleEncoder.SetPipeline(pipeline);
renderBundleEncoder.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
renderBundleEncoder.SetBindGroup(0, bindGroups[0], 0, nullptr);
renderBundleEncoder.SetBindGroup(0, bindGroups[0]);
renderBundleEncoder.Draw(3, 1, 0, 0);
renderBundles[0] = renderBundleEncoder.Finish();
@ -152,7 +152,7 @@ TEST_P(RenderBundleTest, MultipleBundles) {
renderBundleEncoder.SetPipeline(pipeline);
renderBundleEncoder.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
renderBundleEncoder.SetBindGroup(0, bindGroups[1], 0, nullptr);
renderBundleEncoder.SetBindGroup(0, bindGroups[1]);
renderBundleEncoder.Draw(3, 1, 3, 0);
renderBundles[1] = renderBundleEncoder.Finish();
@ -182,7 +182,7 @@ TEST_P(RenderBundleTest, BundleAndRenderPassCommands) {
uint64_t zeroOffset = 0;
renderBundleEncoder.SetPipeline(pipeline);
renderBundleEncoder.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
renderBundleEncoder.SetBindGroup(0, bindGroups[0], 0, nullptr);
renderBundleEncoder.SetBindGroup(0, bindGroups[0]);
renderBundleEncoder.Draw(3, 1, 0, 0);
dawn::RenderBundle renderBundle = renderBundleEncoder.Finish();
@ -194,7 +194,7 @@ TEST_P(RenderBundleTest, BundleAndRenderPassCommands) {
pass.SetPipeline(pipeline);
pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
pass.SetBindGroup(0, bindGroups[1], 0, nullptr);
pass.SetBindGroup(0, bindGroups[1]);
pass.Draw(3, 1, 3, 0);
pass.ExecuteBundles(1, &renderBundle);

View File

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

View File

@ -298,7 +298,7 @@ class TextureFormatTest : public DawnTest {
utils::ComboRenderPassDescriptor renderPassDesc({renderTarget.CreateView()});
dawn::RenderPassEncoder renderPass = encoder.BeginRenderPass(&renderPassDesc);
renderPass.SetPipeline(pipeline);
renderPass.SetBindGroup(0, bindGroup, 0, nullptr);
renderPass.SetBindGroup(0, bindGroup);
renderPass.Draw(3, 1, 0, 0);
renderPass.EndPass();

View File

@ -178,7 +178,7 @@ protected:
{
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&mRenderPass.renderPassInfo);
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup, 0, nullptr);
pass.SetBindGroup(0, bindGroup);
pass.Draw(6, 1, 0, 0);
pass.EndPass();
}

View File

@ -475,7 +475,7 @@ TEST_P(TextureZeroInitTest, RenderPassSampledTextureClear) {
renderPassDesc.cColorAttachments[0].loadOp = dawn::LoadOp::Clear;
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassDesc);
pass.SetPipeline(renderPipeline);
pass.SetBindGroup(0, bindGroup, 0, nullptr);
pass.SetBindGroup(0, bindGroup);
pass.Draw(6, 1, 0, 0);
pass.EndPass();
dawn::CommandBuffer commands = encoder.Finish();
@ -544,7 +544,7 @@ TEST_P(TextureZeroInitTest, ComputePassSampledTextureClear) {
dawn::CommandEncoder encoder = device.CreateCommandEncoder();
dawn::ComputePassEncoder pass = encoder.BeginComputePass();
pass.SetPipeline(computePipeline);
pass.SetBindGroup(0, bindGroup, 0, nullptr);
pass.SetBindGroup(0, bindGroup);
pass.Dispatch(1, 1, 1);
pass.EndPass();
dawn::CommandBuffer commands = encoder.Finish();
@ -692,7 +692,7 @@ TEST_P(TextureZeroInitTest, RenderPassStoreOpClear) {
renderPassDesc.cColorAttachments[0].storeOp = dawn::StoreOp::Clear;
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassDesc);
pass.SetPipeline(renderPipeline);
pass.SetBindGroup(0, bindGroup, 0, nullptr);
pass.SetBindGroup(0, bindGroup);
pass.Draw(6, 1, 0, 0);
pass.EndPass();
commands = encoder.Finish();

View File

@ -983,8 +983,8 @@ TEST_F(SetBindGroupPersistenceValidationTest, BindGroupBeforePipeline) {
dawn::CommandEncoder commandEncoder = device.CreateCommandEncoder();
dawn::RenderPassEncoder renderPassEncoder = commandEncoder.BeginRenderPass(&renderPass);
renderPassEncoder.SetBindGroup(0, bindGroup0, 0, nullptr);
renderPassEncoder.SetBindGroup(1, bindGroup1, 0, nullptr);
renderPassEncoder.SetBindGroup(0, bindGroup0);
renderPassEncoder.SetBindGroup(1, bindGroup1);
renderPassEncoder.SetPipeline(pipeline);
renderPassEncoder.Draw(3, 1, 0, 0);
@ -1042,12 +1042,12 @@ TEST_F(SetBindGroupPersistenceValidationTest, NotVulkanInheritance) {
dawn::RenderPassEncoder renderPassEncoder = commandEncoder.BeginRenderPass(&renderPass);
renderPassEncoder.SetPipeline(pipelineA);
renderPassEncoder.SetBindGroup(0, bindGroupA0, 0, nullptr);
renderPassEncoder.SetBindGroup(1, bindGroupA1, 0, nullptr);
renderPassEncoder.SetBindGroup(0, bindGroupA0);
renderPassEncoder.SetBindGroup(1, bindGroupA1);
renderPassEncoder.Draw(3, 1, 0, 0);
renderPassEncoder.SetPipeline(pipelineB);
renderPassEncoder.SetBindGroup(0, bindGroupB0, 0, nullptr);
renderPassEncoder.SetBindGroup(0, bindGroupB0);
// This draw is valid.
// Bind group 1 persists even though it is not "inherited".
renderPassEncoder.Draw(3, 1, 0, 0);

View File

@ -219,7 +219,7 @@ TEST_F(CommandBufferValidationTest, BufferWithReadAndWriteUsage) {
DummyRenderPass dummyRenderPass(device);
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass);
pass.SetIndexBuffer(buffer, 0);
pass.SetBindGroup(0, bg, 0, nullptr);
pass.SetBindGroup(0, bg);
pass.EndPass();
ASSERT_DEVICE_ERROR(encoder.Finish());
}
@ -249,7 +249,7 @@ TEST_F(CommandBufferValidationTest, TextureWithReadAndWriteUsage) {
// Use the texture as both sampeld and output attachment in the same pass
dawn::CommandEncoder encoder = device.CreateCommandEncoder();
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.SetBindGroup(0, bg, 0, nullptr);
pass.SetBindGroup(0, bg);
pass.EndPass();
ASSERT_DEVICE_ERROR(encoder.Finish());
}

View File

@ -158,8 +158,8 @@ TEST_F(RenderBundleValidationTest, SimpleSuccess) {
dawn::RenderBundleEncoder renderBundleEncoder = device.CreateRenderBundleEncoder(&desc);
renderBundleEncoder.SetPipeline(pipeline);
renderBundleEncoder.SetBindGroup(0, bg0, 0, nullptr);
renderBundleEncoder.SetBindGroup(1, bg1, 0, nullptr);
renderBundleEncoder.SetBindGroup(0, bg0);
renderBundleEncoder.SetBindGroup(1, bg1);
renderBundleEncoder.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
renderBundleEncoder.Draw(3, 0, 0, 0);
dawn::RenderBundle renderBundle = renderBundleEncoder.Finish();
@ -246,8 +246,8 @@ TEST_F(RenderBundleValidationTest, StateInheritance) {
pass.SetPipeline(pipeline);
renderBundleEncoder.SetBindGroup(0, bg0, 0, nullptr);
renderBundleEncoder.SetBindGroup(1, bg1, 0, nullptr);
renderBundleEncoder.SetBindGroup(0, bg0);
renderBundleEncoder.SetBindGroup(1, bg1);
renderBundleEncoder.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
renderBundleEncoder.Draw(3, 0, 0, 0);
ASSERT_DEVICE_ERROR(dawn::RenderBundle renderBundle = renderBundleEncoder.Finish());
@ -263,8 +263,8 @@ TEST_F(RenderBundleValidationTest, StateInheritance) {
dawn::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass);
dawn::RenderBundleEncoder renderBundleEncoder = device.CreateRenderBundleEncoder(&desc);
pass.SetBindGroup(0, bg0, 0, nullptr);
pass.SetBindGroup(1, bg1, 0, nullptr);
pass.SetBindGroup(0, bg0);
pass.SetBindGroup(1, bg1);
renderBundleEncoder.SetPipeline(pipeline);
renderBundleEncoder.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
@ -283,8 +283,8 @@ TEST_F(RenderBundleValidationTest, StateInheritance) {
dawn::RenderBundleEncoder renderBundleEncoder = device.CreateRenderBundleEncoder(&desc);
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bg0, 0, nullptr);
pass.SetBindGroup(1, bg1, 0, nullptr);
pass.SetBindGroup(0, bg0);
pass.SetBindGroup(1, bg1);
renderBundleEncoder.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
renderBundleEncoder.Draw(3, 0, 0, 0);
@ -304,8 +304,8 @@ TEST_F(RenderBundleValidationTest, StateInheritance) {
pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
renderBundleEncoder.SetPipeline(pipeline);
renderBundleEncoder.SetBindGroup(0, bg0, 0, nullptr);
renderBundleEncoder.SetBindGroup(1, bg1, 0, nullptr);
renderBundleEncoder.SetBindGroup(0, bg0);
renderBundleEncoder.SetBindGroup(1, bg1);
renderBundleEncoder.Draw(3, 0, 0, 0);
ASSERT_DEVICE_ERROR(dawn::RenderBundle renderBundle = renderBundleEncoder.Finish());
@ -333,8 +333,8 @@ TEST_F(RenderBundleValidationTest, StatePersistence) {
dawn::RenderBundle renderBundle = renderBundleEncoder.Finish();
pass.ExecuteBundles(1, &renderBundle);
pass.SetBindGroup(0, bg0, 0, nullptr);
pass.SetBindGroup(1, bg1, 0, nullptr);
pass.SetBindGroup(0, bg0);
pass.SetBindGroup(1, bg1);
pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
pass.Draw(3, 0, 0, 0);
pass.EndPass();
@ -348,8 +348,8 @@ TEST_F(RenderBundleValidationTest, StatePersistence) {
dawn::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass);
dawn::RenderBundleEncoder renderBundleEncoder = device.CreateRenderBundleEncoder(&desc);
renderBundleEncoder.SetBindGroup(0, bg0, 0, nullptr);
renderBundleEncoder.SetBindGroup(1, bg1, 0, nullptr);
renderBundleEncoder.SetBindGroup(0, bg0);
renderBundleEncoder.SetBindGroup(1, bg1);
dawn::RenderBundle renderBundle = renderBundleEncoder.Finish();
pass.ExecuteBundles(1, &renderBundle);
@ -368,8 +368,8 @@ TEST_F(RenderBundleValidationTest, StatePersistence) {
dawn::RenderBundleEncoder renderBundleEncoder = device.CreateRenderBundleEncoder(&desc);
renderBundleEncoder.SetPipeline(pipeline);
renderBundleEncoder.SetBindGroup(0, bg0, 0, nullptr);
renderBundleEncoder.SetBindGroup(1, bg1, 0, nullptr);
renderBundleEncoder.SetBindGroup(0, bg0);
renderBundleEncoder.SetBindGroup(1, bg1);
dawn::RenderBundle renderBundle = renderBundleEncoder.Finish();
pass.ExecuteBundles(1, &renderBundle);
@ -391,8 +391,8 @@ TEST_F(RenderBundleValidationTest, StatePersistence) {
pass.ExecuteBundles(1, &renderBundle);
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bg0, 0, nullptr);
pass.SetBindGroup(1, bg1, 0, nullptr);
pass.SetBindGroup(0, bg0);
pass.SetBindGroup(1, bg1);
pass.Draw(3, 0, 0, 0);
pass.EndPass();
@ -418,8 +418,8 @@ TEST_F(RenderBundleValidationTest, ClearsState) {
pass.SetPipeline(pipeline);
pass.ExecuteBundles(1, &renderBundle);
pass.SetBindGroup(0, bg0, 0, nullptr);
pass.SetBindGroup(1, bg1, 0, nullptr);
pass.SetBindGroup(0, bg0);
pass.SetBindGroup(1, bg1);
pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
pass.Draw(3, 0, 0, 0);
pass.EndPass();
@ -432,8 +432,8 @@ TEST_F(RenderBundleValidationTest, ClearsState) {
dawn::CommandEncoder commandEncoder = device.CreateCommandEncoder();
dawn::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass);
pass.SetBindGroup(0, bg0, 0, nullptr);
pass.SetBindGroup(1, bg1, 0, nullptr);
pass.SetBindGroup(0, bg0);
pass.SetBindGroup(1, bg1);
pass.ExecuteBundles(1, &renderBundle);
pass.SetPipeline(pipeline);
pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
@ -449,8 +449,8 @@ TEST_F(RenderBundleValidationTest, ClearsState) {
dawn::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass);
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bg0, 0, nullptr);
pass.SetBindGroup(1, bg1, 0, nullptr);
pass.SetBindGroup(0, bg0);
pass.SetBindGroup(1, bg1);
pass.ExecuteBundles(1, &renderBundle);
pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
pass.Draw(3, 0, 0, 0);
@ -467,8 +467,8 @@ TEST_F(RenderBundleValidationTest, ClearsState) {
pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
pass.ExecuteBundles(1, &renderBundle);
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bg0, 0, nullptr);
pass.SetBindGroup(1, bg1, 0, nullptr);
pass.SetBindGroup(0, bg0);
pass.SetBindGroup(1, bg1);
pass.Draw(3, 0, 0, 0);
pass.EndPass();
@ -481,8 +481,8 @@ TEST_F(RenderBundleValidationTest, ClearsState) {
dawn::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass);
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bg0, 0, nullptr);
pass.SetBindGroup(1, bg1, 0, nullptr);
pass.SetBindGroup(0, bg0);
pass.SetBindGroup(1, bg1);
pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
pass.ExecuteBundles(0, nullptr);
pass.Draw(3, 0, 0, 0);
@ -504,16 +504,16 @@ TEST_F(RenderBundleValidationTest, MultipleBundles) {
dawn::RenderBundleEncoder renderBundleEncoder0 = device.CreateRenderBundleEncoder(&desc);
renderBundleEncoder0.SetPipeline(pipeline);
renderBundleEncoder0.SetBindGroup(0, bg0, 0, nullptr);
renderBundleEncoder0.SetBindGroup(1, bg1, 0, nullptr);
renderBundleEncoder0.SetBindGroup(0, bg0);
renderBundleEncoder0.SetBindGroup(1, bg1);
renderBundleEncoder0.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
renderBundleEncoder0.Draw(3, 1, 0, 0);
renderBundles[0] = renderBundleEncoder0.Finish();
dawn::RenderBundleEncoder renderBundleEncoder1 = device.CreateRenderBundleEncoder(&desc);
renderBundleEncoder1.SetPipeline(pipeline);
renderBundleEncoder1.SetBindGroup(0, bg0, 0, nullptr);
renderBundleEncoder1.SetBindGroup(1, bg1, 0, nullptr);
renderBundleEncoder1.SetBindGroup(0, bg0);
renderBundleEncoder1.SetBindGroup(1, bg1);
renderBundleEncoder1.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
renderBundleEncoder1.Draw(3, 1, 0, 0);
renderBundles[1] = renderBundleEncoder1.Finish();
@ -535,8 +535,8 @@ TEST_F(RenderBundleValidationTest, ExecuteMultipleTimes) {
dawn::RenderBundleEncoder renderBundleEncoder = device.CreateRenderBundleEncoder(&desc);
renderBundleEncoder.SetPipeline(pipeline);
renderBundleEncoder.SetBindGroup(0, bg0, 0, nullptr);
renderBundleEncoder.SetBindGroup(1, bg1, 0, nullptr);
renderBundleEncoder.SetBindGroup(0, bg0);
renderBundleEncoder.SetBindGroup(1, bg1);
renderBundleEncoder.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
renderBundleEncoder.Draw(3, 1, 0, 0);
dawn::RenderBundle renderBundle = renderBundleEncoder.Finish();
@ -615,8 +615,8 @@ TEST_F(RenderBundleValidationTest, UsageTracking) {
{
dawn::RenderBundleEncoder renderBundleEncoder = device.CreateRenderBundleEncoder(&desc);
renderBundleEncoder.SetPipeline(pipeline);
renderBundleEncoder.SetBindGroup(0, bg0, 0, nullptr);
renderBundleEncoder.SetBindGroup(1, bg1Vertex, 0, nullptr);
renderBundleEncoder.SetBindGroup(0, bg0);
renderBundleEncoder.SetBindGroup(1, bg1Vertex);
renderBundleEncoder.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
renderBundleEncoder.Draw(3, 0, 0, 0);
renderBundle0 = renderBundleEncoder.Finish();
@ -626,8 +626,8 @@ TEST_F(RenderBundleValidationTest, UsageTracking) {
{
dawn::RenderBundleEncoder renderBundleEncoder = device.CreateRenderBundleEncoder(&desc);
renderBundleEncoder.SetPipeline(pipeline);
renderBundleEncoder.SetBindGroup(0, bg0, 0, nullptr);
renderBundleEncoder.SetBindGroup(1, bg1, 0, nullptr);
renderBundleEncoder.SetBindGroup(0, bg0);
renderBundleEncoder.SetBindGroup(1, bg1);
renderBundleEncoder.SetVertexBuffers(0, 1, &vertexStorageBuffer, &zeroOffset);
renderBundleEncoder.Draw(3, 0, 0, 0);
renderBundle1 = renderBundleEncoder.Finish();
@ -638,8 +638,8 @@ TEST_F(RenderBundleValidationTest, UsageTracking) {
{
dawn::RenderBundleEncoder renderBundleEncoder = device.CreateRenderBundleEncoder(&desc);
renderBundleEncoder.SetPipeline(pipeline);
renderBundleEncoder.SetBindGroup(0, bg0, 0, nullptr);
renderBundleEncoder.SetBindGroup(1, bg1Vertex, 0, nullptr);
renderBundleEncoder.SetBindGroup(0, bg0);
renderBundleEncoder.SetBindGroup(1, bg1Vertex);
renderBundleEncoder.SetVertexBuffers(0, 1, &vertexStorageBuffer, &zeroOffset);
renderBundleEncoder.Draw(3, 0, 0, 0);
ASSERT_DEVICE_ERROR(renderBundleEncoder.Finish());
@ -666,8 +666,8 @@ TEST_F(RenderBundleValidationTest, UsageTracking) {
dawn::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass);
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bg0, 0, nullptr);
pass.SetBindGroup(1, bg1Vertex, 0, nullptr);
pass.SetBindGroup(0, bg0);
pass.SetBindGroup(1, bg1Vertex);
pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
pass.Draw(3, 0, 0, 0);
@ -686,8 +686,8 @@ TEST_F(RenderBundleValidationTest, UsageTracking) {
pass.ExecuteBundles(1, &renderBundle0);
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bg0, 0, nullptr);
pass.SetBindGroup(1, bg1, 0, nullptr);
pass.SetBindGroup(0, bg0);
pass.SetBindGroup(1, bg1);
pass.SetVertexBuffers(0, 1, &vertexStorageBuffer, &zeroOffset);
pass.Draw(3, 0, 0, 0);

View File

@ -80,8 +80,8 @@ void main() {
dawn::CommandEncoder commandEncoder = device.CreateCommandEncoder();
dawn::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass);
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bg1, 0, nullptr);
pass.SetBindGroup(1, bg2, 0, nullptr);
pass.SetBindGroup(0, bg1);
pass.SetBindGroup(1, bg2);
pass.Draw(3, 0, 0, 0);
pass.EndPass();
commandEncoder.Finish();
@ -98,7 +98,7 @@ void main() {
dawn::CommandEncoder commandEncoder = device.CreateCommandEncoder();
dawn::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass);
pass.SetPipeline(pipeline);
pass.SetBindGroup(1, bg2, 0, nullptr);
pass.SetBindGroup(1, bg2);
pass.Draw(3, 0, 0, 0);
pass.EndPass();
ASSERT_DEVICE_ERROR(commandEncoder.Finish());
@ -107,7 +107,7 @@ void main() {
dawn::CommandEncoder commandEncoder = device.CreateCommandEncoder();
dawn::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass);
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bg1, 0, nullptr);
pass.SetBindGroup(0, bg1);
pass.Draw(3, 0, 0, 0);
pass.EndPass();
ASSERT_DEVICE_ERROR(commandEncoder.Finish());