diff --git a/generator/templates/dawn_wire/server/ServerDoers.cpp b/generator/templates/dawn_wire/server/ServerDoers.cpp index 0c3031cffc..a663956ea3 100644 --- a/generator/templates/dawn_wire/server/ServerDoers.cpp +++ b/generator/templates/dawn_wire/server/ServerDoers.cpp @@ -94,9 +94,7 @@ namespace dawn_wire { namespace server { //* Dawn native that makes all child objects internally null if their //* Device is destroyed. while (data->info->childObjectTypesAndIds.size() > 0) { - ObjectType childObjectType; - ObjectId childObjectId; - std::tie(childObjectType, childObjectId) = UnpackObjectTypeAndId( + auto [childObjectType, childObjectId] = UnpackObjectTypeAndId( *data->info->childObjectTypesAndIds.begin()); if (!DoDestroyObject(childObjectType, childObjectId)) { return false; diff --git a/src/tests/end2end/GpuMemorySynchronizationTests.cpp b/src/tests/end2end/GpuMemorySynchronizationTests.cpp index 3c9d273726..96b732b94d 100644 --- a/src/tests/end2end/GpuMemorySynchronizationTests.cpp +++ b/src/tests/end2end/GpuMemorySynchronizationTests.cpp @@ -94,9 +94,7 @@ class GpuMemorySyncTests : public DawnTest { TEST_P(GpuMemorySyncTests, ComputePass) { // Create pipeline, bind group, and buffer for compute pass. wgpu::Buffer buffer = CreateBuffer(); - wgpu::ComputePipeline compute; - wgpu::BindGroup bindGroup; - std::tie(compute, bindGroup) = CreatePipelineAndBindGroupForCompute(buffer); + auto [compute, bindGroup] = CreatePipelineAndBindGroupForCompute(buffer); wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); // Iterate the read-add-write operations in compute pass a few times. @@ -126,10 +124,7 @@ TEST_P(GpuMemorySyncTests, RenderPass) { // Create pipeline, bind group, and buffer for render pass. wgpu::Buffer buffer = CreateBuffer(); utils::BasicRenderPass renderPass = utils::CreateBasicRenderPass(device, 1, 1); - wgpu::RenderPipeline render; - wgpu::BindGroup bindGroup; - std::tie(render, bindGroup) = - CreatePipelineAndBindGroupForRender(buffer, renderPass.colorFormat); + auto [render, bindGroup] = CreatePipelineAndBindGroupForRender(buffer, renderPass.colorFormat); wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); // Iterate the read-add-write operations in render pass a few times. @@ -155,14 +150,9 @@ TEST_P(GpuMemorySyncTests, RenderPassToComputePass) { // Create pipeline, bind group, and buffer for render pass and compute pass. wgpu::Buffer buffer = CreateBuffer(); utils::BasicRenderPass renderPass = utils::CreateBasicRenderPass(device, 1, 1); - wgpu::RenderPipeline render; - wgpu::BindGroup bindGroup0; - std::tie(render, bindGroup0) = - CreatePipelineAndBindGroupForRender(buffer, renderPass.colorFormat); - wgpu::ComputePipeline compute; - wgpu::BindGroup bindGroup1; - std::tie(compute, bindGroup1) = CreatePipelineAndBindGroupForCompute(buffer); + auto [render, bindGroup0] = CreatePipelineAndBindGroupForRender(buffer, renderPass.colorFormat); + auto [compute, bindGroup1] = CreatePipelineAndBindGroupForCompute(buffer); wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); @@ -192,15 +182,10 @@ TEST_P(GpuMemorySyncTests, RenderPassToComputePass) { TEST_P(GpuMemorySyncTests, ComputePassToRenderPass) { // Create pipeline, bind group, and buffer for compute pass and render pass. wgpu::Buffer buffer = CreateBuffer(); - wgpu::ComputePipeline compute; - wgpu::BindGroup bindGroup1; - std::tie(compute, bindGroup1) = CreatePipelineAndBindGroupForCompute(buffer); + auto [compute, bindGroup1] = CreatePipelineAndBindGroupForCompute(buffer); utils::BasicRenderPass renderPass = utils::CreateBasicRenderPass(device, 1, 1); - wgpu::RenderPipeline render; - wgpu::BindGroup bindGroup0; - std::tie(render, bindGroup0) = - CreatePipelineAndBindGroupForRender(buffer, renderPass.colorFormat); + auto [render, bindGroup0] = CreatePipelineAndBindGroupForRender(buffer, renderPass.colorFormat); wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); @@ -300,12 +285,8 @@ TEST_P(StorageToUniformSyncTests, ReadAfterWriteWithSameCommandBuffer) { // Create pipeline, bind group, and buffer for compute pass and render pass. CreateBuffer(); utils::BasicRenderPass renderPass = utils::CreateBasicRenderPass(device, 1, 1); - wgpu::ComputePipeline compute; - wgpu::BindGroup computeBindGroup; - std::tie(compute, computeBindGroup) = CreatePipelineAndBindGroupForCompute(); - wgpu::RenderPipeline render; - wgpu::BindGroup renderBindGroup; - std::tie(render, renderBindGroup) = CreatePipelineAndBindGroupForRender(renderPass.colorFormat); + auto [compute, computeBindGroup] = CreatePipelineAndBindGroupForCompute(); + auto [render, renderBindGroup] = CreatePipelineAndBindGroupForRender(renderPass.colorFormat); // Write data into a storage buffer in compute pass. wgpu::CommandEncoder encoder0 = device.CreateCommandEncoder(); @@ -336,12 +317,8 @@ TEST_P(StorageToUniformSyncTests, ReadAfterWriteWithDifferentCommandBuffers) { // Create pipeline, bind group, and buffer for compute pass and render pass. CreateBuffer(); utils::BasicRenderPass renderPass = utils::CreateBasicRenderPass(device, 1, 1); - wgpu::ComputePipeline compute; - wgpu::BindGroup computeBindGroup; - std::tie(compute, computeBindGroup) = CreatePipelineAndBindGroupForCompute(); - wgpu::RenderPipeline render; - wgpu::BindGroup renderBindGroup; - std::tie(render, renderBindGroup) = CreatePipelineAndBindGroupForRender(renderPass.colorFormat); + auto [compute, computeBindGroup] = CreatePipelineAndBindGroupForCompute(); + auto [render, renderBindGroup] = CreatePipelineAndBindGroupForRender(renderPass.colorFormat); // Write data into a storage buffer in compute pass. wgpu::CommandBuffer cb[2]; @@ -375,12 +352,8 @@ TEST_P(StorageToUniformSyncTests, ReadAfterWriteWithDifferentQueueSubmits) { // Create pipeline, bind group, and buffer for compute pass and render pass. CreateBuffer(); utils::BasicRenderPass renderPass = utils::CreateBasicRenderPass(device, 1, 1); - wgpu::ComputePipeline compute; - wgpu::BindGroup computeBindGroup; - std::tie(compute, computeBindGroup) = CreatePipelineAndBindGroupForCompute(); - wgpu::RenderPipeline render; - wgpu::BindGroup renderBindGroup; - std::tie(render, renderBindGroup) = CreatePipelineAndBindGroupForRender(renderPass.colorFormat); + auto [compute, computeBindGroup] = CreatePipelineAndBindGroupForCompute(); + auto [render, renderBindGroup] = CreatePipelineAndBindGroupForRender(renderPass.colorFormat); // Write data into a storage buffer in compute pass. wgpu::CommandBuffer cb[2]; diff --git a/src/tests/unittests/validation/BindGroupValidationTests.cpp b/src/tests/unittests/validation/BindGroupValidationTests.cpp index 4051acafb0..16302b9e90 100644 --- a/src/tests/unittests/validation/BindGroupValidationTests.cpp +++ b/src/tests/unittests/validation/BindGroupValidationTests.cpp @@ -1916,9 +1916,7 @@ class SetBindGroupPersistenceValidationTest : public ValidationTest { // Test it is valid to set bind groups before setting the pipeline. TEST_F(SetBindGroupPersistenceValidationTest, BindGroupBeforePipeline) { - std::vector bindGroupLayouts; - wgpu::RenderPipeline pipeline; - std::tie(bindGroupLayouts, pipeline) = SetUpLayoutsAndPipeline({{ + auto [bindGroupLayouts, pipeline] = SetUpLayoutsAndPipeline({{ {{ wgpu::BufferBindingType::Uniform, wgpu::BufferBindingType::Uniform, @@ -1957,9 +1955,7 @@ TEST_F(SetBindGroupPersistenceValidationTest, BindGroupBeforePipeline) { // Test that it is valid to draw with bind groups that are not "inherited". They persist // after a pipeline change. TEST_F(SetBindGroupPersistenceValidationTest, NotVulkanInheritance) { - std::vector bindGroupLayoutsA; - wgpu::RenderPipeline pipelineA; - std::tie(bindGroupLayoutsA, pipelineA) = SetUpLayoutsAndPipeline({{ + auto [bindGroupLayoutsA, pipelineA] = SetUpLayoutsAndPipeline({{ {{ wgpu::BufferBindingType::Uniform, wgpu::BufferBindingType::Storage, @@ -1970,9 +1966,7 @@ TEST_F(SetBindGroupPersistenceValidationTest, NotVulkanInheritance) { }}, }}); - std::vector bindGroupLayoutsB; - wgpu::RenderPipeline pipelineB; - std::tie(bindGroupLayoutsB, pipelineB) = SetUpLayoutsAndPipeline({{ + auto [bindGroupLayoutsB, pipelineB] = SetUpLayoutsAndPipeline({{ {{ wgpu::BufferBindingType::Storage, wgpu::BufferBindingType::Uniform,