diff --git a/dawn.json b/dawn.json index 5e65d3b94e..493eeac0d3 100644 --- a/dawn.json +++ b/dawn.json @@ -73,7 +73,9 @@ {"value": 0, "name": "uniform buffer"}, {"value": 1, "name": "sampler"}, {"value": 2, "name": "sampled texture"}, - {"value": 3, "name": "storage buffer"} + {"value": 3, "name": "storage buffer"}, + {"value": 4, "name": "dynamic uniform buffer"}, + {"value": 5, "name": "dynamic storage buffer"} ] }, "blend descriptor": { @@ -375,7 +377,9 @@ "name": "set bind group", "args": [ {"name": "group index", "type": "uint32_t"}, - {"name": "group", "type": "bind group"} + {"name": "group", "type": "bind group"}, + {"name": "dynamic offset count", "type": "uint32_t"}, + {"name": "dynamic offsets", "type": "uint32_t", "annotation": "const*", "length": "dynamic offset count"} ] }, { @@ -776,7 +780,9 @@ "name": "set bind group", "args": [ {"name": "group index", "type": "uint32_t"}, - {"name": "group", "type": "bind group"} + {"name": "group", "type": "bind group"}, + {"name": "dynamic offset count", "type": "uint32_t"}, + {"name": "dynamic offsets", "type": "uint32_t", "annotation": "const*", "length": "dynamic offset count"} ] }, { diff --git a/examples/ComputeBoids.cpp b/examples/ComputeBoids.cpp index 778d440365..27c60f5137 100644 --- a/examples/ComputeBoids.cpp +++ b/examples/ComputeBoids.cpp @@ -285,7 +285,7 @@ dawn::CommandBuffer createCommandBuffer(const dawn::Texture backbuffer, size_t i { dawn::ComputePassEncoder pass = encoder.BeginComputePass(); pass.SetPipeline(updatePipeline); - pass.SetBindGroup(0, updateBGs[i]); + pass.SetBindGroup(0, updateBGs[i], 0, nullptr); pass.Dispatch(kNumParticles, 1, 1); pass.EndPass(); } diff --git a/examples/CppHelloTriangle.cpp b/examples/CppHelloTriangle.cpp index 1c46f2ea2e..a55e99d613 100644 --- a/examples/CppHelloTriangle.cpp +++ b/examples/CppHelloTriangle.cpp @@ -169,7 +169,7 @@ void frame() { { dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); pass.SetPipeline(pipeline); - pass.SetBindGroup(0, bindGroup); + pass.SetBindGroup(0, bindGroup, 0, nullptr); pass.SetVertexBuffers(0, 1, &vertexBuffer, vertexBufferOffsets); pass.SetIndexBuffer(indexBuffer, 0); pass.DrawIndexed(3, 1, 0, 0, 0); diff --git a/examples/CubeReflection.cpp b/examples/CubeReflection.cpp index 93b5606f53..fbe0752729 100644 --- a/examples/CubeReflection.cpp +++ b/examples/CubeReflection.cpp @@ -280,20 +280,20 @@ void frame() { { dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); pass.SetPipeline(pipeline); - pass.SetBindGroup(0, bindGroup[0]); + pass.SetBindGroup(0, bindGroup[0], 0, nullptr); 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]); + pass.SetBindGroup(0, bindGroup[0], 0, nullptr); 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]); + pass.SetBindGroup(0, bindGroup[1], 0, nullptr); pass.DrawIndexed(36, 1, 0, 0, 0); pass.EndPass(); diff --git a/examples/glTFViewer/glTFViewer.cpp b/examples/glTFViewer/glTFViewer.cpp index 329703dbb5..377fe695d6 100644 --- a/examples/glTFViewer/glTFViewer.cpp +++ b/examples/glTFViewer/glTFViewer.cpp @@ -525,7 +525,7 @@ namespace { } const MaterialInfo& material = getMaterial(iPrim.material, strides[0], strides[1], strides[2]); pass.SetPipeline(material.pipeline); - pass.SetBindGroup(0, material.bindGroup0); + pass.SetBindGroup(0, material.bindGroup0, 0, nullptr); pass.SetPushConstants(dawn::ShaderStageBit::Vertex, 0, sizeof(u_transform_block) / sizeof(uint32_t), reinterpret_cast(&transforms)); diff --git a/src/dawn_native/BindGroup.cpp b/src/dawn_native/BindGroup.cpp index dc1fe6dd37..f952c19383 100644 --- a/src/dawn_native/BindGroup.cpp +++ b/src/dawn_native/BindGroup.cpp @@ -138,6 +138,10 @@ namespace dawn_native { case dawn::BindingType::Sampler: DAWN_TRY(ValidateSamplerBinding(device, binding)); break; + // TODO(shaobo.yan@intel.com): Implement dynamic buffer offset. + case dawn::BindingType::DynamicUniformBuffer: + case dawn::BindingType::DynamicStorageBuffer: + return DAWN_VALIDATION_ERROR("Dawn doesn't support dynamic buffer yet"); } } diff --git a/src/dawn_native/CommandEncoder.cpp b/src/dawn_native/CommandEncoder.cpp index 3aae8c9ce8..43331bc8da 100644 --- a/src/dawn_native/CommandEncoder.cpp +++ b/src/dawn_native/CommandEncoder.cpp @@ -512,6 +512,12 @@ namespace dawn_native { case dawn::BindingType::Sampler: break; + + // TODO(shaobo.yan@intel.com): Implement dynamic buffer offset + case dawn::BindingType::DynamicUniformBuffer: + case dawn::BindingType::DynamicStorageBuffer: + UNREACHABLE(); + break; } } } diff --git a/src/dawn_native/ProgrammablePassEncoder.cpp b/src/dawn_native/ProgrammablePassEncoder.cpp index d5eaaa4914..f925d9c30a 100644 --- a/src/dawn_native/ProgrammablePassEncoder.cpp +++ b/src/dawn_native/ProgrammablePassEncoder.cpp @@ -81,7 +81,10 @@ namespace dawn_native { memcpy(label, groupLabel, cmd->length + 1); } - void ProgrammablePassEncoder::SetBindGroup(uint32_t groupIndex, BindGroupBase* group) { + void ProgrammablePassEncoder::SetBindGroup(uint32_t groupIndex, + BindGroupBase* group, + uint32_t dynamicOffsetCount, + const uint32_t* dynamicOffsets) { if (mTopLevelEncoder->ConsumedError(ValidateCanRecordCommands()) || mTopLevelEncoder->ConsumedError(GetDevice()->ValidateObject(group))) { return; @@ -92,6 +95,12 @@ namespace dawn_native { return; } + // TODO(shaobo.yan@intel.com): Implement dynamic buffer offset. + if (dynamicOffsetCount != 0) { + mTopLevelEncoder->HandleError("Dynamic Buffer Offset not supported yet"); + return; + } + SetBindGroupCmd* cmd = mAllocator->Allocate(Command::SetBindGroup); new (cmd) SetBindGroupCmd; cmd->index = groupIndex; diff --git a/src/dawn_native/ProgrammablePassEncoder.h b/src/dawn_native/ProgrammablePassEncoder.h index ae7eb4638d..a2dd046296 100644 --- a/src/dawn_native/ProgrammablePassEncoder.h +++ b/src/dawn_native/ProgrammablePassEncoder.h @@ -39,7 +39,10 @@ namespace dawn_native { void PopDebugGroup(); void PushDebugGroup(const char* groupLabel); - void SetBindGroup(uint32_t groupIndex, BindGroupBase* group); + void SetBindGroup(uint32_t groupIndex, + BindGroupBase* group, + uint32_t dynamicOffsetCount, + const uint32_t* dynamicOffsets); void SetPushConstants(dawn::ShaderStageBit stages, uint32_t offset, uint32_t count, diff --git a/src/dawn_native/d3d12/BindGroupD3D12.cpp b/src/dawn_native/d3d12/BindGroupD3D12.cpp index b9ad9ba119..36935184ac 100644 --- a/src/dawn_native/d3d12/BindGroupD3D12.cpp +++ b/src/dawn_native/d3d12/BindGroupD3D12.cpp @@ -95,6 +95,12 @@ namespace dawn_native { namespace d3d12 { &samplerDesc, samplerHeapStart.GetCPUHandle(*samplerHeapOffset + bindingOffsets[bindingIndex])); } break; + + // TODO(shaobo.yan@intel.com): Implement dynamic buffer offset. + case dawn::BindingType::DynamicUniformBuffer: + case dawn::BindingType::DynamicStorageBuffer: + UNREACHABLE(); + break; } } diff --git a/src/dawn_native/d3d12/BindGroupLayoutD3D12.cpp b/src/dawn_native/d3d12/BindGroupLayoutD3D12.cpp index 7477e3fbf0..f97eebb3e7 100644 --- a/src/dawn_native/d3d12/BindGroupLayoutD3D12.cpp +++ b/src/dawn_native/d3d12/BindGroupLayoutD3D12.cpp @@ -37,6 +37,11 @@ namespace dawn_native { namespace d3d12 { case dawn::BindingType::Sampler: mBindingOffsets[binding] = mDescriptorCounts[Sampler]++; break; + // TODO(shaobo.yan@intel.com): Implement dynamic buffer offset. + case dawn::BindingType::DynamicUniformBuffer: + case dawn::BindingType::DynamicStorageBuffer: + UNREACHABLE(); + break; } } @@ -95,6 +100,11 @@ namespace dawn_native { namespace d3d12 { case dawn::BindingType::Sampler: mBindingOffsets[binding] += descriptorOffsets[Sampler]; break; + // TODO(shaobo.yan@intel.com): Implement dynamic buffer offset. + case dawn::BindingType::DynamicUniformBuffer: + case dawn::BindingType::DynamicStorageBuffer: + UNREACHABLE(); + break; } } } diff --git a/src/dawn_native/metal/CommandBufferMTL.mm b/src/dawn_native/metal/CommandBufferMTL.mm index a15adcbcf3..7fc8741f02 100644 --- a/src/dawn_native/metal/CommandBufferMTL.mm +++ b/src/dawn_native/metal/CommandBufferMTL.mm @@ -199,6 +199,12 @@ namespace dawn_native { namespace metal { [compute setTexture:textureView->GetMTLTexture() atIndex:computeIndex]; } } break; + + // TODO(shaobo.yan@intel.com): Implement dynamic buffer offset. + case dawn::BindingType::DynamicUniformBuffer: + case dawn::BindingType::DynamicStorageBuffer: + UNREACHABLE(); + break; } } } diff --git a/src/dawn_native/metal/PipelineLayoutMTL.mm b/src/dawn_native/metal/PipelineLayoutMTL.mm index 9912f94de2..4b6bb29d18 100644 --- a/src/dawn_native/metal/PipelineLayoutMTL.mm +++ b/src/dawn_native/metal/PipelineLayoutMTL.mm @@ -53,6 +53,11 @@ namespace dawn_native { namespace metal { mIndexInfo[stage][group][binding] = textureIndex; textureIndex++; break; + // TODO(shaobo.yan@intel.com): Implement dynamic buffer offset + case dawn::BindingType::DynamicUniformBuffer: + case dawn::BindingType::DynamicStorageBuffer: + UNREACHABLE(); + break; } } } diff --git a/src/dawn_native/opengl/CommandBufferGL.cpp b/src/dawn_native/opengl/CommandBufferGL.cpp index 1a5fded0ee..098ca1e7d4 100644 --- a/src/dawn_native/opengl/CommandBufferGL.cpp +++ b/src/dawn_native/opengl/CommandBufferGL.cpp @@ -278,6 +278,12 @@ namespace dawn_native { namespace opengl { glBindBufferRange(GL_SHADER_STORAGE_BUFFER, ssboIndex, buffer, binding.offset, binding.size); } break; + + // TODO(shaobo.yan@intel.com): Implement dynamic buffer offset. + case dawn::BindingType::DynamicUniformBuffer: + case dawn::BindingType::DynamicStorageBuffer: + UNREACHABLE(); + break; } } } diff --git a/src/dawn_native/opengl/PipelineGL.cpp b/src/dawn_native/opengl/PipelineGL.cpp index f03ab8778d..11cb5b9dfd 100644 --- a/src/dawn_native/opengl/PipelineGL.cpp +++ b/src/dawn_native/opengl/PipelineGL.cpp @@ -159,6 +159,12 @@ namespace dawn_native { namespace opengl { // These binding types are handled in the separate sampler and texture // emulation break; + + // TODO(shaobo.yan@intel.com): Implement dynamic buffer offset. + case dawn::BindingType::DynamicUniformBuffer: + case dawn::BindingType::DynamicStorageBuffer: + UNREACHABLE(); + break; } } } diff --git a/src/dawn_native/opengl/PipelineLayoutGL.cpp b/src/dawn_native/opengl/PipelineLayoutGL.cpp index 8f2cdaaf96..e646feff93 100644 --- a/src/dawn_native/opengl/PipelineLayoutGL.cpp +++ b/src/dawn_native/opengl/PipelineLayoutGL.cpp @@ -53,6 +53,12 @@ namespace dawn_native { namespace opengl { mIndexInfo[group][binding] = ssboIndex; ssboIndex++; break; + + // TODO(shaobo.yan@intel.com): Implement dynamic buffer offset + case dawn::BindingType::DynamicUniformBuffer: + case dawn::BindingType::DynamicStorageBuffer: + UNREACHABLE(); + break; } } } diff --git a/src/dawn_native/vulkan/BindGroupLayoutVk.cpp b/src/dawn_native/vulkan/BindGroupLayoutVk.cpp index 94a3429184..c6ea3f9991 100644 --- a/src/dawn_native/vulkan/BindGroupLayoutVk.cpp +++ b/src/dawn_native/vulkan/BindGroupLayoutVk.cpp @@ -49,6 +49,9 @@ namespace dawn_native { namespace vulkan { return VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE; case dawn::BindingType::StorageBuffer: return VK_DESCRIPTOR_TYPE_STORAGE_BUFFER; + case dawn::BindingType::DynamicUniformBuffer: + case dawn::BindingType::DynamicStorageBuffer: + UNREACHABLE(); default: UNREACHABLE(); } @@ -125,6 +128,9 @@ namespace dawn_native { namespace vulkan { return SAMPLED_IMAGE; case dawn::BindingType::StorageBuffer: return STORAGE_BUFFER; + case dawn::BindingType::DynamicUniformBuffer: + case dawn::BindingType::DynamicStorageBuffer: + UNREACHABLE(); default: UNREACHABLE(); } diff --git a/src/dawn_native/vulkan/BindGroupVk.cpp b/src/dawn_native/vulkan/BindGroupVk.cpp index c8c9217551..1fb8a7ccbf 100644 --- a/src/dawn_native/vulkan/BindGroupVk.cpp +++ b/src/dawn_native/vulkan/BindGroupVk.cpp @@ -108,6 +108,11 @@ namespace dawn_native { namespace vulkan { write.pImageInfo = &writeImageInfo[numWrites]; } break; + + case dawn::BindingType::DynamicUniformBuffer: + case dawn::BindingType::DynamicStorageBuffer: + UNREACHABLE(); + break; default: UNREACHABLE(); } diff --git a/src/tests/end2end/BindGroupTests.cpp b/src/tests/end2end/BindGroupTests.cpp index a1a2dcf78f..ee77e69912 100644 --- a/src/tests/end2end/BindGroupTests.cpp +++ b/src/tests/end2end/BindGroupTests.cpp @@ -27,7 +27,7 @@ protected: dawn::CommandEncoder encoder = device.CreateCommandEncoder(); dawn::ComputePassEncoder pass = encoder.BeginComputePass(); pass.SetPipeline(pipeline); - pass.SetBindGroup(0, bindGroup); + pass.SetBindGroup(0, bindGroup, 0, nullptr); pass.Dispatch(1, 1, 1); pass.EndPass(); return encoder.Finish(); @@ -155,7 +155,7 @@ TEST_P(BindGroupTests, ReusedUBO) { dawn::CommandEncoder encoder = device.CreateCommandEncoder(); dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); pass.SetPipeline(pipeline); - pass.SetBindGroup(0, bindGroup); + pass.SetBindGroup(0, bindGroup, 0, nullptr); pass.Draw(3, 1, 0, 0); pass.EndPass(); @@ -275,7 +275,7 @@ TEST_P(BindGroupTests, UBOSamplerAndTexture) { encoder.CopyBufferToTexture(&bufferCopyView, &textureCopyView, ©Size); dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); pass.SetPipeline(pipeline); - pass.SetBindGroup(0, bindGroup); + pass.SetBindGroup(0, bindGroup, 0, nullptr); pass.Draw(3, 1, 0, 0); pass.EndPass(); @@ -370,8 +370,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]); - pass.SetBindGroup(1, bindGroups[1]); + pass.SetBindGroup(0, bindGroups[0], 0, nullptr); + pass.SetBindGroup(1, bindGroups[1], 0, nullptr); pass.Draw(3, 1, 0, 0); pass.EndPass(); @@ -445,10 +445,10 @@ TEST_P(BindGroupTests, DrawTwiceInSamePipelineWithFourBindGroupSets) dawn::BindGroup bindGroup = utils::MakeBindGroup( device, layout, { { 0, uniformBuffer, 0, sizeof(color) } }); - pass.SetBindGroup(0, bindGroup); - pass.SetBindGroup(1, bindGroup); - pass.SetBindGroup(2, bindGroup); - pass.SetBindGroup(3, bindGroup); + 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.Draw(3, 1, 0, 0); pass.SetPipeline(pipeline); diff --git a/src/tests/end2end/ColorStateTests.cpp b/src/tests/end2end/ColorStateTests.cpp index 3ed196748b..1744285ad3 100644 --- a/src/tests/end2end/ColorStateTests.cpp +++ b/src/tests/end2end/ColorStateTests.cpp @@ -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({{base}}))); + pass.SetBindGroup(0, MakeBindGroupForColors(std::array({{base}})), 0, nullptr); 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({{triangle.color}}))); + pass.SetBindGroup(0, MakeBindGroupForColors(std::array({{triangle.color}})), 0, nullptr); 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({{base}}))); + pass.SetBindGroup(0, MakeBindGroupForColors(std::array({{base}})), 0, nullptr); pass.Draw(3, 1, 0, 0); pass.EndPass(); } @@ -852,12 +852,12 @@ TEST_P(ColorStateTest, IndependentColorState) { dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); pass.SetPipeline(basePipeline); pass.SetBindGroup( - 0, MakeBindGroupForColors(std::array({{base, base, base, base}}))); + 0, MakeBindGroupForColors(std::array({{base, base, base, base}})), 0, nullptr); pass.Draw(3, 1, 0, 0); pass.SetPipeline(testPipeline); pass.SetBindGroup(0, MakeBindGroupForColors( - std::array({{color0, color1, color2, color3}}))); + std::array({{color0, color1, color2, color3}})), 0, nullptr); pass.Draw(3, 1, 0, 0); pass.EndPass(); } @@ -926,11 +926,11 @@ TEST_P(ColorStateTest, DefaultBlendColor) { dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); pass.SetPipeline(basePipeline); pass.SetBindGroup(0, - MakeBindGroupForColors(std::array({{RGBA8(0, 0, 0, 0)}}))); + MakeBindGroupForColors(std::array({{RGBA8(0, 0, 0, 0)}})), 0, nullptr); pass.Draw(3, 1, 0, 0); pass.SetPipeline(testPipeline); pass.SetBindGroup( - 0, MakeBindGroupForColors(std::array({{RGBA8(255, 255, 255, 255)}}))); + 0, MakeBindGroupForColors(std::array({{RGBA8(255, 255, 255, 255)}})), 0, nullptr); pass.Draw(3, 1, 0, 0); pass.EndPass(); } @@ -948,12 +948,12 @@ TEST_P(ColorStateTest, DefaultBlendColor) { dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); pass.SetPipeline(basePipeline); pass.SetBindGroup(0, - MakeBindGroupForColors(std::array({{RGBA8(0, 0, 0, 0)}}))); + MakeBindGroupForColors(std::array({{RGBA8(0, 0, 0, 0)}})), 0, nullptr); pass.Draw(3, 1, 0, 0); pass.SetPipeline(testPipeline); pass.SetBlendColor(&kWhite); pass.SetBindGroup( - 0, MakeBindGroupForColors(std::array({{RGBA8(255, 255, 255, 255)}}))); + 0, MakeBindGroupForColors(std::array({{RGBA8(255, 255, 255, 255)}})), 0, nullptr); pass.Draw(3, 1, 0, 0); pass.EndPass(); } @@ -972,12 +972,12 @@ TEST_P(ColorStateTest, DefaultBlendColor) { dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); pass.SetPipeline(basePipeline); pass.SetBindGroup(0, - MakeBindGroupForColors(std::array({{RGBA8(0, 0, 0, 0)}}))); + MakeBindGroupForColors(std::array({{RGBA8(0, 0, 0, 0)}})), 0, nullptr); pass.Draw(3, 1, 0, 0); pass.SetPipeline(testPipeline); pass.SetBlendColor(&kWhite); pass.SetBindGroup( - 0, MakeBindGroupForColors(std::array({{RGBA8(255, 255, 255, 255)}}))); + 0, MakeBindGroupForColors(std::array({{RGBA8(255, 255, 255, 255)}})), 0, nullptr); pass.Draw(3, 1, 0, 0); pass.EndPass(); } @@ -985,11 +985,11 @@ TEST_P(ColorStateTest, DefaultBlendColor) { dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); pass.SetPipeline(basePipeline); pass.SetBindGroup(0, - MakeBindGroupForColors(std::array({{RGBA8(0, 0, 0, 0)}}))); + MakeBindGroupForColors(std::array({{RGBA8(0, 0, 0, 0)}})), 0, nullptr); pass.Draw(3, 1, 0, 0); pass.SetPipeline(testPipeline); pass.SetBindGroup( - 0, MakeBindGroupForColors(std::array({{RGBA8(255, 255, 255, 255)}}))); + 0, MakeBindGroupForColors(std::array({{RGBA8(255, 255, 255, 255)}})), 0, nullptr); pass.Draw(3, 1, 0, 0); pass.EndPass(); } diff --git a/src/tests/end2end/ComputeCopyStorageBufferTests.cpp b/src/tests/end2end/ComputeCopyStorageBufferTests.cpp index 5d11f2d3ec..337f2f18fd 100644 --- a/src/tests/end2end/ComputeCopyStorageBufferTests.cpp +++ b/src/tests/end2end/ComputeCopyStorageBufferTests.cpp @@ -79,7 +79,7 @@ void ComputeCopyStorageBufferTests::BasicTest(const char* shader) { dawn::CommandEncoder encoder = device.CreateCommandEncoder(); dawn::ComputePassEncoder pass = encoder.BeginComputePass(); pass.SetPipeline(pipeline); - pass.SetBindGroup(0, bindGroup); + pass.SetBindGroup(0, bindGroup, 0, nullptr); pass.Dispatch(kInstances, 1, 1); pass.EndPass(); diff --git a/src/tests/end2end/DepthStencilStateTests.cpp b/src/tests/end2end/DepthStencilStateTests.cpp index 87f617d61d..4e6bf8e493 100644 --- a/src/tests/end2end/DepthStencilStateTests.cpp +++ b/src/tests/end2end/DepthStencilStateTests.cpp @@ -283,7 +283,7 @@ class DepthStencilStateTest : public DawnTest { pass.SetPipeline(pipeline); pass.SetStencilReference(test.stencil); // Set the stencil reference - pass.SetBindGroup(0, bindGroup); // Set the bind group which contains color and depth data + pass.SetBindGroup(0, bindGroup, 0, nullptr); // Set the bind group which contains color and depth data pass.Draw(6, 1, 0, 0); } pass.EndPass(); diff --git a/src/tests/end2end/IOSurfaceWrappingTests.cpp b/src/tests/end2end/IOSurfaceWrappingTests.cpp index d9d47a7c0d..9390cbfd65 100644 --- a/src/tests/end2end/IOSurfaceWrappingTests.cpp +++ b/src/tests/end2end/IOSurfaceWrappingTests.cpp @@ -304,7 +304,7 @@ class IOSurfaceUsageTests : public IOSurfaceTestBase { { dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); pass.SetPipeline(pipeline); - pass.SetBindGroup(0, bindGroup); + pass.SetBindGroup(0, bindGroup, 0, nullptr); pass.Draw(6, 1, 0, 0); pass.EndPass(); } diff --git a/src/tests/end2end/PushConstantTests.cpp b/src/tests/end2end/PushConstantTests.cpp index c425ff6864..c85aca631e 100644 --- a/src/tests/end2end/PushConstantTests.cpp +++ b/src/tests/end2end/PushConstantTests.cpp @@ -216,7 +216,7 @@ TEST_P(PushConstantTest, ComputePassDefaultsToZero) { // Test compute push constants are set to zero by default. pass.SetPipeline(pipeline); - pass.SetBindGroup(0, binding.bindGroup); + pass.SetBindGroup(0, binding.bindGroup, 0, nullptr); pass.Dispatch(1, 1, 1); // Set push constants to non-zero value to check they will be reset to zero // on the next BeginComputePass @@ -228,7 +228,7 @@ TEST_P(PushConstantTest, ComputePassDefaultsToZero) { dawn::ComputePassEncoder pass = encoder.BeginComputePass(); pass.SetPipeline(pipeline); - pass.SetBindGroup(0, binding.bindGroup); + pass.SetBindGroup(0, binding.bindGroup, 0, nullptr); pass.Dispatch(1, 1, 1); pass.EndPass(); @@ -285,7 +285,7 @@ TEST_P(PushConstantTest, VariousConstantTypes) { pass.SetPushConstants(dawn::ShaderStageBit::Compute, 0, 3, reinterpret_cast(&values)); pass.SetPipeline(pipeline); - pass.SetBindGroup(0, binding.bindGroup); + pass.SetBindGroup(0, binding.bindGroup, 0, nullptr); pass.Dispatch(1, 1, 1); pass.EndPass(); @@ -316,12 +316,12 @@ TEST_P(PushConstantTest, InheritThroughPipelineLayoutChange) { // Set Push constant before there is a pipeline set pass.SetPushConstants(dawn::ShaderStageBit::Compute, 0, 1, &one); pass.SetPipeline(pipeline1); - pass.SetBindGroup(0, binding1.bindGroup); + pass.SetBindGroup(0, binding1.bindGroup, 0, nullptr); pass.Dispatch(1, 1, 1); // Change the push constant before changing pipeline layout pass.SetPushConstants(dawn::ShaderStageBit::Compute, 0, 1, &two); pass.SetPipeline(pipeline2); - pass.SetBindGroup(0, binding2.bindGroup); + pass.SetBindGroup(0, binding2.bindGroup, 0, nullptr); pass.Dispatch(1, 1, 1); pass.EndPass(); @@ -352,7 +352,7 @@ TEST_P(PushConstantTest, SetAllConstantsToNonZero) { pass.SetPushConstants(dawn::ShaderStageBit::Compute, 0, kMaxPushConstants, &values[0]); pass.SetPipeline(pipeline); - pass.SetBindGroup(0, binding.bindGroup); + pass.SetBindGroup(0, binding.bindGroup, 0, nullptr); pass.Dispatch(1, 1, 1); pass.EndPass(); diff --git a/src/tests/end2end/SamplerTests.cpp b/src/tests/end2end/SamplerTests.cpp index 760f47aa24..315a3b240a 100644 --- a/src/tests/end2end/SamplerTests.cpp +++ b/src/tests/end2end/SamplerTests.cpp @@ -142,7 +142,7 @@ protected: { dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&mRenderPass.renderPassInfo); pass.SetPipeline(mPipeline); - pass.SetBindGroup(0, bindGroup); + pass.SetBindGroup(0, bindGroup, 0, nullptr); pass.Draw(6, 1, 0, 0); pass.EndPass(); } diff --git a/src/tests/end2end/TextureViewTests.cpp b/src/tests/end2end/TextureViewTests.cpp index 94720e2a82..1a41d2453c 100644 --- a/src/tests/end2end/TextureViewTests.cpp +++ b/src/tests/end2end/TextureViewTests.cpp @@ -180,7 +180,7 @@ protected: { dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&mRenderPass.renderPassInfo); pass.SetPipeline(pipeline); - pass.SetBindGroup(0, bindGroup); + pass.SetBindGroup(0, bindGroup, 0, nullptr); pass.Draw(6, 1, 0, 0); pass.EndPass(); } diff --git a/src/tests/unittests/validation/CommandBufferValidationTests.cpp b/src/tests/unittests/validation/CommandBufferValidationTests.cpp index 8ceb5833b9..da2a246fc1 100644 --- a/src/tests/unittests/validation/CommandBufferValidationTests.cpp +++ b/src/tests/unittests/validation/CommandBufferValidationTests.cpp @@ -193,7 +193,7 @@ TEST_F(CommandBufferValidationTest, BufferWithReadAndWriteUsage) { DummyRenderPass dummyRenderPass(device); dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass); pass.SetIndexBuffer(buffer, 0); - pass.SetBindGroup(0, bg); + pass.SetBindGroup(0, bg, 0, nullptr); pass.EndPass(); ASSERT_DEVICE_ERROR(encoder.Finish()); } @@ -224,7 +224,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); + pass.SetBindGroup(0, bg, 0, nullptr); pass.EndPass(); ASSERT_DEVICE_ERROR(encoder.Finish()); }